Skip to content
Proyectos

ovr/StaticScript

Ver en GitHub

Acerca de

:rocket: Compilador de TypeScript que utiliza TypeScript como frontend y LLVM como backend.

Lenguajes y entornos de ejecución

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

StaticScript

Real Static Typed Script - RSTS project.

StaticScript is a language on top of TypeScript as frontend and LLVM as backend for code-generation to binary.

How it was implemented

My talk about How it's working on hight level and about V8/JIT and etc

Video

I prepared two talks on PiterJS meetup with explanation about how it was implemented

Part 1

Slides

Video

Part 2

Slides

(Video)(Sorry, but due technical problems on meetup It was not recorded)

Installing

For latest stable version:

npm install -g static-script

Let's write simple example

Put it in calculate-pi.ts

{
    function calculatePI(cycles: number): number {
        let inside = 0;

        for (let i = 0; i < cycles; i++) {
            let x = Math.random() * 2 - 1;
            let y = Math.random() * 2 - 1;

            if ((x*x + y*y) < 1) {
                inside++
            }
        }

        return 4.0 * inside / cycles;
    }

    console_log(calculatePI(1000000000));
}

Next compile it:

$ ./bin/ssc calculate-pi.ts

Next run it:

$ time ./output/main

This will produce:

3.144800
./output/main  0,01s user 0,00s system 80% cpu 0,013 total

LICENSE

This project is open-sourced software licensed under the MIT License.

See the LICENSE file for more information.

Explorar proyectos relacionados

Cargando…