GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ovr/StaticScript: :rocket: TypeScript compiler on top of TypeScript as frontend and LLVM as backend

BranchesTags
Open more actions menu

Latest commit

 

History

254 Commits
254 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
docker
docker
 
 
docs/assets
docs/assets
 
 
packages
packages
 
 
runtime-test
runtime-test
 
 
sandbox
sandbox
 
 
src
src
 
 
tests
tests
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
staticscript.d.ts
staticscript.d.ts
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

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.

About

🚀 TypeScript compiler on top of TypeScript as frontend and LLVM as backend

Topics

llvmtypescript

Resources

Readme
License
Activity

Stars

656 stars

Watchers

19 watching

Forks

30 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.