0.8.1 • Published 5 years ago

static-script v0.8.1

Weekly downloads
15
License
MIT
Repository
-
Last release
5 years ago

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.

npm.io

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.

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago