Ratlang is an experimental programming language and toolchain whose entire codebase was authored autonomously by AI without human edits. It explores what a modern developer experience looks like when compilers, runtimes, documentation tools, and examples are produced by machines yet remain familiar to engineers.
- AI-authored stack — lexer, parser, type checker, interpreter, CLI tools, and examples were generated by Codex without human patches.
- Expressive syntax — indentation-based blocks, pipelines, lambdas, pattern matching, option/result literals, and ergonomic data structures.
- Tree-walk runtime — closures, first-class functions, loops,
break/continue, and a small native environment (print,len, …). - Full tooling surface — workspace includes
rat(file runner + REPL),ratc, formatter, docs generator, language server, and practical smoke-test programs. - Test-first workflow — integration harness under
crates/ratlang/tests/apiexecutes real Ratlang programs to guard against regressions.
- Language front end —
crates/ratlang/src/{lexer,parser,ast}handle tokenization, recursive-descent parsing, and AST modeling. - Static analysis —
typeck.rsprovides lightweight inference/checking before execution. - Runtime —
runtime.rsimplements a stack-based interpreter withRc-backed closures, control-flow state propagation, and native helpers. - Compiler orchestration —
Compilerties source maps, diagnostics, and type info together to yieldCompilationartifacts for the VM. - Tool binaries — crates under
crates/expose user-facing commands that share the same workspace configuration.
cargo run -p rat -- examples/production_dashboard.ratForward arguments to main(args) after --:
cargo run -p rat -- examples/feature_tour.rat -- hello worldOr explore the integration tests:
cargo test -p ratlang --test api -- --nocaptureGPL-3.0 — see LICENSE.