Is there a minimal example of integrating Roc into a rust app. I assume I will need the roc glue CLI command, right?
https://github.com/roc-lang/roc/tree/remove-gen-stub-lib/examples/platform-switching/rust
On a branch, and hasn't merged yet. But I've been working on updating all the example platforms
This is the rust one and I think answers your question. Let me know if this helps?
The other possibilities are to have the rust app drive the build completely or to load the roc app dynamically. To do these you can build the app separately into a library with roc build --lib
.
Though that example only supports the legacy linker. I've also got changes for basic-cli staged which show how to use cargo to support the surgical linker too. https://github.com/roc-lang/basic-cli/tree/refactor-host
Last updated: Jul 06 2025 at 12:14 UTC