feat(rust): Rust codegen backend (speckl#24)
Some checks failed
Deploy Landing Page to Storj / deploy (push) Failing after 2s

- New generator: compiler/src/generators/rust.ts (652 lines)
- --target=rust CLI option produces full Rust crate (Cargo.toml + src/lib.rs)
- Types: Nat→u64, Bool→bool, String→String, Set→HashSet, Map→HashMap
- State variables → Rust struct fields
- Actions → Rust impl methods returning Result
- Expression rewriter: .contains(&x), .get(&k), .len(), etc.
- Tested against ToggleSwitch, TigerBeetleLedger, KafkaKRaft
- All 37 existing tests pass

WASM path: .speck → Rust → wasm-pack → WASM (now complete)
This commit is contained in:
cos Agent 2026-05-09 23:24:40 -07:00 • committed by Scott Scoble
parent e86af21cc7
commit f62bdc33f5
10 changed files with 961 additions and 19 deletions

View file

@ -12,7 +12,7 @@
"@type": "prov:Generation",
"prov:activity": {
"@type": "prov:Activity",
"prov:startTime": "2026-05-10T06:07:50.697Z"
"prov:startTime": "2026-05-10T06:24:31.493Z"
}
},
"rdfs:label": "RetryHandler",

View file

@ -38,7 +38,7 @@
"name": "Scott Scoble",
"email": "scott@scoble.me"
},
"timestamp": "2026-05-10T06:07:50.700Z"
"timestamp": "2026-05-10T06:24:31.495Z"
},
{
"subject": "speck:RetryHandler",
@ -53,7 +53,7 @@
"name": "Speckl Compiler",
"email": "compiler@speckl.scoble.me"
},
"timestamp": "2026-05-10T06:07:50.700Z"
"timestamp": "2026-05-10T06:24:31.495Z"
},
{
"subject": "speck:RetryHandler",
@ -68,7 +68,7 @@
"name": "Speckl Compiler",
"email": "compiler@speckl.scoble.me"
},
"timestamp": "2026-05-10T06:07:50.700Z"
"timestamp": "2026-05-10T06:24:31.495Z"
}
]
}

View file

@ -13,7 +13,7 @@
"spdxVersion": "3.0.1",
"dataLicense": "CC0-1.0",
"creationInfo": {
"created": "2026-05-10T06:07:50.702Z",
"created": "2026-05-10T06:24:31.496Z",
"createdBy": [
"Organization: Speckl",
"tool: speckl-compile-0.2.0"
@ -27,7 +27,7 @@
"@type": "spdx:Tool",
"name": "speckl-compile"
},
"timestamp": "2026-05-10T06:07:50.702Z",
"timestamp": "2026-05-10T06:24:31.496Z",
"comment": "Review type: manual"
}
]