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.
npm install -g synth-lang
@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.where predicates. The compiler can emit __validate_* helpers for constrained parameters — validation lives at the type definition, not scattered through call sites.@pure, @exhaustive, and @throws are checker-enforced. @effects is required on async fn. A @pure function that touches console gets a warning.let mut, compound ops, and store.@exhaustive on a function to require every variant be handled — the checker warns on missing cases.@test "description" { expr } registers inline assertions. Run them with synth --test file.syn. No test framework, no config, no boilerplate.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.
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.
compiler/*.syn modules written in Synth; the Node CLI driver is a thin JavaScript wrapper around the bootstrap bundle
SynthCompiler.compile()
record missions, spread, object shorthand, stdlib method syntax, do notation, and v1.0 template literals.likely classifiers backed by the host embedding API.record cards and columns, v1.0 template literals, add/move/remove cards, live progress bar.enum status/priority, numeric separators, multi-line lambdas, and reactive tick simulation.store holds state, async fn advances the simulation, on...change re-renders reactively.let infer. Filter, sort, and cart — all typed.synth --bundle. Procedural map generation.v1.2 shipped synth --spec. Next: explain blocks, then grow the IDE and debug loop through v2.0.
explain blocks join the spec export — structured prose agents already query via synth --spec.