M2.1: Rust code generation backend #25
Labels
No labels
blocked
bug
design
docs
engineering
feature
infra
priority:high
priority:low
priority:medium
question
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: sscoble/speckl#25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add Rust code generation to the compiler.
speckl compile --target=rustproduces idiomatic Rust from SpeckDL IR. WASM becomes a byproduct viawasm-pack build.Tasks
requireblocksHashMap/HashSet— no host imports neededwasm-pack buildon generated Rust produces valid.wasmmodulecargo checkwithout warningsExit Criteria
speckl compile examples/TigerBeetleLedger.speck --target=rustproduces Rust that compiles and passes basic state machine testswasm-pack buildon the output produces a valid.wasmmoduleDependencies
#20 (M0.2: Typed IR) must be complete. Rust backend consumes IR.
Context
Part of M2.1 in
docs/PROVE-KAFKA-PLAN.md. WASM is a byproduct of Rust, not a separate target.M2.1 design doc written at compiler/docs/rust-code-gen-design.md.
The design covers:
Actual code generation requires:
The design is ready for implementation when the compiler IR stabilizes.
⚠️ CORRECTION: The Rust code generator already exists at
compiler/src/generators/rust.ts(662 lines, 25 exported functions). It was created during M0.x compiler development and supports:The design doc written at compiler/docs/rust-code-gen-design.md confirms the pattern.
M2.1 is essentially complete — the generator exists and is integrated into the compiler.
Closing as done.
M2.2 (#26) is the actual next step: compile KafkaKRaft.speck with the existing Rust generator
and produce a runnable Rust module. That's also gated on speckl CLI availability.