Skip to content
Linux · macOS · Windows · WebAssembly

Familiar as TypeScript. Fast as Rust.

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.

$curl -fsSL https://github.com/velt-lang/velt/releases/latest/download/get-velt.sh | sh

Apple silicon and Intel, in Terminal. Brings its own linker — no Xcode, Visual Studio or C compiler needed.

Starting with an AI assistant? Point it at veltlang.com/llms.txt
src/main.veltvelt run
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);
});
A complete HTTP server, on the http-server package.Every core answers requests.
7×the JSON requests of Node
1.2×the JSON requests of Rust's axum
8 MBidle web server memory
3 msto start a program and exit
6 MBone executable to deploy
Why Velt

If you write TypeScript, you already write Velt.

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.

Works as in TypeScript

Classes, interfaces, generics, unions and narrowing, discriminated unions, closures, async/await, template literals, destructuring, spread, ?. and ??, ES modules, try/catch, using, TSX.

Left out on purpose

eval, prototypes, run-time decorators, with, delete, 1 == "1" — the dynamic parts a native compiler can't make fast or safe.

Every difference, on one page →

Native speed

Generics compile to specialized code. number becomes a machine integer wherever that provably gives the same result. No boxing, no GC.

Every core, not one

A multi-threaded scheduler. Handlers spread over all cores, spawn puts work on another — and data races are compile errors.

Memory you don't think about

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.

One file to ship

velt build --release writes a native executable. Nothing to install on the server, no node_modules. Cross-compile from any OS.

Fixes JavaScript's traps

1 == "1" is a compile error. A forgotten await is caught before it drops an error. Every message says what to write instead.

A 60 ms edit loop

velt dev swaps changed functions into the running program, keeping its memory, open connections and running tasks.

Benchmarks

The whole stack is fast, not just the loop.

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 methods
JSON responses, 64 connectionsrequests / s · higher is better
Velt345k
Rust · axum346k
Node · cluster243k
Go229k
Bun63k
Node30k

AMD EPYC 7763, each server on 8 pinned cores. TechEmpower-style suite, bench/web.

Beyond TypeScript

TypeScript's syntax. Then everything a compiler adds.

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.

Areas
7
Features
32
New in 0.6
12
Numbers and types

Real number types, and your own operators.

hash.velt
// 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.

In TypeScriptEvery number is a 64-bit float. Integer maths needs BigInt or bit tricks like | 0.
Numbers →
Run anywhere

One program. Native, in the browser, or at the edge.

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.

src/main.veltunchanged
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 });
});
terminal
# package.velt depends on http-server, cloudflare, host-cloudflare
$ velt build --release --host host-cloudflare
$ cd target/velt/app-workers && npx wrangler deploy
Cloudflare Workers

The same server, deployed to the edge.

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 program
  • A host package is an ordinary package: new platforms need no compiler change
  • R2
  • D1
  • KV
  • Cache
  • Durable Object stubs
The cloudflare package →

Try it in the playground

velt playground opens an editor with examples. Your machine compiles, your browser runs the module in a Web Worker.

The playground →

The whole language, one thread

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.

What works →

For now: build from a checkout

Release toolchains don't include the WebAssembly runtime yet. WebAssembly builds need a checkout of the Velt repository and the Rust toolchain.

Setup →
Everything in one tool

Build, run, test, format, package. One binary.

Terminal
$ 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

Editor and debugger

The VS Code extension: errors as you type, completion, rename, quick fixes, and F5 debugging with no setup. Other editors use velt lsp.

Get the extension →

Any C library, one declaration away

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.

Native packages →

Try it on a TypeScript file you have.

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.