[HN Gopher] Incremental compilation instantly rebuilds the Zig c...
       ___________________________________________________________________
        
       Incremental compilation instantly rebuilds the Zig compiler [video]
        
       Author : kristoff_it
       Score  : 51 points
       Date   : 2025-02-11 19:10 UTC (3 hours ago)
        
 (HTM) web link (www.youtube.com)
 (TXT) w3m dump (www.youtube.com)
        
       | agent281 wrote:
       | Hilarious because I watched this while my code was compiling.
        
       | layer8 wrote:
       | The most impressive thing is that this doesn't cause an infinite
       | recompilation loop. ;)
        
         | mlugg wrote:
         | 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!
        
       | matu3ba wrote:
       | 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 wrote:
         | 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 wrote:
           | 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 wrote:
           | 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.
        
             | layer8 wrote:
             | I don't think so: https://prog21.dadgum.com/47.html
        
             | tluyben2 wrote:
             | Turbo c was slow, Turbo Pascal and later object pascal were
             | (and are) very fast.
        
       ___________________________________________________________________
       (page generated 2025-02-11 23:00 UTC)