✦ AI-native · v1.2.0

A programming language
built for AI.

Synth transpiles to JavaScript with unambiguous grammar, intent-first declarations, constraint-enforced types, and explicit effect tracking. Designed to be written and reasoned about by language models.

Get Started Live Demo GitHub
Install npm install -g synth-lang
0→JS
Minimal stdlib
Flat
Records + functions
v3=v2
Fixed-point bootstrap
@intent
Machine-readable
Why Synth

Built different, on purpose.

🎯
Intent is a first-class declaration
@intent is not a comment — it's a first-class source annotation that describes what a function is for. Downstream tools (and future synth spec) can query intent without reading the full body.
🔒
Constraints at the type level
Types carry where predicates. The compiler can emit __validate_* helpers for constrained parameters — validation lives at the type definition, not scattered through call sites.
Explicit effects
@pure, @exhaustive, and @throws are checker-enforced. @effects is required on async fn. A @pure function that touches console gets a warning.
🌿
No classes, no this
OOP exists to manage human working memory. AI doesn't have that problem. Synth is records + functions — flat and scannable. Mutation is explicit via let mut, compound ops, and store.
Opt-in exhaustiveness
Tagged union matches are flexible by default. Add @exhaustive on a function to require every variant be handled — the checker warns on missing cases.
🧪
Tests live next to code
@test "description" { expr } registers inline assertions. Run them with synth --test file.syn. No test framework, no config, no boilerplate.
📦
Multi-file modules, single output
import { fn } from "./module" and export fn split projects across files. synth --bundle resolves imports, topo-sorts modules, and emits one clean JS file. Zero runtime overhead.
Self-Hosted

The compiler is written in Synth.

The full toolchain — lexer, parser, type checker, code generator, and formatter — lives in compiler/*.syn and compiles itself. Pure Synth end to end. Synth compiling Synth.

Synth v1.2.0 ships a bootstrap compiler: eight modules written entirely in the language they implement. A seed bundle compiles those sources into JavaScript, and that output recompiles them again — byte-for-byte identical, three generations deep. That's the fixed point.

  • 8 modules — token, lexer, ast, parser, checker, codegen, formatter, driver
  • Pure Synth — eight compiler/*.syn modules written in Synth; the Node CLI driver is a thin JavaScript wrapper around the bootstrap bundle
  • Fixed-point proof — v1 → v2 → v3 bootstrap chain is byte-identical; further self-compilation changes nothing
  • Runs in the browser — the playground loads the same bootstrap bundle client-side via SynthCompiler.compile()
Open the bootstrap playground →
Bootstrap chain
1 bootstrap/seed.js — committed compiler seed
2 compile compiler/*.syn → dist/compiler.bootstrap.js
3 recompile with v2 — double bootstrap
v2 === v3 — fixed point reached
compiler/*.syn
token.syn lexer.syn ast.syn parser.syn checker.syn codegen.syn formatter.syn driver.syn
Demos

See it in action.

🎮
Neon Breakout
Synthwave brick-breaker — paddle, physics, particles, levels. Game logic written entirely in Synth: store, @memo, match, while loops.
game store · @memo · match · while
🧬
Neon Life New
Conway's Game of Life — draw cells, watch them evolve. Conway's rules expressed as a Synth match expression. Glider, pulsar, and glider gun presets.
simulation match · flat_map · store
👾
Synth Invaders New
Classic space invaders with a synthwave twist — marching alien grid, player bullets, waves. Alien colors and points via match expressions.
game store · @memo · match · find_index
🚗
Neon Drift New
Top-down neon road racer — dodge oncoming traffic across three lanes. Speed increases over time. Car types via match, lane positions via @memo.
game store · @memo · match
🛸
Expedition Hub
Space fleet mission tracker — typed record missions, spread, object shorthand, stdlib method syntax, do notation, and v1.0 template literals.
v1.0 record · templates · method syntax · do notation
🧭
Intent Router New
Route free-form messages by meaning. Exact arms first, then soft likely classifiers backed by the host embedding API.
v1.1 likely · embed API · match
🎮
Neon Kanban
Synthwave game-dev task board. Typed record cards and columns, v1.0 template literals, add/move/remove cards, live progress bar.
v1.0 record · templates · store · @memo
📊
Synth Dashboard New
Live sprint tracker with enum status/priority, numeric separators, multi-line lambdas, and reactive tick simulation.
v1.0.2 enum · numeric literals · multi-line lambdas
Synth Playground
Live in-browser IDE — type Synth, see transpiled JS and live output instantly. 16 preloaded examples covering all language features.
v1.0.2 browser compiler · live eval · bootstrap bundle
📜
Chronicle
Reactive fantasy kingdom log. store holds state, async fn advances the simulation, on...change re-renders reactively.
v0.8 store · async fn · await · on...change
🏪
The Bazaar
RPG item shop with generics, interfaces, and let infer. Filter, sort, and cart — all typed.
v0.7 generics · interfaces · let infer
🗺️
Dungeon Toolkit
Multi-file module demo. 4 .syn files bundled with synth --bundle. Procedural map generation.
v0.5 import · export · bundler
🌫️
Mistwood New
A quiet road through fog and fang — Theron, Aria, and Lyra face mistwood foes and the Shadow Wyrm. Sprite sheets, Guard cover, menus, and particle strikes. Game logic in Synth.
game store · match · sprites · sequel to RPG Adventure
⚔️
RPG Adventure
50-battle dungeon crawl. Party management, equipment, 5 chapters, 4 tiers of gear.
1580+ lines Synth · fully self-contained
🗡️
Combat Engine
Turn-based combat system showcasing match expressions, @memo, and param validation.
All v0.1–v0.3 features
🎛️
Music Library
Synthwave track browser with filtering and dynamic UI — built entirely in Synth.
Pipelines · .field shorthand · @memo
🕹️
Web Controls
Interactive UI components demonstrating string interpolation and constrained types.
v0.3 feature showcase
Roadmap

Path to v2.0

v1.2 shipped synth --spec. Next: explain blocks, then grow the IDE and debug loop through v2.0.

v1.2 ─────────────→ v2.0 tooling loop
16 milestones shipped · v0.1 through v1.2.0
Foundation Guards Modules Safety Generics Async Tooling Ergonomics Compound Ops Stdlib While Loops Ergonomics II Templates Self-Hosted v1.0 Stable likely arms synth spec
★ Now
v1.3
Explain & Query
explain blocks join the spec export — structured prose agents already query via synth --spec.
explain blocks spec + docs JSDoc intent
Next
v1.4–1.5
Language Server
Thin LSP first (diagnostics, hover, same-file go-to-def), then cross-file refs and completions.
LSP hover cross-file extension
🎯 Goal
v2.0
AI-Native Ecosystem
Full tooling loop — rich LSP, source maps, and a frozen agent protocol. Path: 1.6 maps → 1.7 polish → 2.0.
source maps rich IDE spec schema 1.0