diff --git a/README.md b/README.md
index 9fb55906..cfa9203c 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,15 @@
# ChadScript
-As fast as C, as ergonomic as TypeScript.
+TypeScript, compiled to native code.
-ChadScript compiles TypeScript to native binaries. No Node.js, no V8, no runtime. Sub-2ms startup, ~250KB binaries.
+ChadScript compiles a statically analyzable subset of TypeScript to native machine code via LLVM — the same backend behind C, Rust, and Swift. No VM, no interpreter, no runtime. The output is a standalone binary: sub-millisecond startup, ~250KB, zero dependencies.
The compiler is self-hosting and the only dependency is itself. Install with curl, not npm.
**Status: Beta** — self-hosting, 621+ tests, used in [production](https://chadsmith.dev/weather).
+**[Docs](https://cs01.github.io/ChadScript/getting-started/installation)** · **[Standard Library](https://cs01.github.io/ChadScript/stdlib/)** · **[Language Features](https://cs01.github.io/ChadScript/language/features)** · **[Benchmarks](https://cs01.github.io/ChadScript/benchmarks)**
+
---
## Install
@@ -69,61 +71,35 @@ Hono-style API, C-level performance. One binary, no node_modules. See [`examples
## Benchmarks
-Compared against C, Go, Node.js, and Bun on Ubuntu (CI):
+ChadScript compiles through LLVM, the same backend behind C and Rust — so it gets the same optimization passes. Compared against C, Go, Node.js, and Bun on Ubuntu (CI):
-| Benchmark | C | ChadScript | Go | Node | Bun |
-| -------------- | ------ | ---------- | ------ | ------ | ------ |
-| Cold Start | 0.6ms | **0.6ms** | 1.3ms | 21.8ms | 7.6ms |
-| Monte Carlo Pi | 0.400s | **0.398s** | 0.405s | 1.474s | 6.428s |
-| Fibonacci | 0.725s | **1.424s** | 1.429s | 2.842s | 1.837s |
-| JSON Parse | 0.004s | **0.005s** | 0.016s | 0.015s | 0.007s |
-| N-Body Sim | 1.453s | **1.852s** | 1.964s | 2.296s | 2.817s |
+| Benchmark | ChadScript | Node.js | vs Node | C |
+| -------------- | ---------- | ------- | -------- | ------ |
+| Cold Start | **0.6ms** | 21.8ms | **36x** | 0.6ms |
+| Monte Carlo Pi | **0.398s** | 1.474s | **3.7x** | 0.400s |
+| File I/O | **0.089s** | 0.315s | **3.5x** | 0.088s |
+| JSON Parse | **0.005s** | 0.015s | **3.0x** | 0.004s |
+| Fibonacci | **1.424s** | 2.842s | **2.0x** | 0.725s |
+| Sieve | **0.038s** | 0.054s | **1.4x** | 0.027s |
+| N-Body Sim | **1.852s** | 2.296s | **1.2x** | 1.453s |
+| Quicksort | **0.202s** | 0.249s | **1.2x** | 0.170s |
+| SQLite | **0.374s** | 0.437s | **1.2x** | 0.314s |
-Updated on every PR. [Source](https://github.com/cs01/ChadScript/tree/main/benchmarks)
+[Full benchmarks with Go and Bun](https://cs01.github.io/ChadScript/benchmarks) (updated on every PR)
---
-## How it works
-
-```bash
-chad run app.ts # compile + run in one step — no build config, no install
-chad build app.ts # or compile to a standalone binary
-```
-
-Every type is resolved at compile time. The compiler optimizes your code the same way C and Rust compilers do. `chad run` compiles and executes in one step — no build step, no install process, no config files. When you want a deployable binary, `chad build` produces a single native executable.
-
----
+## It's Fast
-## Why TypeScript syntax?
+Your code goes through the same LLVM optimization passes as C and Rust — not a JIT, not an interpreter. 0.8ms cold start, native execution speed.
-TypeScript is familiar to millions of developers, and LLMs generate it fluently. ChadScript uses a statically-typed subset where every type is resolved at compile time — no `any`, no runtime type checks, no surprises:
+## It's Familiar
-- **Null safety** — `string` is never null. Use `string | null` and `?.` for optional values.
-- **No manual memory management** — automatic garbage collection. No use-after-free, no double-frees.
-- **Compile-time error catching** — type mismatches, invalid method calls, and unsafe patterns are caught before your code runs.
-- **C interop** — call any C library directly with `declare function`. No wrappers, no overhead.
-- **IDE support** — `chad init` generates `tsconfig.json` with ChadScript types. VS Code works out of the box.
+Classes, interfaces, generics, async/await, closures, destructuring, template literals, JSX, `for...of`, `Map`, `Set`, `Promise.all` — it's the TypeScript you already write. No new syntax, no new mental model.
----
+## It's Friendly
-## What's included
-
-No `npm install`. Everything ships with the compiler:
-
-| Module | What it does |
-| --------------------- | ------------------------ |
-| `fetch` | HTTP client |
-| `Router`, `httpServe` | HTTP server with routing |
-| `fs` | File system |
-| `sqlite` | Embedded database |
-| `crypto` | Hashing, random bytes |
-| `JSON` | Typed parse/stringify |
-| `child_process` | Spawn subprocesses |
-| `WebSocket` | WebSocket server |
-| `Map`, `Set` | Hash map and set |
-| `RegExp` | Regular expressions |
-| `console` | Prints any type |
-| `ArgumentParser` | CLI argument parsing |
+No `npm install`. Everything ships with the compiler: HTTP server, SQLite, fetch, crypto, WebSocket, JSON, filesystem, regex, child processes, argument parsing. Write your code, compile it, ship a single binary.
---
@@ -150,4 +126,3 @@ See [`examples/cli-tools/`](examples/cli-tools/) for a suite of Unix tool replac
- [Quickstart](https://cs01.github.io/ChadScript/getting-started/quickstart)
- [Supported Features](https://cs01.github.io/ChadScript/language/features)
- [Standard Library](https://cs01.github.io/ChadScript/stdlib/)
-- [FAQ](https://cs01.github.io/ChadScript/faq)
diff --git a/benchmarks/assemble_json.py b/benchmarks/assemble_json.py
index 7fc31ea7..fc41105a 100644
--- a/benchmarks/assemble_json.py
+++ b/benchmarks/assemble_json.py
@@ -46,7 +46,16 @@
continue
lang, value, label = parts[0], parts[1], parts[2]
try:
- results[lang] = {"value": round(float(value), 3), "label": label}
+ rounded = round(float(value), 3)
+ meta_info = META.get(bkey, {"metric": "s"})
+ metric = meta_info.get("metric", "s")
+ if metric == "ms":
+ clean_label = f"{rounded}ms"
+ elif metric in ("req/s", "msg/s"):
+ clean_label = f"{int(rounded)} {metric}"
+ else:
+ clean_label = f"{rounded:.3f}s"
+ results[lang] = {"value": rounded, "label": clean_label}
except ValueError:
continue
if lang == "chadscript":
diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
index b3dfd9ee..6afdeef6 100644
--- a/docs/.vitepress/config.mts
+++ b/docs/.vitepress/config.mts
@@ -23,72 +23,84 @@ export default defineConfig({
},
nav: [
- { text: 'Getting Started', link: '/getting-started/installation' },
- { text: 'Fundamentals', link: '/language/features' },
- { text: 'Reference', link: '/stdlib/' },
- { text: 'GitHub', link: 'https://github.com/cs01/ChadScript' }
+ { text: 'Docs', link: '/getting-started/installation' },
+ { text: 'Standard Library', link: '/stdlib/' },
+ { text: 'Benchmarks', link: '/benchmarks' },
],
- sidebar: [
- {
- text: 'Getting Started',
- items: [
- { text: 'What is ChadScript?', link: '/why-chadscript' },
- { text: 'Installation', link: '/getting-started/installation' },
- { text: 'Quickstart', link: '/getting-started/quickstart' },
- { text: 'IDE Setup', link: '/getting-started/ide-setup' },
- ]
- },
- {
- text: 'Fundamentals',
- items: [
- { text: 'Language', link: '/language/features' },
- { text: 'How It Works', link: '/language/architecture' },
- { text: 'FFI', link: '/language/ffi' },
- { text: 'Debugging', link: '/getting-started/debugging' },
- ]
- },
- {
- text: 'Reference',
- items: [
- { text: 'CLI', link: '/getting-started/cli' },
- { text: 'Type Mappings', link: '/language/type-mappings' },
- {
- text: 'Standard Library',
- collapsed: true,
- items: [
- { text: 'Overview', link: '/stdlib/' },
- { text: 'Array Methods', link: '/stdlib/array' },
- { text: 'Async', link: '/stdlib/async' },
- { text: 'ChadScript.embed', link: '/stdlib/embed' },
- { text: 'child_process', link: '/stdlib/child-process' },
- { text: 'console', link: '/stdlib/console' },
- { text: 'crypto', link: '/stdlib/crypto' },
- { text: 'Date', link: '/stdlib/date' },
- { text: 'fetch', link: '/stdlib/fetch' },
- { text: 'fs', link: '/stdlib/fs' },
- { text: 'HTTP Server / Router', link: '/stdlib/http-server' },
- { text: 'JSON', link: '/stdlib/json' },
- { text: 'Map', link: '/stdlib/map' },
- { text: 'Math', link: '/stdlib/math' },
- { text: 'Number', link: '/stdlib/number' },
- { text: 'Object', link: '/stdlib/object' },
- { text: 'os', link: '/stdlib/os' },
- { text: 'path', link: '/stdlib/path' },
- { text: 'process', link: '/stdlib/process' },
- { text: 'RegExp', link: '/stdlib/regexp' },
- { text: 'Set', link: '/stdlib/set' },
- { text: 'sqlite', link: '/stdlib/sqlite' },
- { text: 'String Methods', link: '/stdlib/string' },
- { text: 'Syscalls', link: '/stdlib/syscalls' },
- { text: 'Test Runner', link: '/stdlib/test-runner' },
- { text: 'tty', link: '/stdlib/tty' },
- { text: 'Uint8Array', link: '/stdlib/uint8array' },
- ]
- },
- ]
- },
- ],
+ sidebar: {
+ '/': [
+ {
+ text: 'Getting Started',
+ items: [
+ { text: 'Installation', link: '/getting-started/installation' },
+ { text: 'Quickstart', link: '/getting-started/quickstart' },
+ { text: 'IDE Setup', link: '/getting-started/ide-setup' },
+ ]
+ },
+ {
+ text: 'Language',
+ items: [
+ { text: 'Features', link: '/language/features' },
+ { text: 'Debugging', link: '/getting-started/debugging' },
+ ]
+ },
+ {
+ text: 'CLI',
+ items: [
+ { text: 'Commands', link: '/getting-started/cli' },
+ ]
+ },
+ {
+ text: 'Standard Library',
+ link: '/stdlib/',
+ },
+ {
+ text: 'Advanced',
+ items: [
+ { text: 'FFI', link: '/language/ffi' },
+ { text: 'How It Works', link: '/language/architecture' },
+ { text: 'Type Mappings', link: '/language/type-mappings' },
+ ]
+ },
+ ],
+ '/stdlib/': [
+ {
+ text: 'Standard Library',
+ items: [
+ { text: 'Overview', link: '/stdlib/' },
+ { text: 'Array', link: '/stdlib/array' },
+ { text: 'Async', link: '/stdlib/async' },
+ { text: 'child_process', link: '/stdlib/child-process' },
+ { text: 'console', link: '/stdlib/console' },
+ { text: 'crypto', link: '/stdlib/crypto' },
+ { text: 'Date', link: '/stdlib/date' },
+ { text: 'embed', link: '/stdlib/embed' },
+ { text: 'encoding', link: '/stdlib/encoding' },
+ { text: 'fetch', link: '/stdlib/fetch' },
+ { text: 'fs', link: '/stdlib/fs' },
+ { text: 'HTTP Server', link: '/stdlib/http-server' },
+ { text: 'JSON', link: '/stdlib/json' },
+ { text: 'Map', link: '/stdlib/map' },
+ { text: 'Math', link: '/stdlib/math' },
+ { text: 'Number', link: '/stdlib/number' },
+ { text: 'Object', link: '/stdlib/object' },
+ { text: 'os', link: '/stdlib/os' },
+ { text: 'path', link: '/stdlib/path' },
+ { text: 'process', link: '/stdlib/process' },
+ { text: 'RegExp', link: '/stdlib/regexp' },
+ { text: 'Set', link: '/stdlib/set' },
+ { text: 'sqlite', link: '/stdlib/sqlite' },
+ { text: 'String', link: '/stdlib/string' },
+ { text: 'Syscalls', link: '/stdlib/syscalls' },
+ { text: 'Test Runner', link: '/stdlib/test-runner' },
+ { text: 'tty', link: '/stdlib/tty' },
+ { text: 'Uint8Array', link: '/stdlib/uint8array' },
+ { text: 'URL', link: '/stdlib/url' },
+ ]
+ },
+ ],
+ },
socialLinks: [
{ icon: 'github', link: 'https://github.com/cs01/ChadScript' }
diff --git a/docs/.vitepress/theme/HeroBenchmarks.vue b/docs/.vitepress/theme/HeroBenchmarks.vue
index 86be706b..52bc4890 100644
--- a/docs/.vitepress/theme/HeroBenchmarks.vue
+++ b/docs/.vitepress/theme/HeroBenchmarks.vue
@@ -36,10 +36,14 @@ const activeBench = computed(() => benchmarks.value[activeIndex.value])
const entries = computed(() => {
const b = activeBench.value
if (!b) return []
- const langOrder = ['c', 'chadscript', 'go', 'bun', 'node']
+ const langOrder = ['c', 'chadscript', 'go', 'bun', 'node', 'grep', 'ripgrep', 'xxd']
+ const known = new Set(langOrder)
const sorted = langOrder
.filter(k => k in b.results)
.map(k => ({ key: k, ...b.results[k] }))
+ for (const k of Object.keys(b.results)) {
+ if (!known.has(k)) sorted.push({ key: k, ...b.results[k] })
+ }
if (b.lower_is_better) {
sorted.sort((a, b2) => a.value - b2.value)
} else {
diff --git a/docs/.vitepress/theme/IRShowcase.vue b/docs/.vitepress/theme/IRShowcase.vue
index 2218a4f9..a201db3c 100644
--- a/docs/.vitepress/theme/IRShowcase.vue
+++ b/docs/.vitepress/theme/IRShowcase.vue
@@ -125,7 +125,7 @@ onUnmounted(() => {
No build step. No install. Just chad run yourfile.ts and it compiles + runs instantly.
diff --git a/docs/.vitepress/theme/PipelineAnimation.vue b/docs/.vitepress/theme/PipelineAnimation.vue
new file mode 100644
index 00000000..1e93b599
--- /dev/null
+++ b/docs/.vitepress/theme/PipelineAnimation.vue
@@ -0,0 +1,593 @@
+
+
+
+
+
+
+
+
+
+
+ {{ stepLabels[s] }}
+
+
+
+
+
+
{{ stepDesc }}
+
+
+
+
+
+
+
{{ line.text }}
+
+ {{ b.label }}
+
+
+
+
+
+
+
+
+
+
+ {{ b.label }}
+ {{ b.ir }}
+
+
+
+
+
+
+
+
+
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.
+
+
+
+
+
diff --git a/docs/.vitepress/theme/index.mts b/docs/.vitepress/theme/index.mts
index 97ae9926..ee26ec07 100644
--- a/docs/.vitepress/theme/index.mts
+++ b/docs/.vitepress/theme/index.mts
@@ -3,8 +3,7 @@ import DefaultTheme from 'vitepress/theme'
import CopyMarkdown from './CopyMarkdown.vue'
import HeroRotator from './HeroRotator.vue'
import ComparisonCards from './ComparisonCards.vue'
-import IRShowcase from './IRShowcase.vue'
-import ExampleTabs from './ExampleTabs.vue'
+import PipelineAnimation from './PipelineAnimation.vue'
import HeroBenchmarks from './HeroBenchmarks.vue'
import './style.css'
@@ -18,8 +17,7 @@ export default {
enhanceApp({ app }) {
app.component('HeroRotator', HeroRotator)
app.component('ComparisonCards', ComparisonCards)
- app.component('IRShowcase', IRShowcase)
- app.component('ExampleTabs', ExampleTabs)
+ app.component('PipelineAnimation', PipelineAnimation)
app.component('HeroBenchmarks', HeroBenchmarks)
}
}
diff --git a/docs/benchmarks.md b/docs/benchmarks.md
new file mode 100644
index 00000000..8a286a0e
--- /dev/null
+++ b/docs/benchmarks.md
@@ -0,0 +1,9 @@
+# Benchmarks
+
+ChadScript compiles to native ELF binaries via LLVM. No runtime, no JIT warmup, no cold start. [See details.](https://github.com/cs01/ChadScript/tree/main/benchmarks)
+
+
+
+---
+
+Reproduce: `./benchmarks/run.sh` — Linux x86-64, single run, all runtimes on same machine.
diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md
index 030d014e..35b2240c 100644
--- a/docs/getting-started/quickstart.md
+++ b/docs/getting-started/quickstart.md
@@ -1,5 +1,17 @@
# Quickstart
+## Running and Building
+
+Any ChadScript program can be run directly or compiled to a standalone binary:
+
+```bash
+chad run app.ts # compile and run in one step
+chad build app.ts # compile to .build/app
+chad build app.ts -o myapp # compile to a custom path
+```
+
+`chad run` compiles and executes immediately. `chad build` produces a native binary — by default in `.build/` mirroring the source path. Use `-o` to specify an output location.
+
## Hello World
```typescript
@@ -8,8 +20,6 @@ console.log("Hello from ChadScript!");
```bash
chad run hello.ts
-# or compile to a standalone binary:
-chad build hello.ts -o hello && ./hello
```
## More Examples
diff --git a/docs/index.md b/docs/index.md
index a6579a66..05f323db 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -2,170 +2,315 @@
layout: home
hero:
name: ChadScript
- text: TypeScript that compiles to native binaries.
- tagline: "Sub-millisecond startup. ~250KB binaries. No runtime. No dependencies."
+ text: "TypeScript, compiled to native code."
+ tagline: "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."
actions:
- theme: brand
text: Get Started
link: /getting-started/installation
- theme: alt
- text: What is ChadScript?
- link: /why-chadscript
+ text: Learn More
+ link: /language/features
features:
- title: Native Speed
- details: Compiles to optimized machine code. Same optimization passes used by C and Rust compilers.
+ details: Compiles to native CPU code via LLVM — the same compiler backend used by C, Rust, and Swift. No V8, no JIT warmup, no garbage collection pauses.
- title: TypeScript Syntax
- details: Classes, generics, interfaces, async/await, closures, JSX. If you write TypeScript, you already know ChadScript.
+ details: Write the TypeScript you already know — classes, generics, interfaces, async/await, closures, JSX. No new language to learn.
- title: Batteries Included
details: No package manager, no dependencies. HTTP server, SQLite, fetch, crypto, WebSocket, JSON — all built into the standard library. Write code, run it.
- title: Single-Binary Deploy
- details: One file, no dependencies. Copy it to a server, drop it in a Docker scratch image, run it anywhere.
+ details: The output is a standalone native binary — no runtime, no node_modules, no bundler. Copy it to a server, drop it in a Docker scratch image, run it anywhere.
---
-
-
-
-
-
+
+
+
+
+
self-hosting
compiles itself
+
-
+
-
+
+
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.
-## What's Included
+| Benchmark | ChadScript | Node.js | vs Node | C |
+|---|---|---|---|---|
+| Cold Start | **0.6ms** | 21.8ms | **36x** | 0.6ms |
+| Monte Carlo Pi | **0.398s** | 1.474s | **3.7x** | 0.400s |
+| File I/O | **0.089s** | 0.315s | **3.5x** | 0.088s |
+| JSON Parse | **0.005s** | 0.015s | **3.0x** | 0.004s |
+| Fibonacci | **1.424s** | 2.842s | **2.0x** | 0.725s |
+| N-Body Sim | **1.852s** | 2.296s | **1.2x** | 1.453s |
-No package manager, no `node_modules`. Everything compiles into your binary.
+
Full benchmarks →
+
-| Module | Key APIs |
-|--------|----------|
-| **console** | `log`, `error`, `warn` |
-| **fs** | `readFileSync`, `writeFileSync`, `existsSync`, `mkdirSync`, `readdirSync`, `statSync` |
-| **JSON** | `parse
`, `stringify` |
-| **fetch** | `fetch(url, { method, headers, body })` → Response with `.text()`, `.status`, `.headers` |
-| **HTTP server** | `Router`, `httpServe`, `Context`, WebSocket support |
-| **SQLite** | `open`, `exec`, `all`, `get`, `close` |
-| **crypto** | `sha256`, `md5`, `randomBytes`, `randomUUID` |
-| **child_process** | `execSync`, `spawnSync` |
-| **Map, Set** | Full `Map` and `Set` with typed keys/values |
-| **path** | `join`, `dirname`, `basename`, `resolve` |
-| **Math, Date** | Standard APIs |
-| **RegExp** | `test`, `match`, `replace` |
-| **process** | `argv`, `env`, `exit`, `cwd`, `stdin.read()` |
-| **os** | `platform`, `arch`, `hostname`, `homedir` |
-| **ArgumentParser** | CLI arg parsing (`import from chadscript/argparse`) |
-| **URL, URLSearchParams** | URL parsing and query string handling |
-| **btoa, atob** | Base64 and `encodeURIComponent` encoding utilities |
+
+
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
+
+
+
-Full standard library docs →
+
-## Language Support
+```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));
+```
-**Supported**
+
A complete HTTP server. chad build app.ts → 247KB binary, 0.8ms startup.
+
-- `let`/`const`, `if`/`else`, `for`/`while`/`switch`
-- `try`/`catch`/`finally`, `throw`
-- Arrow functions, `async`/`await`
-- Classes with inheritance and `implements`
-- Generics (`class Stack
`, `function identity`)
-- Interfaces and type aliases
-- Destructuring, spread, rest params
-- Template literals, closures, modules
-- JSX (desugared to `createElement` calls)
-- RegExp, `for...of`, `for...in`
-- `Map`, `Set`, `Uint8Array`
-- `Promise.all`, `.race`, `.allSettled`
-- Default and rest parameters
+
+
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.
-
-**Not Supported**
+
-- `any`, `unknown`, `never`
-- `eval`, `Proxy`, `Reflect`
-- Runtime `instanceof`
-- Dynamic `import()`
-- Generators, decorators
-- `WeakMap`, `WeakSet`, `Symbol`
-- Intersection / mapped / conditional types
-- Closures capture by value (not by reference)
-- Union types limited to nullable (`T | null`)
+```bash
+curl -fsSL https://raw.githubusercontent.com/cs01/ChadScript/main/install.sh | sh
+```
-
+
-
Full feature reference →
+
ChadScript compiles a subset of TypeScript — not a drop-in replacement. See what's supported →
-## What ChadScript Is Not
+
-ChadScript is a statically-typed subset of TypeScript designed for native compilation. It is not a JavaScript runtime. There is no `any`, no `eval`, no runtime type inspection, no dynamic imports. npm packages won't work unless rewritten in the ChadScript subset. If you need full Node.js compatibility, use Node, Bun, or Deno. ChadScript is for when you want a native binary.
+
diff --git a/docs/language/classes.md b/docs/language/classes.md
index 69ef85e8..9eb3224c 100644
--- a/docs/language/classes.md
+++ b/docs/language/classes.md
@@ -25,16 +25,3 @@ Classes and interfaces work like standard TypeScript with a few differences.
| Abstract classes | Not yet supported |
| Decorators | Not supported |
-## Field Ordering
-
-One ChadScript-specific detail: object literals are automatically reordered to match the declared field order. You can write fields in any order:
-
-```typescript
-type Person = {
- name: string;
- age: number;
- city: string;
-};
-
-const p: Person = { age: 30, city: "NYC", name: "Alice" }; // works fine
-```
diff --git a/docs/language/features.md b/docs/language/features.md
index 6de3ea84..9ebbf92c 100644
--- a/docs/language/features.md
+++ b/docs/language/features.md
@@ -1,16 +1,16 @@
# Language
-ChadScript is a statically-typed subset of TypeScript. You can write standard TypeScript constructs — variables, functions, classes, interfaces, async/await, modules — as long as all types can be resolved at compile time.
+ChadScript is a statically-typed subset of TypeScript that compiles to native code. You write standard TypeScript — variables, functions, classes, interfaces, async/await, modules — and the compiler handles the rest.
-What this means in practice:
-- No `any`, `unknown`, or mixed union types like `string | number`
-- No runtime type inspection (`instanceof`, runtime `typeof`)
-- No dynamic code execution (`eval`, dynamic `import()`)
-- Closures capture by value — mutating a variable after capturing it is a compile error
+**Can I parse JSON?** Yes. `JSON.parse()` and `JSON.stringify()` are built in — define an interface for your data shape, and the compiler handles the rest. See [`cjq`](https://github.com/cs01/ChadScript/blob/main/examples/cli-tools/cjq.ts) — a jq clone written in ChadScript.
-The [Standard Library](/stdlib/) covers common needs — HTTP, SQLite, fetch, crypto, JSON, filesystem — without external packages.
+**Can I query a database?** Yes. SQLite is built in — `sqlite.open()`, `sqlite.query()`, parameterized queries, transactions. See [`cql`](https://github.com/cs01/ChadScript/blob/main/examples/cli-tools/cql.ts) — run SQL on CSV files, compiled to a native binary.
-The tables below describe the full feature set and support status.
+**Can I build an HTTP server?** Yes. `Router`, `httpServe`, WebSocket — all built in. See it live at [chadsmith.dev/hn](https://chadsmith.dev/hn).
+
+The full [Standard Library](/stdlib/) covers HTTP, SQLite, fetch, crypto, JSON, filesystem, and more — no packages to install.
+
+The constraint is that all types must be resolved at compile time: no `any`, no `eval`, no runtime type inspection. Closures capture by value. The tables below describe the full feature set.
## Core Language
diff --git a/docs/why-chadscript.md b/docs/why-chadscript.md
deleted file mode 100644
index d6df49b4..00000000
--- a/docs/why-chadscript.md
+++ /dev/null
@@ -1,44 +0,0 @@
-# What is ChadScript?
-
-ChadScript compiles TypeScript to native binaries. Write TypeScript, run `chad build`, get a standalone executable — no Node.js, no runtime, no cold start.
-
-## Key characteristics
-
-- **TypeScript syntax** — classes, interfaces, generics, async/await, closures, destructuring, JSX. If you write TypeScript, you already know ChadScript.
-- **Native compilation** — compiles to optimized machine code with the same optimization passes used by C and Rust compilers. Sub-millisecond startup, ~250KB binaries.
-- **No dependencies** — install with `curl`, not `npm`. Everything is bundled in the compiler.
-- **Batteries included** — HTTP server, SQLite, fetch, crypto, WebSocket, JSON, filesystem — all built in. No packages to install.
-- **Single-binary deploy** — `chad build app.ts -o app` produces one self-contained file. Copy it to a server, drop it in a container, run it.
-- **Self-hosting** — the compiler is written in ChadScript and compiles itself.
-
-## No setup, no packages
-
-There is no package manager step. Write your code, run it:
-
-```bash
-chad run app.ts
-```
-
-Everything your program needs — HTTP, SQLite, crypto, WebSocket, JSON, filesystem — is part of the standard library and compiled directly into your binary. No separate install step, no version conflicts, no supply chain to audit.
-
-ChadScript supports importing from other `.ts` files and can resolve `node_modules`, but most npm packages rely on JavaScript features ChadScript doesn't support. In practice, your dependencies are the standard library and your own code — which means fully deterministic builds from day one with nothing to keep up to date.
-
-## What ChadScript is not
-
-ChadScript is a statically-typed subset of TypeScript designed for native compilation. It is not a JavaScript runtime. There is no `any`, no `eval`, no runtime type inspection, no dynamic imports. npm packages won't work unless rewritten in the ChadScript subset. If you need full Node.js compatibility, use Node, Bun, or Deno. ChadScript is for when you want a native binary.
-
-## See it in production
-
-[chadsmith.dev/hn](https://chadsmith.dev/hn) is a live Hacker News clone running as a ChadScript binary — SQLite database, HTTP server, and embedded HTML/CSS/JS assets, shipped as a single file.
-
-## Install
-
-```bash
-curl -fsSL https://raw.githubusercontent.com/cs01/ChadScript/main/install.sh | sh
-```
-
-## First steps
-
-- [Installation](/getting-started/installation)
-- [Quickstart](/getting-started/quickstart)
-- [Supported features](/language/features)