I came here to ask about a similar idea to what was discussed in #ideas > hot loading
So my use case is that I want to do live audio programming in Roc. When you run some sort of "update" command, the latest iteration of the audio code is compiled and then run by the platform. The platform owns the audio buffers and any state neccessary for a transition between iterations.
The platform would need to have two versions of the app running concurrently during the transition as the app will have a built in latency of say 1024 samples and we don't want the output buffers to run dry, which would create horrible sounding glitches. So the new iteration of the app needs to get up to speed for 1024 samples while the old iteration finishes it's input buffers.
What is the feasibility of doing something like this? Would I need to hack on the linker or is there a way to output a dynamic library for the app only and then dynamically load it in the platform in question?
This plugin system you mentioned in the hot loading thread, @Alexander Pyattaev , where would I find some source code for that?
Roc has --lib to emit a shared library. That can be loaded at runtime for you to do exactly this.
Should be functional today, just more error prone due to types being more manually dealt with
Thanks! That should be completely viable for some value of viable!
Yeah, this is actually how the compiler runs roc glue currently. It compiles the glue script as a shared lib and loads it.
Have you had success in the dynamic loading direction?
Last updated: Jun 16 2026 at 16:19 UTC