AI-native SDLC · Build stage · roadmap.md

DSL-Generator build roadmap

Progress through roadmap.md's session plan for DSL-Generator's hand-built calculator-language toolchain (Part A), its generalization into the dslgen meta-tool (Part B), and advanced polish (Part C).

14/39
Required-path sessions complete — 36%
Next up: A14 — generated LSP

Part A — Hand-built calc-lang

One DSL toolchain built entirely by hand, no generation.

Sessions14 / 19

Part B — Generalize into dslgen

Extract Part A's code into the generic meta-tool.

Sessions0 / 12

Part C — Advanced & polish

Retargeting, dynamic linking, cross-compilation, memory, tests, docs.

Sessions0 / 8
Part A — Hand-build calc-lang ▸
A0Workspace setup. Cargo workspace scaffold; ParserFrontend trait decision (LALRPOP first). ↗ docsDone A1ParserFrontend trait. LalrpopFrontend parses arithmetic, variables, if/else. ↗ docsDone
A1-pestAlt frontend: pest. Optional side branch proving the trait boundary.Optional
A1-customAlt frontend: hand-written. Optional recursive-descent parser, no grammar file.Optional
A2Typed AST. Real Expr/Stmt types replace raw parser output. ↗ docsDone A3Scopes & bindings. Block-scoped let, symbol table, name resolution. ↗ docsDone A4Mid-level IR. Flatter IR types plus ast_to_ir::lower(). ↗ docsDone A5Tree-walking interpreter. calcc run --interpret works end to end. ↗ docsDone A6Cranelift backend. calcc build --backend=cranelift emits an object file. ↗ docsDone A7LLVM backend. Equivalent output via inkwell, compared against Cranelift. ↗ docsDone A8Backend trait. Feature-gated backend selection, one trait for both. ↗ docsDone A9Built-ins: native Rust. + and * lower to add/mul calls into calc-runtime, through both backends. ↗ docsDone A10Built-ins: C-ABI FFI. One FFI built-in linked into a tiny C library. ↗ docsDone A11Built-ins: subprocess/IPC. A print built-in backed by a Python script, plus a top-level Program rule for brace-free statements. ↗ docsDone A12Link driver. Link units with rustc-derived and manifest-declared deps, a pre-link symbol check, and IPC bundles embedded in the executable. ↗ docsDone A13calcc CLI. clap-based build/run --interpret/check, --backend threaded through, plus --verbose and --keep-object for build. ↗ docsDone
A14Generated LSP. calc-lsp: diagnostics, semantic tokens, hover/definition.Next
A15tree-sitter grammar. Hand-built tree-sitter-calc package for editors and tools, with a conformance test against the compiler's parser.Upcoming
A16Cranelift-JIT hot reload. calcc run --hot-reload patches on save.Upcoming
A17Manual memory strategy. alloc/free declared as built-ins.Upcoming
A18Scope primitives as built-ins. Optional refactor of A3's resolver.Optional
A19Program test suite generator. Hand-built calc-testgen: scope-aware generated .calc programs, mutants with expected diagnostics, shrinking, optional fuzzing.Upcoming
Part B — Generalize into dslgen ▸
B1Audit. Map every Part A file to generic vs. per-DSL.Upcoming
B2Extract dslgen-backend. Backend trait, interpreter, link driver, IPC shim as a shared crate.Upcoming
B3Extract dslgen-lsp. tower-lsp scaffolding parameterized by a LanguageModel trait.Upcoming
B4RoleModel. Role-annotation parsing and validation.Upcoming
B4-tsGenerate tree-sitter package. Queries generated from the RoleModel; tree-sitter generate and conformance test wired in.Upcoming
B5Generic lowering. A4's pass rewritten to consume role annotations.Upcoming
B6bindings.toml. Manifest parsing/validation for built-ins.Upcoming
B6-testsGenerate the program test suite. Generic dslgen-testgen engine driven by grammar.json, the RoleModel, and built-in signatures.Upcoming
B7The code generator. Templates a workspace from grammar + roles + bindings.Upcoming
B8dslgen CLI. new / check / build against a scaffolded project.Upcoming
B9Second DSL. Proves generation generalizes beyond calc-lang.Upcoming
B10Frontend boundary via generator. DSL × frontend regression matrix.Upcoming
Part C — Advanced features & polish ▸
C1Retargetable built-ins. Multi-target manifests, most-specific-match selection.Upcoming
C1-wasmwasm32 target. Optional LLVM-to-wasm build via wasm-ld, gated on §14.19.Optional
C2External overrides. calcc.toml / --builtin-path precedence chain.Upcoming
C3Second memory strategy. Borrow-checked or GC, selectable per DSL.Upcoming
C4Differential testing. Interpreter as oracle against both backends, over calc-testgen's generated corpus.Upcoming
C5Docs consolidation. Order and cross-link the calc-lang/docs series.Upcoming
C6Decision log. Record how each of §14's open questions was resolved.Upcoming
C7Dynamic FFI linking. link = "dynamic" FFI built-ins, swappable without re-linking.Upcoming
C8Cross-compilation. calcc build --target=<triple> for non-host native targets, both backends.Upcoming