Hi all, I was curious if there is a way to link to the roc compiler so that I can embed it in a program?
I recognize that the new compiler is still immature so this could be a "nice to have" in the future.
There are plans for a libroc though we don't have a library published or easy to use yet
Lukas Hermann has marked this topic as resolved.
Currently for the roc WASM playground we compile various roc modules using zig, so we know there are minimal dependencies and everything works nicely cross-platform (U32/U64 etc).
The zig modules are available via github, which is how I use the builtins in the zig platform template. So in theory it should be pretty easy to embed the whole compiler, the challenges at the moment comes from the BuildEnv which is used to schedule and compile all the different .roc files.
Is there a particular reason you want to embed the compiler and not just a compiled roc app?
In this PR https://github.com/roc-lang/roc/pull/8548 that I'm currently working on, we introduce another interpreter shim so roc (cli) can build standalone binaries even before we have the functionality to lower to machine code in the compilation pipeline
Luke Boswell said:
Is there a particular reason you want to embed the compiler and not just a compiled roc app?
It’s kind of a “it would be cool if I could do this” idea. There’s a creative software called TouchDesigner which has Python and GLSL nodes. I was thinking it would be a fun project to try to make a Roc node and platform
Last updated: Dec 21 2025 at 12:15 UTC