Native speed
Generics compile to specialized code. number becomes a machine integer wherever that provably gives the same result. No boxing, no GC.
Velt compiles typed, modern TypeScript (classes, interfaces, generics, async/await) through LLVM to one native executable. No interpreter, no garbage collector, every core in use. It isn't a drop-in for every .ts file yet: see what's in.
Apple silicon and Intel, in Terminal. Brings its own linker — no Xcode, Visual Studio or C compiler needed.
import { serve } from "http-server"; interface User { id: string; name: string; } const users = new Map<string, User>(); users.set("42", { id: "42", name: "Ada" }); await serve({ port: 8080 }, (req: Request): Response => { const id = new URL(req.url).searchParams.get("id") ?? ""; const user = users.get(id); if (user === undefined) { return Response.json({ error: `no user ${id}` }, { status: 404 }); } return Response.json(user); });
velt run app.ts runs your file, and .ts and .velt import each other, so a project moves over one file at a time. Valid TypeScript behaves as it does in Node; where JavaScript is a trap, the compiler stops and says what to write instead.
Classes, interfaces, generics, unions and narrowing, discriminated unions, closures, async/await, template literals, destructuring, spread, ?. and ??, ES modules, try/catch, using, TSX.
eval, prototypes, run-time decorators, with, delete, 1 == "1" — the dynamic parts a native compiler can't make fast or safe.
Generics compile to specialized code. number becomes a machine integer wherever that provably gives the same result. No boxing, no GC.
A multi-threaded scheduler. Handlers spread over all cores, spawn puts work on another — and data races are compile errors.
Objects are references, as in JavaScript. Memory is freed the moment the last reference goes — no GC pauses, and using runs at a known point.
velt build --release writes a native executable. Nothing to install on the server, no node_modules. Cross-compile from any OS.
1 == "1" is a compile error. A forgotten await is caught before it drops an error. Every message says what to write instead.
velt dev swaps changed functions into the running program, keeping its memory, open connections and running tasks.
Web servers and the Redis, Postgres and SQLite clients, measured against Rust, Go, Bun and Node. Every number links to its method and raw data.
All benchmarks and methodsAMD EPYC 7763, each server on 8 pinned cores. TechEmpower-style suite, bench/web.
TypeScript compiles to JavaScript, so it stops where JavaScript stops. Velt compiles to native code, so it keeps going: real number types, typed errors, every core, C libraries, and code that runs at compile time.
// Real integer types: u32 wraps as in C or Rust. function fnv1a(text: string): u32 { let hash: u32 = 2166136261; for (let i = 0; i < text.length; i++) { hash = (hash ^ (text.charCodeAt(i) as u32)) * 16777619; } return hash; }
i8 to i64, u8 to u64, f32 and f64, with suffixes like 255u8. A u32 wraps as in C or Rust, and number becomes a machine integer wherever that gives the same result.
BigInt or bit tricks like | 0.The same Velt code compiles to a native executable, to WebAssembly for WASI runtimes and JavaScript hosts, or straight to a Cloudflare Worker. A server written with http-server's serve runs natively and on Workers without a change.
import { serve } from "http-server"; await serve({ port: 8080 }, (req: Request): Response => { const name = new URL(req.url).searchParams.get("name") ?? "world"; return Response.json({ hello: name }); });
# package.velt depends on http-server, cloudflare, host-cloudflare $ velt build --release --host host-cloudflare $ cd target/velt/app-workers && npx wrangler deploy
velt build --host builds for a JavaScript platform described by a host package. host-cloudflare is the first: the output is a Worker, ready for wrangler.
http-server's serve runs with no change to the programvelt playground opens an editor with examples. Your machine compiles, your browser runs the module in a Web Worker.
async/await, spawn and Promise.all run on one thread in WebAssembly: tasks take turns at each await, and on a JavaScript host the program hands control back while it waits.
Release toolchains don't include the WebAssembly runtime yet. WebAssembly builds need a checkout of the Velt repository and the Rust toolchain.
Setup →$ velt new hello # --template api | cli | websocket | lib $ cd hello $ velt run # build and run src/main.velt $ velt dev # hot-swap your changes on every save $ velt test # run the tests $ velt fmt # format the code $ velt build --release ✓ target/velt/hello native executable
The VS Code extension: errors as you type, completion, rename, quick fixes, and F5 debugging with no setup. Other editors use velt lsp.
Until a library exists in Velt, a package calls the C library that does it with declare c, checked against its headers. sqlite does. Its users need no C compiler.
velt run app.ts compiles and runs it, or velt new hello to start fresh. If something isn't supported, the error says what to write instead.