Compiler Engineering in Practice - Part 1: What is a Compiler?

10 points by dhruvp


snej

The focus on “miscompiles” leads me to reflect that compilers have gotten so much better in my lifetime.

I used to find and report compiler bugs pretty often, back in the 80s/90s, in Lightspeed Pascal, THINK C, Symantec C++, Metrowerks C++. Fortunately most of those caused bogus errors or crashed the compiler, but there were a fair number of miscompiles. Those are damn hard to discover!

I can’t remember the last time I found a miscompile. I’ve found bugs recently in e.g. Clang's implementation of C++ coroutines, and I’ve crashed MSVC a number of times, but I don’t remember any where the binary code did the wrong thing.

I wonder how much of this is improved coding & testing styles, improved tooling like sanitizers, and how much is due to the many-eyeballs benefit of open source? (Those old compilers I mentioned were all proprietary. I don’t think I’ve used a closed-source compiler since Y2K!)