Gizlang
TypeScript syntax. Native speed. One toolchain.
Gizlang reads like TypeScript and compiles to native code through LLVM. The compiler, the standard
library, the test runner, the formatter, the language server and live code swap are one command:
gizlang.
type Item = { name: string; price: i64; };
function total(items: Vec<Item>): i64 {
let sum = 0;
for (const item of items) { sum += item.price; }
return sum;
}
function main(): void {
const cart = [Item("tea", 4), Item("cake", 7)];
print("Total: " + string(total(cart)));
}Total: 11Why Gizlang
On LangArena's 50 realistic programs, our run scores 90.7. Rust scores 90.6 and C 90.2 on the same machine.
Values are reference-counted and copied only when shared. Memory goes back when its last owner goes. There are no collection pauses.
There are no exceptions. A function that can fail returns a
Result. The compiler refuses amatchthat forgets a case.TSX-style markup in ordinary
.gizfiles compiles to typed, escaped HTML. Components are typed functions.giz livereplaces the code of a running program and keeps its state. An edit to an app of 800 lines is live in 53 ms.Files, network and processes come from the
Systemvalue thatmainreceives. A function that has noSystemcannot reach them.One million switches between hot tasks take 18 ms. Channels connect them.
giz check --json,giz outlineandgiz capabilitiesgive structured answers. Every docs page is Markdown at/llms.txt.
One command for the whole job
| Job | Command |
|---|---|
| Run a file | giz main.giz |
| Check types, without a run | giz check main.giz |
| Test | giz test |
| Format | giz fmt |
| Build a native executable | giz build main.giz -o app |
| Build WebAssembly | giz build --wasm main.giz -o app.wasm |
| Change a running program | giz live main.giz |
| Read the docs of a module | giz doc Json |
| Debug | giz build --debug main.giz -o app, then gdb, lldb or VS Code |
| Editor support | giz lsp and the VS Code extension |
| Interactive session | giz repl |
The command line guide shows each one.
Editor and debugger
The VS Code extension shows what the compiler says as you type: errors with their fixes,
completion, hover, rename, formatting and inlay hints. Its Test Explorer runs the tests of each file. Press F5 to
debug: breakpoints in .giz files, stepping by line, the call stack and the variables by their Gizlang names.
gdb and lldb debug the same builds from a terminal (Debugging).
The standard library
37 modules ship compiled in the toolchain. A program imports them as gizlang:NAME, with no
package install.
| Area | Modules |
|---|---|
| Core and data | core, collections, text, unicode, regex, json, csv, math, random, time |
| Web and network | http, html, tls, acme, crypto, security, compress |
| Data stores | sqlite, postgres, odbc, journal |
| Concurrency and live code | task, live, memory, metrics |
| System | system, path, native, runtime |
| Compute | tensor, nn, grad, gpu, kernel |
| JavaScript interop | js |
| Tests | test |
Learn it
- Try it in the browser. The Playground runs any example on this site.
- Install it. One signed installer for Linux x86-64.
- Take the tour. The language guide is for developers who know TypeScript, JavaScript or Go.