There are countless war stories about how long a compile can take.  Even xkcd made a mention of it.Now, I haven't been programming for a long time and have mostly just been exposed to Java and Python (and Python is an interpreted language, not a compiled one). I realize it's possible that I just haven't come across projects that take very long to compile, but even for decent sized apps, it has either been instantaneous for me (usually handled in the background by an IDE) or taking no more than 30 seconds or so for an extremely large project. Even in a business environment (where the comic takes place), I've never had code take that long to compile.Have I just not been exposed to projects with long compile times? Is this a relic of the past that is no longer something that happens in the modern day? Why would a compile take such a long time?
Are long compiles a thing of the past?
compiling
Compilation can take a while, especially for large projects written in languages like C, C++, or Scala. Compiling parts in the background can reduce the compilation time, but occasionally you have to do a fresh compile. Factors that can lead to long compilation times include:Large code size, obviously. Large projects will have hundreds of thousands of lines of code.C's #include preprocessor directive, which effectively causes the same code to be compiled hundreds of times. The macro system has similar issues, as it works on a text-level. The preprocessor really bloats up the code size that's actually passed to the compiler. Looking at a file after preprocessing (e.g. via gcc -E) should open your eyes.C++'s templates are Turing complete, which means that in theory you can perform arbitrary computations at compile time. Nobody really wants to do that, but even lots of simple cases do add up to quite some time spent specializing the templates.Scala is a fairly young language, and the compiler is horrendously under-optimized. Currently, the compiler uses a very large number of compilation passes (C is designed to require only two compilation passes). Typechecking is one of these passes, and can take some time due to the complicated type system featured by the language.Compilation isn't the only thing that takes time. After the project has been compiled, a test suite should be run. The time spent on this can range from a few seconds to a couple of hours (if the tests are written badly).