Vendoring Zig Compiler as Library

Hi all, I’ve been working on a node editor using Vulkan and Wayland. I am playing around with creating my own version of MaxMSP, which is a node editor that can be used essentially to create sound graphs where each node is a source, a filter, etc. It is often used for prototyping, but also for other creative sound tasks.

One feature I am keen on trying to implement is the ability to write nodes on the fly in Zig, and allowing them to be recompiled and hot reloaded on the fly. Essentially, the graph is just a representation of a zig program we are constantly hot reloading. This has the benefit that any graph can be trivially exported to be used downstream (imagine: deployed on embedded product, which is close to my interests professionally as I work at a loudspeaker company). I think this plays nicely into zigs strength of near-instant compilation and cross-compilation abilities.

Is this something that anyone has tried? Ideally, I wouldn’t rely on a separate install of Zig, rather I’d love to have it as a library instead.

Sorry in advance if this is a duplicate! Feel free to refer me if that is the case.

1 Like