🚀 Open Source · June 25 2026 · Built in Rust
NEW v0.1.5 String interpolation · O(n) unique() · Dead code purge · Zero warnings

JavaScript.
Rebuilt in Rust.

Code without footguns. Ship without fear.

ClearScript eliminates the unsafety that haunts JavaScript. No automatic coercion. No hoisting chaos. No prototype pitfalls. Just a type-safe language compiled to blazing-fast WebAssembly with ten enforced laws protecting your code from entire classes of runtime bugs.

Read the 10 Laws
Scroll to explore
10× Faster Compile
Zero Coercion
Rust Core
Bidirectional Type Checker
60+ Stdlib Built-ins
10 Laws Enforced
npm install clearscript
REPL · test · fmt
Module Resolver
WASM Target
Open Source June 2026
10× Faster Compile
Zero Coercion
Rust Core
Bidirectional Type Checker
60+ Stdlib Built-ins
10 Laws Enforced
npm install clearscript
REPL · test · fmt
Module Resolver
WASM Target
Open Source June 2026
0
× Faster Compile
0
Coercions
0
Laws Enforced
0
Stdlib Built-ins

Core Features

Every decision deliberately kills a JavaScript footgun.

Built from first principles to eliminate entire categories of JavaScript runtime bugs — not by adding types on top, but by redesigning the language from the ground up in Rust.

🦀

Rust-Powered Core

Compiled to native binaries and WebAssembly with zero garbage collection overhead. Performance that rivals C++, with the safety guarantees you can't get elsewhere.

🔒

Zero Coercion

Type system prevents automatic conversions. 5 + "3" is a compile error, not 53. Explicit is better than implicit, always. Law I enforced at compile time.

10× Faster Compile

Incremental compilation with smart caching. Catch bugs instantly. IDE feedback in milliseconds. Full type checking without the 30-second TypeScript tax.

🎯

Traits Not Prototypes

Composition over prototype chains. No more mysterious __proto__ bugs. Traits as first-class constructs give you explicit contracts and fearless refactoring.

📦

Explicit Imports

No global namespace pollution. No mystery globals. Every symbol must be imported. Law VIII makes dependency chains auditable and refactoring safe.

🩺

Strong Diagnostics

Compiler errors tell you what went wrong and why. Suggested fixes. Clear error messages that teach you the language, not frustrate you. Law IX as a feature.

The 10 Laws

Not guidelines. Not best practices. Laws.

Compiler-enforced invariants that eliminate entire classes of runtime bugs. Each law is a guarantee — break one and the code does not compile. No exceptions, no escape hatches, no "trust me, this is fine."

I
Enforced
Type Safety

Zero Coercion

Types never silently convert. Mixed operations refuse to compile. Every conversion is explicit, audited, and intentional.

JS5 + "3" === "53"
CS5 + "3" → compile error
II
Enforced
Scoping

No var, No Surprises

Only let (immutable) and mut (mutable). Block-scoped. Function scope is dead. Variables behave exactly where you write them.

JSvar x leaks across blocks
CSlet x — block scope only
III
Enforced
Execution Order

Top-Down Always

Code runs in the order you wrote it. No hoisting, no temporal dead zones, no surprise undefined. What you read is what executes.

JSfoo() before fn declaration
CSuse after declare — strict
IV
Enforced
Equality

Strict by Default

One operator: == (strict). Loose equality is gone. 0 never equals false. "" never equals 0. Comparison means what it says.

JS0 == false === true 🤯
CS0 == false → type error
V
Enforced
Null Safety

One Nil. Zero NaN.

One null-like value: nil. No undefined, no NaN contamination. Nil must be handled — the compiler refuses to forget.

JSnull vs undefined vs NaN
CSmatch val { nil => …, x => … }
VI
Enforced
Polymorphism

Traits, Not Prototypes

Behavior comes from traits — explicit, composable, type-checked. No __proto__ mutation. No prototype-pollution CVEs. Ever.

JSobj.__proto__ = anything
CSimpl Trait for Type { … }
VII
Enforced
Closures

Lexical Self, Always

No this rebinding. No .bind, no .call, no surprise context loss on callback. Refactoring never silently breaks behavior.

JSthis depends on caller 🎲
CSself captured at definition
VIII
Enforced
Modules

Explicit Imports Only

Zero globals. Every symbol comes from an import statement. Dependency graphs are static, auditable, tree-shakable to the byte.

JSwindow.* — global soup
CSimport { x } from "mod"
IX
Enforced
Diagnostics

Errors That Teach

Every error includes a span, a cause, a fix suggestion, and a link. The compiler is a teacher — not an adversary, not a riddle.

JS"undefined is not a function"
CSE0021 + did you mean…?
X
Enforced
Toolchain

One Binary. Zero Sprawl.

Compiler, formatter, linter, package manager, REPL, LSP — one Rust binary. No node_modules. No config wars. Install once, ship forever.

JSnpm + tsc + eslint + babel + …
CSclear run / fmt / check

JavaScript vs ClearScript

Same intent. Radically different guarantees.

The code you want to write — without the runtime surprises. Every example below shows a real JavaScript footgun and how ClearScript's 10 Laws eliminate it at compile time.

Example 1: Type Safety

❌ JavaScript
function add(a, b) { return a + b; } add(5, "3"); // "53" (coerced!) add(5, null); // 5 (bugs)
✓ ClearScript
fn add(a: num, b: num) -> num { a + b } add(5, "3"); // COMPILE ERROR add(5, nil); // COMPILE ERROR add(5, 3); // 8 ✓

Example 2: No Hoisting

❌ JavaScript
console.log(x); // undefined var x = 5; function test() { console.log(y); // undefined var y = 10; }
✓ ClearScript
print(x); // COMPILE ERROR let x = 5; fn test() { print(y); // COMPILE ERROR let y = 10; }

Example 3: Explicit Imports

❌ JavaScript
import { utils } from './lib'; import * as helpers from './h'; // Did I use everything? // No dead code elimination // Global namespace polluted
✓ ClearScript
import { add, mul } from 'math'; import { parse } from 'json'; // Perfect tree-shaking // No unused imports compile // Auditable dependencies

Example 4: Nil Safety

❌ JavaScript
let user = getUser(); console.log(user.name); // Runtime error! // Optional chaining (workaround) console.log(user?.name ?? 'Unknown');
✓ ClearScript
let user = getUser(); // type: User | nil // print(user.name); // COMPILE ERROR match user { User(name) => print(name), nil => print("Unknown") }

Example 5: Pipe Operator

❌ JavaScript
const result = process( transform( filter( data, x => x > 5 ), x => x * 2 ) );
✓ ClearScript
let result = data |> filter(fn(x) => x > 5) |> map(fn(x) => x * 2) |> process(); // Left-to-right, readable

Try the Playground

Write it. Run it. Feel the difference.

20 live examples — real ClearScript syntax running in your browser. Edit any line, hit Run or press Cmd+Enter, and see the output instantly. No install. No npm. No setup.

Editor
Output will appear here...

50 Real-World Use Cases

Everywhere JS runs, ClearScript runs safer.

From browser UIs to banking backends, from CLI tools to embedded runtimes. Every domain benefits from ClearScript's type safety, explicit semantics, and zero-coercion runtime.

Compiler Architecture

One binary. Full pipeline. Zero config.

From source file to WASM binary, the entire pipeline — parse, typecheck, optimise, emit — runs inside a single Rust binary. Law X is not a tagline; it is the architecture.

📝

Source

ClearScript source code files

🔍

Parser

Lexical + syntax analysis with strong error recovery

Type Checker

Bidirectional type inference with constraint solving

⚙️

IR + Optimizer

Intermediate representation with aggressive optimizations

🔧

Emitter

WebAssembly and native binary code generation

Runtime

Minimal runtime, GC-free execution

Changelog

Shipping in public. Updated after every build.

The latest changes to the compiler, runtime, stdlib, embeddings, and website.

v0.1.5 April 24, 2026 Patch

String interpolation, O(n) dedup, and code quality

  • FEAT String interpolation"Hello, ${name}!" and "Result: ${a * b + 1}" now work. Full expression support inside ${...}: arithmetic, calls, method chains, nested builtins. Depth-tracking brace scanner handles balanced braces inside the hole.
  • PERF unique() O(n) instead of O(n²) — replaced Vec::contains scan with a HashSet<String> key tracker. Insertion-order preserved. Both the free-function and method-dispatch forms fixed.
  • FIX reduce docs corrected — signature is reduce(list, fn, init); docs previously showed the arguments in the wrong order.
  • FIX Dead code purged in closures.rs — the old stub builtins::map/filter/reduce functions (which were never called and didn't work) are removed. The module now correctly documents that closures live in Value::Function.
  • FIX Zero clippy warnings — removed unused SourceMap import in clear-diagnostics and unused diagnostic imports in clear-lexer.
  • FEAT Parser::parse_single_expr — new public API for parsing a single expression from a source string; used by the interpolation runtime and available to embedders.
  • UI npm package bumped to v0.1.5.
v0.1.4 April 21, 2026 Minor

Tooling: REPL, clear test, clear fmt

  • FEAT Real REPL — rustyline-backed editor. Persistent history (~/.clearscript_history), multiline accumulation (continues at ... while braces / parens / brackets are unbalanced; ignores delimiters inside strings, escapes, and line comments), tab completion against all built-ins, meta-commands :help / :clear / :reset / :quit, Ctrl-D to exit.
  • FEAT clear test <file> — auto-discovers top-level fn test_*() functions, runs each, prints PASS / FAIL <name> -- <error>, summarises with N passed, M failed. Exits non-zero on any failure — drop it straight into CI.
  • FEAT clear fmt <file> [--write] — opinionated formatter. Pretty-prints functions, let bindings, calls, binary / unary, if / else, blocks, literals. Falls back to original source for unsupported nodes (no destructive rewrites). --write overwrites in place.
  • FEAT New example examples/test_demo.clear demonstrating the test discovery convention.
  • UI Docs page expanded — new stdlib reference tables for JSON / Filesystem / Env & Time / Map ops; updated diagnostic-codes table (E0013, E0023, E0024, E0025, E0026); refreshed limitations section reflecting v0.1.3+v0.1.4 wins.
  • UI npm package bumped to v0.1.4.
v0.1.3 April 21, 2026 Major

Static type checker, modules, and stdlib expansion

  • FEAT Static type checker — new clear-types crate. Bidirectional checker covers literals, let bindings, identifiers, binary/unary ops, if/else unification, function calls (arity + types), function definitions. clear-cli check exits non-zero on type errors; clear-cli run warns and continues. 17+ built-ins pre-registered with signatures.
  • FEAT Module systemimport { greet } from "./helpers.clear" now actually resolves. Relative paths, recursive imports, diamond dedup, cycle detection with helpful chain (a.clear -> b.clear -> a.clear), missing-module errors with resolved absolute path.
  • FEAT JSON stdlibjson_parse and json_stringify with full Value↔serde_json round-trip.
  • FEAT Filesystem stdlibfs_read, fs_write, fs_exists (native; clear error in WASM).
  • FEAT Env + Timeenv_get, env_args, time_now.
  • FEAT Math additionssin, cos, tan, log, log2, log10, exp.
  • FEAT Map opskeys, values (deterministic sorted output), has_key.
  • FEAT "Did you mean?" suggestions — Levenshtein-distance lookup over in-scope names + builtins. pritn("hi")Undefined: 'pritn'. Did you mean 'print'?
  • FEAT Braced import syntax — parser now accepts import { a, b, c } from "..." in addition to the bare form.
  • PERF Two-pass declaration registration in the type checker — call order no longer matters.
  • UI npm package bumped to v0.1.3 and the website auto-updates the changelog after every build.
v0.1.2 April 21, 2026 Major

Node.js embedding + 50+ stdlib built-ins

  • FEAT Node.js embedding — new clearscript npm package. require('./hello.clear') via the register hook, clear-node CLI runner, REPL, ESM + CJS + TypeScript types. Zero native compilation — single WASM bundle works on every OS.
  • FEAT 40+ built-in functions: print, sum, map, filter, reduce, upper, lower, split, join, sort, unique, range, zip, enumerate, sqrt, pow, clamp, type_of, assert + many more.
  • FEAT Method dispatchstr.upper(), arr.map(fn), arr.push(v) all work as methods.
  • FEAT Lambdas evaluate — first-class functions with closure capture. filter(nums, |n| n > 2) works.
  • FEAT for-in over Map / String / Int — iterate strings as chars, ints as ranges, maps as [key, value] pairs.
  • FIX Critical parser bugtokens.reverse() in Parser::new() caused EOF to be the first token, so all programs parsed as empty. Programs now actually run.
  • FIX Multi-arg print — was emitting only the first arg. Now space-joins all arguments.
  • FIX Output capture — CLI and WASM now print runtime output (was being discarded).
  • PERF Short-circuit && / ||, Int↔Float coercion, lexicographic string comparison.
  • UI Top-nav redesigned with mega-menu dropdowns (Product / Learn), gradient logo mark, scrollspy active highlight, GitHub icon, mobile slide-out drawer with animated hamburger.
  • UI The 10 Laws section overhauled — gradient roman numerals, ENFORCED status badges, category tags, JS-vs-CS proof rows on every card.
  • UI Playground: 10 new examples, share via URL hash, copy button, exec-time display, styled output lines.
v0.1.1 April 2026 Foundation

Compiler frontend complete

  • FEAT Lexer with all 45+ tokens, number literal radixes, template strings, escape sequences.
  • FEAT Pratt-style recursive descent parser with full operator precedence table.
  • FEAT Tree-walking interpreter with lexical scoping and closure capture.
  • FEAT Diagnostic system with 17 error codes, source spans, and pretty-printed labels.
  • FEAT WASM build pipeline — browser playground runs the real Rust interpreter.
v0.1.0 March 2026 Initial

Workspace bootstrap

  • FEAT 8-crate Rust workspace with clean phase separation (span / diagnostics / ast / lexer / parser / interpreter / wasm / cli).
  • FEAT Language spec, EBNF grammar, 500-feature domain model.
  • FEAT Dual MIT / Apache-2.0 licensing.
  • FEAT Zero unsafe code, <5kLOC, all-Rust toolchain.

Full history at docs.html · See what's next →

Roadmap

From private build to open source — June 25, 2026.

We ship in public. Every milestone below is complete or in active development. Star the repo to be notified the moment it goes live.

Core Language Spec

Complete formal specification of all ten laws and type system. Shipped.

Lexer · Parser · AST

All 45+ tokens, every expression / statement / declaration node. Shipped in v0.1.1.

Tree-walking Interpreter + 60+ Stdlib

Closures, lambdas, method dispatch, for-in, JSON / fs / env / time / math / map ops. Shipped in v0.1.2 — v0.1.3.

Static Type Checker + Module System

Bidirectional inference, two-pass declaration registration, import { x } from "./y" with cycle detection. Shipped in v0.1.3.

Tooling: REPL · clear test · clear fmt

Rustyline REPL with multiline + history + completion, CI-ready test runner, opinionated formatter. Shipped in v0.1.4.

WASM Runtime · Browser Playground · Node.js Embedding

One Rust core, two targets: in-browser playground + npm install clearscript. Shipped in v0.1.2.

Bytecode VM + Optimizer

Compile AST → bytecode, register-based VM, constant folding, dead-code elimination. Targets 5–10× interpreter speedup.

v0.2 · Q2 2026

1

Trait System + String Interpolation

Method dispatch via traits; ${expr} template expansion in the lexer.

v0.3 · Q2 2026

2

Open Source Launch

Public release on GitHub under MIT / Apache-2.0.

June 25, 2026

3

LSP + VS Code Extension

Real-time diagnostics, hover types, go-to-def, formatter on save.

Q3 2026

4

Async Runtime + Package Registry

First-class async/await with cooperative scheduling; official registry for community libraries.

Q4 2026

FAQ

Everything you want to know before you switch.

Got a question not listed here? Open an issue on GitHub and we will answer it — and add it to this list.

Is ClearScript a strict superset of JavaScript?

+

No. ClearScript is a complete reimagining of JavaScript semantics. We intentionally broke compatibility with unsafe patterns. Code that compiles to ClearScript often looks similar to JavaScript on the surface, but the ten laws eliminate entire classes of bugs. This is by design — we want a language that's safe, not one that tolerates the mistakes JavaScript does.

Can I use my existing JavaScript libraries?

+

Not directly. However, you can write bindings to JavaScript libraries via WebAssembly interfaces. ClearScript can call out to JavaScript where necessary, but the goal is to eliminate the need — our standard library and ecosystem will provide typed alternatives to common JavaScript patterns.

How does ClearScript compare to TypeScript?

+

TypeScript bolts types onto JavaScript but still compiles to JavaScript. ClearScript enforces the ten laws at compile time and compiles to WebAssembly, eliminating runtime coercion, hoisting, and prototype chaos entirely. TypeScript is a type system layered on top of an unsafe language. ClearScript is a safe language from the ground up.

What platforms does ClearScript compile to?

+

ClearScript compiles to WebAssembly (WASM) for browsers and server-side environments, and to native binaries (x86-64, ARM64) for systems programming. You get the flexibility of multiple targets with the safety of a single language.

When will ClearScript be open source?

+

June 25, 2026. The compiler, standard library, and toolchain will be released under the MIT license on GitHub. We're aiming for a production-ready release with full documentation, IDE support (VS Code extension), and a growing ecosystem of libraries.

Who is HyperBridge Digital?

+

HyperBridge Digital is the company building ClearScript. Founded by KR, an architect with 15+ years of experience in distributed systems, HyperBridge has created HBForge — an 80,000-line framework with zero npm dependencies — which powers production systems and this website. ClearScript is the next evolution of that vision.

What about performance benchmarks?

+

Preliminary benchmarks show 5-15× faster compile times than TypeScript, and 2-10× faster execution than JavaScript (depending on the workload). Rust-based code generation and WebAssembly compilation mean no garbage collection pauses and deterministic performance. Full benchmarks will be released at open source launch.

Is there a community? How do I contribute?

+

The community is forming now. At open source launch, we'll have contribution guidelines, a RFC process, and community channels (Discord, GitHub Discussions). We welcome compiler hackers, library authors, documentation writers, and educators. Start by reading the spec and exploring the compiler on GitHub.

Does HyperBridge offer enterprise support?

+

Yes. For organizations adopting ClearScript at scale, HyperBridge offers consulting, training, custom tooling, and priority support. Email [email protected] for enterprise inquiries.

What's the long-term vision?

+

ClearScript is the foundation for a new ecosystem where type safety, explicit semantics, and compiler-enforced laws are standard. We're building tools, libraries, and educational resources to make it easy for developers to write correct code. The vision is a world where "it compiles" means "it works."

🚀 Get Started

Ready to rebuild your stack?

Your next project deserves better than JavaScript.

ClearScript launches June 25, 2026 — MIT licensed, fully open source. Try the playground now, star the repo, and be first to ship.

Read the Spec →