Stream: platform development

Topic: Embedding Roc into an application


view this post on Zulip teskje (Nov 09 2024 at 18:11):

Hi! I'm musing about using Roc as a way to let users extend an existing application. Specifically, in my case the application is a database written in Rust and it would be cool if users could define their own custom query logic using a pure language. Roc fits the "pure" bill, but I'm not sure its platform concept supports the use case too.

My current thinking is that the user would somehow provide the Roc code to the database application, which would then compile it using a custom platform into wasm, and then invoke the wasm code to transform queried data.

Does it seem like Roc would fit that bill? Are there any existing projects that attempt something similar?

view this post on Zulip Anton (Nov 09 2024 at 18:20):

Seems like that could work to me :)
I think I remember people talking about a wasm "pipeline" like this before, but I don't know of any implementations.

view this post on Zulip Luke Boswell (Nov 09 2024 at 20:14):

Sure, I think roc would be a good idea :grinning:

Here's a super simple example using native

https://github.com/lukewilliamboswell/roc-plugin-experiment-rust

view this post on Zulip Luke Boswell (Nov 09 2024 at 20:14):

Here's an older template for WASI

https://github.com/lukewilliamboswell/roc-platform-template-wasi

view this post on Zulip Luke Boswell (Nov 09 2024 at 20:16):

You should know that platform dev can be a little challenging at the moment, thinfs are still in development and changing and there's not a lot of documentation.

But I'm happy to try and help people learn more. I've been tinkering away on various platforms trying to learn as I go.

view this post on Zulip teskje (Nov 09 2024 at 20:21):

Yeah, I noticed the lack of documentation and am fully prepared to dig through source code. Just wanted to make sure the thing I'm trying to do actually makes sense first :)

Thanks for the examples, that's exactly what I was looking for!


Last updated: Jul 06 2025 at 12:14 UTC