项目
在 GitHub 查看
ovr/StaticScript
关于
:rocket: 以 TypeScript 作为前端、LLVM 作为后端构建的 TypeScript 编译器。
编程语言与运行时实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
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
I prepared two talks on PiterJS meetup with explanation about how it was implemented
Part 1
Part 2
(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.
探索相关项目
加载中…