• Stars
    star
    591
  • Rank 73,092 (Top 2 %)
  • Language
    TypeScript
  • License
    Other
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

phpsa

Smart/Static Analyzer(sis) for PHP :bowtie::neckbeard:
PHP
640
star
2

react-native-status-bar-height

Small library that helps you to get status bar height, P.S 📱X supported ❤️
TypeScript
422
star
3

phalcon-module-skeleton

🐥 Phalcon modules skeleton is an application template for building beauty applications on Phalcon framework.
PHP
131
star
4

perfect-php-vagrant

💻 Web development Vagrant machine with PHP + Phalcon/Lynx/Zephir, Nginx, Node+Bower/Gulp/Grunt
PHP
52
star
5

ghubber

📱 Mobile client for GitHub build on React Native :atom:
JavaScript
46
star
6

phalcon-elasticsearch

Easy way to use Elastic in Phalcon
PHP
30
star
7

phalcony

🐣 Library for expansion the base functional of Phalcon framework
PHP
19
star
8

async-std

TypeScript
18
star
9

tinkoff-invest-rust

gRPC Клиент для Тинькофф Инвестиций (протокол v2)
Rust
8
star
10

awesome-zephir

7
star
11

shingles

Алгоритм шинглов
PHP
6
star
12

phalcon-rest-edition

Phalcon Rest Api Edition Skeleton
PHP
4
star
13

CypherCore

5.1.0a MOP World of Warcraft emulator source
C#
4
star
14

go-calculate-thrift

A simple RPC Client/Server example with Apache Thrift Protocol generator
Go
3
star
15

swagger-assert-helper

🌈 Test your API by Swagger like a god on the 🚀
PHP
3
star
16

php-web-benchmarks

PHP
3
star
17

php2c

PHP to C/C++ translator tool
PHP
3
star
18

v8-vm.js

Implemenetation of Ignition interpereter from V8 on JS
JavaScript
3
star
19

learn-cpp

Simple examples to work C++ and Network stuff
C++
2
star
20

zephir-presentation

CodeFest 2015
CSS
2
star
21

tinkoff-invest-grpc-node

JavaScript
2
star
22

vk-import-users

128 Threads, 1kkk per minute from rest api service to db
PHP
2
star
23

machine-post

Эмулятор Машины Поста Онлайн
JavaScript
2
star
24

new-relic-polyfill-php

PHP
2
star
25

gitlab-super-ci

How to do super CI on gitlab (examples)
2
star
26

getting-started-phalcon-zephir

1
star
27

zephir-parser

Zephir parser on top of PHP-Parser by @nikic
PHP
1
star
28

simple-db-learn

C++
1
star
29

zephir-php-extensions

zephir-php-extensions
C
1
star
30

java-homework

Задачи и решение к ним
Java
1
star
31

php-zephir-hhvm-benchmark

Benchmark your PHP/Zephir/HHVM
C
1
star
32

imagemagick-cpp

CMake
1
star
33

array-partitioning-problem

PHP
1
star
34

go-url-checker

Go
1
star
35

xboston-birthday

JavaScript
1
star
36

ovr.github.io

My personal Page
HTML
1
star
37

Zend

Zend Framework 1.12.1 Libraries
PHP
1
star
38

cpp-homework

Домашнии работы по основам программирования и Современным технологиям программирования
C++
1
star
39

ffmpeg-demo

C++
1
star
40

phpinspectionsea-mirror

Mirror for https://bitbucket.org/kalessil/phpinspectionsea
Java
1
star