Skip to content

ChadScriptTypeScript, compiled to native code.

A compiler that takes a statically analyzable subset of TypeScript and generates optimized machine code via LLVM — the same backend behind C, Rust, and Swift.

0.8ms
cold start
~250KB
binary size
621+
tests passing
self-hosting
compiles itself
SOURCE
PARSE
ANALYZE
CODEGEN
LINK
function fib(n: number): number {
FunctionDecl
if (n <= 1) return n;
IfStmt
ReturnExpr
return fib(n-1) + fib(n-2);
CallExpr
BinaryAdd
CallExpr
}
ReturnStmt
console.log(fib(42));
CallExpr
FunctionDecldefine i64 @fib(i64 %n) {
IfStmt %cmp = icmp sle i64 %n, 1
ReturnExpr br i1 %cmp, label %b, %r
CallExpr %a = call i64 @fib(%n-1)
BinaryAdd %s = add nsw i64 %a, %b
CallExpr %b = call i64 @fib(%n-2)
ReturnStmt ret i64 %s
CallExpr}
fib
standalone native binary
247 KB · 0.8ms cold start
Same LLVM optimization passes as C, Rust, and Swift. No VM, no JIT — just machine code.

It's Fast.

Your code goes through the same LLVM optimization passes as C and Rust. No interpreter, no JIT warmup, no virtual machine overhead. The binary starts in under a millisecond and runs at native speed.

BenchmarkChadScriptNode.jsvs NodeC
Cold Start0.6ms21.8ms36x0.6ms
Monte Carlo Pi0.398s1.474s3.7x0.400s
File I/O0.089s0.315s3.5x0.088s
JSON Parse0.005s0.015s3.0x0.004s
Fibonacci1.424s2.842s2.0x0.725s
N-Body Sim1.852s2.296s1.2x1.453s

Full benchmarks →

It's Familiar.

No new syntax to learn. If you write TypeScript, you already know ChadScript.

Classes & inheritance
Interfaces & type aliases
Generics
async / await
Closures
Destructuring & spread
Template literals
Arrow functions
for...of / for...in
Map, Set, Uint8Array
Promise.all / .race
JSX
Modules & imports
try / catch / finally
typescript
import { httpServe, Router, Context } from "chadscript/http";

const app: Router = new Router();
app.get("/", (c: Context) => c.json({ hello: "world" }));
httpServe(3000, (req: HttpRequest) => app.handle(req));
A complete HTTP server. chad build app.ts → 247KB binary, 0.8ms startup.

It's Friendly.

No package manager. No node_modules. Everything ships with the compiler.

HTTP serverRouter, httpServe, WebSocket
SQLiteopen, query, exec, transactions
fetchGET, POST, headers, JSON
cryptoSHA-256, HMAC, randomBytes
fsread, write, stat, readdir
JSONparse<T>, stringify
child_processexecSync, spawnSync
RegExptest, match, replace
pathjoin, resolve, dirname
processargv, env, exit, cwd

In production today: chadsmith.dev/hn and chadsmith.dev/weather — both running as single ChadScript binaries.

bash
curl -fsSL https://raw.githubusercontent.com/cs01/ChadScript/main/install.sh | sh

ChadScript compiles a subset of TypeScript — not a drop-in replacement. See what's supported →