v0.2.0
TypeScript,
compiled ahead of time.
A strict subset of TypeScript. It emits LLVM IR and links a C++ runtime: single-threaded semantics, a multithreaded event loop, memory by reference counting.
- binary
- 2.5 MB
- idle rss
- 4.2 MB
- get, c=64
- 11,102/s
- peak rss
- 7.1 MB
// what it is
- compile
- Lex, parse, type-check, LLVM IR, then clang. A static executable. No VM, no JIT warmup.
- types
- No
any. Parameters must be annotated. The only implicit conversion isInt32toFloat64. Generics are monomorphized. - memory
- Automatic reference counting. The compiler inserts retain and release. Interned string literals are immortal.
- async
async/awaitlowers to promise state machines, resumed on a worker pool. Servers run onpoll(2).- wave
init,add,check,build,run. Packages live in one global registry, not anode_modulestree.- std
net,http,fs,crypto,sql(SQLite), including an express-style server.
// hello-world.tsm
Files are .tsm, kebab-case. wave run compiles and runs.
hello-world.tsm
async function main() {
let name = "marina"
let todos = ["ship v0.2", "write docs"]
const MSG = `Hello from ${name}, ${todos.length} todos`
console.log(MSG)
}
terminal
$ wave run hello-world.tsm
Hello from marina, 2 todos
// same todos api, one vcpu
HTTP + SQLite, wrk on loopback.
numbers and method
GET req/s · wrk -t4 -c64 · 30s
peak rss MB · lower is better
// three commands
shell
$ wave init # package.json + src/main.tsm
$ wave run
$ wave build # native binary in ./.marina/