Not yet but that’s an idea that I’ve had in mind for a while now.
The good news is that most of the framework is already there; the compiler already speaks a protocol to communicate semantically information to the parent process, and the build runner acts as a multiplexer. The cache system already has a complete list of files that when changed indicate a rebuild is needed. I’ve been slowly building up to this feature all this time.
It would also be neat to integrate this with user applications - for example, zig build run
could spawn the application with a special pipe open that communicates information about rebuilds. For example, if your application is a web server, it could poll the pipe to find out when a rebuild occurs, and find out which installation files in particular have been updated, reload them in memory, and maybe even send a message to connected clients, telling them to refresh certain assets, or maybe the entire page.
Related: hot code swapping · Issue #68 · ziglang/zig · GitHub
I don’t want only a cool hot code swapping demo - I want it to be fully integrated with the build system, and practically useful for many different kinds of projects.