Skip to content

Ratlang is an experimental programming language and toolchain whose entire codebase was authored autonomously by AI without human edits.

License

Notifications You must be signed in to change notification settings

AstraRails/ratlang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ratlang

中文

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.

Highlights

  • 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/api executes real Ratlang programs to guard against regressions.

Implementation Overview

  • Language front endcrates/ratlang/src/{lexer,parser,ast} handle tokenization, recursive-descent parsing, and AST modeling.
  • Static analysistypeck.rs provides lightweight inference/checking before execution.
  • Runtimeruntime.rs implements a stack-based interpreter with Rc-backed closures, control-flow state propagation, and native helpers.
  • Compiler orchestrationCompiler ties source maps, diagnostics, and type info together to yield Compilation artifacts for the VM.
  • Tool binaries — crates under crates/ expose user-facing commands that share the same workspace configuration.

Running Ratlang Programs

cargo run -p rat -- examples/production_dashboard.rat

Forward arguments to main(args) after --:

cargo run -p rat -- examples/feature_tour.rat -- hello world

Or explore the integration tests:

cargo test -p ratlang --test api -- --nocapture

License

GPL-3.0 — see LICENSE.

About

Ratlang is an experimental programming language and toolchain whose entire codebase was authored autonomously by AI without human edits.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages