Stream: beginners

Topic: Integration into a rust app


view this post on Zulip Vladimir Zotov (May 10 2024 at 21:40):

Is there a minimal example of integrating Roc into a rust app. I assume I will need the roc glue CLI command, right?

view this post on Zulip Luke Boswell (May 11 2024 at 06:51):

https://github.com/roc-lang/roc/tree/remove-gen-stub-lib/examples/platform-switching/rust

view this post on Zulip Luke Boswell (May 11 2024 at 06:51):

On a branch, and hasn't merged yet. But I've been working on updating all the example platforms

view this post on Zulip Luke Boswell (May 11 2024 at 06:52):

This is the rust one and I think answers your question. Let me know if this helps?

view this post on Zulip Luke Boswell (May 11 2024 at 06:54):

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.

view this post on Zulip Luke Boswell (May 11 2024 at 06:56):

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