-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is incremental compliation and why is it difficult? #30
Comments
Hot reloading is orthogonal to incremental compilation. It means being able to load modified, rebuilt code without restarting the application. This usually means that the unit of reloading is a dynamic library. Incremental compilation at it's root is about caching and as we know from Phil Karlton, cache invalidation is one of the hardest problems in computer science (along with naming things). Hard to say what design decisions Zig will take on the way to realizing incremental compilation, since it has not been realized yet. |
in short details (yes this is short lol this is a really complex subject and i really reccomend you to study more about if you have interest), Incremental compilationis the hability of cache/save compilation data during build and only recompile what is modified. e. g.:
zig-cache contains the binary for EACH script, instead of the entire binary of the entire project. each script can be linked with each other using a linker, but not executed, as they are object files. Why is it difficult?
Hot reloadingis the hability of change the code while the aplication is running, making it unecessary to close and compile everything again to see little changes being aplied. as an example, imagine that i have the following code: while (true) {
Std.Debug.print("Hello, World!", .{});
} in the console, i will see the following result repeating again and again:
With hot reloading, still having the aplication running, i can edit the code to: while (true) {
Std.Debug.print("Hello, World! This was hot reloaded!", .{});
} and now, the console will be printing the edited message instead of the old one, without needing to open it again:
(don't confuse with it be running another routine. It's still the same, only the binary instructions for it execution has changed) What one have to do with anotherMainly, nothing. Both are pretty the same thing and at the same time, complete different things. Here are a table explaining more preciselly the difference of both (dot (
|
What are some design decisions taken by Zig toward that goal and how does it do so? And what exactly is hot reloading and where does it fit among these concepts?
The text was updated successfully, but these errors were encountered: