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. Experimental — do not use it in production.
- binary
- 274 KB
- idle rss
- 5.3 MB
- get, c=64
- 10,879/s
- peak rss
- 7.9 MB
// install
Builds wave and marina-lsp from source into ~/.local/bin.
Needs git, CMake, a C++20 compiler, clang, and libsqlite3.
details
xcode-select --install
brew install cmake
curl -fsSL https://marina-lang.org/install.sh | sh
sudo apt install build-essential cmake clang libsqlite3-dev git curl
curl -fsSL https://marina-lang.org/install.sh | sh
irm https://marina-lang.org/install.ps1 | iex
Then open a new terminal. wave is on ~/.local/bin.
Then open a new terminal. wave is on ~/.local/bin.
Builds inside WSL. Native Windows is not supported. After install, run wsl wave.
// 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. Integers areInt8–Int64andUInt8–UInt64(defaultInt32); floats areFloat32andFloat64(defaultFloat64). An integer widens to a float, andFloat32widens toFloat64. 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/