From Rust
You trust the borrow checker but you are tired of negotiating with it over self-referential structs, and tired of pinning CPU cores for minutes per build. Rasmalai keeps deterministic memory and drops both taxes. Your ownership mental model transfers almost untouched. The annotations stay behind.
Lifetimes vs lexical scopes
Rust names every borrow. Rasmalai ties each value to the block that owns it. The scope end is the free point, visible in the source:
Shared structure that would cycle in Rust uses GenRef<T> handles here: copying one never touches atomics, and .get() yields null once the owner frees, with no annotations and no borrow checker fight.
struct Edge {
let label: String;
let weight: Int;
}
let edges = [Edge("ore", 0), Edge("ore", 2)];
let total = 0;
for e in edges {
total = total + e.weight;
}
println!(total); Drop vs defer
Rust runs Drop::drop at scope end. Rasmalai runs defer blocks at scope end, in the open, in order:
Output order is query ran, txn committed, conn closed: last-in, first-out, exactly like stacked guards.
Result vs throws
Throwing functions mark throws; callers use try or propagate with their own throws. Caught values dispatch with switch and is checks instead of combinator chains:
fn risky(ok: Bool): Int throws {
if ok { return 1; }
throw 0;
}
try {
println!(risky(true));
} catch (err) {
println!("failed");
} What changes, what stays
| Rust habit | Rasmalai equivalent |
|---|---|
let immutable, mut to opt in | let mutable, const to opt out |
| Lifetimes on every borrow | Lexical scopes own values |
Drop impls | defer blocks at the use site |
Result<T, E> plumbing | throws + try/catch |
cargo check warmup | rnx check in milliseconds |
Next: the Guide from the top, or the Manual for exact ARC semantics.