That looks very promising. Imagine development speed based on that and for Zig and 1. static analysis, 2. dynamic analysis, 3. debugging/introspection tooling (code reduction, io-substitution), 4. backend experimentation.
layer8 31 days ago [-]
It reminds me of the speed of the Turbo Pascal IDE 30+ years ago. Compilation was virtually instant, my young self wasn’t even aware it was happening.
pjmlp 31 days ago [-]
Yes, it is quite surprising the way things turned out with scripting languages, and people used to large C and C++ codebases, that folks lost track of how it used to be.
By the way Delphi, FreePascal, D are just as fast still.
myth_drannon 31 days ago [-]
Are you sure it's not just your memories of younger/happier times?
I'm still using Borland Turbo C from time to time on my 486 machine and the compilation is so painfully slow even for smaller projects. Typing on the other hand and UI in general is blazingly fast.
Turbo c was slow, Turbo Pascal and later object pascal were (and are) very fast.
GianFabien 31 days ago [-]
Turbo C was an attempt to profit off the reputation of Turbo Pascal.
BTW Borland didn't create the compiler, instead licensed the technology from Poly Data.
agent281 31 days ago [-]
Hilarious because I watched this while my code was compiling.
laserbeam 31 days ago [-]
Is there any intermediate representation of the project that gets dumped to disk which could be used as a basis for an LSP? I know the need for an lsp drops significantly with fast compilation… yet this still feels like it might improve the existing one significantly?
mlugg 31 days ago [-]
The long-term plan is for Zig to expose some form of language server (not LSP) from the compiler itself, so it can use all the information it gets from doing the compilation. Incremental compilation is a key part of this plan, because it means we can get new up-to-date information in milliseconds rather than seconds or minutes when a file changes.
slekker 31 days ago [-]
How would it integrate with an LSP afterwards?
Cloudef 30 days ago [-]
Someone would write a wrapper that translates it to LSP protocol.
layer8 31 days ago [-]
The most impressive thing is that this doesn’t cause an infinite recompilation loop. ;)
mlugg 31 days ago [-]
The compiler is set up so that this should be impossible! At the start of an "update", we mark parts of the dependency graph as "outdated" and "potentially outdated", based on which source code changed. From there, we repeatedly use a heuristic to find the "best" thing to analyze; each thing we analyze is guaranteed to remove at least one outdated (/potentially outdated) thing, and compilation terminates once nothing is marked outdated.
The way we do this does unfortunately mean that if our heuristic goes very wrong, we can end up doing much more work than is necessary. There are some real nasty cases with self-referential types right now. However, for simple things like changing function bodies, it works lovely!
layer8 31 days ago [-]
I would have expected (assuming the compiler executable is included as a tracked dependency at all) that it stops once the output doesn’t change anymore.
By the way Delphi, FreePascal, D are just as fast still.
BTW Borland didn't create the compiler, instead licensed the technology from Poly Data.
The way we do this does unfortunately mean that if our heuristic goes very wrong, we can end up doing much more work than is necessary. There are some real nasty cases with self-referential types right now. However, for simple things like changing function bodies, it works lovely!