ClearScript eliminates coercion, hoisting, and prototype chaos. Type-safe by default. Blazing fast. One toolchain. Ten laws.
Every design decision deliberately eliminates a JavaScript footgun
Compiled and executed natively in Rust. The toolchain — parser, type-checker, compiler — ships as a single binary with zero deps.
Law #1 is absolute. 1 + "1" is a compile error. Every type relationship is explicit, predictable, and verifiable.
10× faster than tsc on large codebases. Incremental builds, parallel type checking, and a zero-overhead emit pipeline.
Law #6 replaces the prototype chain with composable traits. Polymorphism is explicit, readable, and refactorable.
Law #8 bans implicit globals. Every name is imported. Every dependency is auditable. Dead code is detected at compile time.
Law #9 mandates human-readable errors with file, line, column, probable cause, and a suggested fix — always.
Not guidelines. Not best practices. Enforced by the compiler.
Types never implicitly convert. Every value stays exactly what you declared.
varAll bindings use let (immutable) or mut. Function scope is abolished.
Names are not available before their declaration. Temporal dead zones are gone entirely.
Only === exists. == is a parse error.
There is one null-like value: nil. null and undefined do not exist.
Inheritance uses composable traits. The prototype chain is permanently removed.
selfself is always the enclosing object. No more .bind() or arrow-function hacks.
All globals are banned. Every name must be imported. Every dep is auditable.
Every error includes file, line, column, root cause, and a concrete suggestion.
parse → typecheck → compile → bundle → test — one binary, zero config files.
Same intent. Radically different guarantees.
// Silent type coercion — classic footgun var score = 10 + "5"; // → "105" 🤦 console.log(score); // "105" not 15 // undefined everywhere function getUser(id) { var result = fetchUser(id); return result; // could be undefined } // prototype confusion class Animal { speak() { return this.name; // what is 'this'? } } // hoisting surprise console.log(x); // undefined (not error) var x = 42; // null AND undefined if (val == null) { } // catches both!
// Law I: coercion is a compile error let score = 10 + "5"; // ✗ type mismatch let score = 10 + 5; // → 15 ✓ // Law V: single nil, always explicit fn getUser(id: Str) -> User | Nil { return fetchUser(id); // typed return } // Law VI: traits not prototypes trait Speakable { fn speak(self) -> Str; } // lexical self (Law VII) // Law III: no hoisting print(x); // ✗ name not in scope let x = 42; // Law V: one nil value if (val === nil) { } // explicit nil check ✓
Real ClearScript syntax running in your browser. Edit the code and press Run.
Where ClearScript outperforms JavaScript and TypeScript
A full compilation pipeline in one binary
From private build to open source in 2026
Ten Laws codified, grammar BNF complete, reference interpreter in Rust passing 800+ tests.
Recursive descent parser, Hindley-Milner inference, trait constraint resolution.
SSA IR, LLVM integration, WASM target with source maps. Performance benchmarks.
Core modules: io, http, fs, math, collections, concurrency primitives.
Full public release on GitHub. MIT license. Community RFC process begins.
Language Server Protocol, syntax highlighting, inline diagnostics, auto-complete.
Package manager, central registry, first-party adapters for Node and Deno ecosystems.
ClearScript is launching June 25, 2026. Star the repo, follow the journey, and be first to ship.