Skip to content

Rust

A stable Rust toolchain supporting edition 2021. Native capabilities build through Cargo and use the maintained dependencies required by the output.

From a prepared source module containing a main package:

Terminal window
goalchemy compile -target rust -out out/rust .
cd out/rust
sh run.sh

Or use goalchemy run -target rust . to compile and execute in a temporary directory. Add -gate cooperative for source tasks or suspending operations.

The Rust target emits src/main.rs for executables, package-owned src/pkg_*.rs modules, src/shared.rs, selected src/rt/ files, Cargo.toml, and run.sh. Standard-only output can run through plain rustc; capability output uses Cargo.

Every output includes its own README.md, selected runtime files, source mappings, and goalchemy.manifest.json. See the full output reference for the inventory and entry behavior.

Non-main packages emit src/lib.rs and an owned Cargo library boundary with Result/Future APIs and cancellation. Your SDK delivery pipeline supplies its dependency lock. Read the Rust library boundary for values, host entry, and lifecycle.

Values live in a traced heap collected at safepoints; byte leaves use native Vec<u8>. Set GOALCHEMY_HEAP_STATS=1 to print heap statistics and GOALCHEMY_GC_THRESHOLD to control collection frequency. .rs.lines sidecars retain source positions.

Library boundary · Host operations · Byte storage