I'm looking for a language to use as a scripting language for a plugin system for a project of mine. No language so far has provided what I want it to have, and someone suggested Roc, so I am considering it right now. What do all of you think? Should I use it for this purpose? Is that possible?
I think roc is great for scripting. I've been using it a lot. What kind of scripts are you wanting to write?
If you'd like to see an example of a script in roc using basic-cli for example, checkout this build script which we use to build basic-cli iteself.
Sorry, I realized that in editing my message trying to be clearer about what I mean, I completely deleted what I actually meant.
I'm making a program, and I want it to have plugin support. I'm looking for a programming language to use for this
Is roc a good choice for this?
I also think roc is a good choice for this too :smiley:
There's a few others who are also keen on using roc in this way. Lot's of different options for how to do it today, depending on a few trade-offs.
For example you might want to;
roc build --lib
or possibly a WASM moduleI really am entering areas beyond my expertise here wow. I suppose it's always good to learn new things. Do you know what I should look into to get started with doing this in Rust?
Minor plug for my template repository https://github.com/lukewilliamboswell/roc-platform-template-rust
I'd start by getting set up and familiar with the basics of making a platform. Try adding effects or different features.
It's a fairly deep rabbit hole :sweat_smile: I've been learning new things for quite some time, but folks here have always been very helpful and taught me a lot about low level things.
Certainly looks deep huh!
I guess I should start by asking what a platform is
Is it like... a library that provides functionality to the language?
Your program would be a platform. It is the underlying program that actually executes and gives all io primitives to roc
i see
that's interesting
i see why you're saying it's good for plugins, if it works like this
Should I use it for this purpose?
Roc is usable for this today, but it definitely is not easy to use like this currently. Platform development while not super hard is not easy either. So 100% doable, but expect to spend time debugging and tailoring to your needs.
Of course, many people here are willing to help out and guide
At this point, making my own language is among my other options, so spending time debugging and tailoring is an upside compared to that haha. I do wanna make sure that Roc is a good choice for me, so I'm gonna spend some more time checking it out before i commit to spending weeks trying to implement it for my program
Specifically, dynamically loading different roc applications at runtime is more complex.
How most platforms work today, they are statically linked with the roc app to generate a single executable. So that is what most examples (like basic-cli and basic-webserver).
That said, once the api is built out, using via a shared library isn't all that much harder. In a language like rust, you would delegate to the roc
to compile the app into a shared library (probably with command). Then you would use libloading to load that shared library. Finally, you would just be calling into the roc app.
Last updated: Jul 06 2025 at 12:14 UTC