News for hackers. Stuff that matters.
Re:Compiler Construction by Niklaus Wirth [pdf] by spekcular on Friday January 31, 2020 @06:33PM (#22207094)
How would you show a novice how it's done today?

I've always wanted to learn about compilers, but something tells me the dragon book is no longer the go-to source.

Re:Compiler Construction by Niklaus Wirth [pdf] by chrisseaton on Friday January 31, 2020 @07:02PM (#22207305)
It's actually a real problem - the knowledge of how for example JavaScript VMs and JITs work isn't really written down very well. It's all in people's heads and you learn as an apprentice (PhD student). I don't have a better solution than to show you in person.
Re:Compiler Construction by Niklaus Wirth [pdf] by jcranmer on Friday January 31, 2020 @11:48PM (#22208742)
One of the issues, I think, is that compilers has really become a topic that is way too broad to fit into one book. You'd need at least:

* Foundations: the frontend, codegen [to IR] (including vtables, lambdas, and coroutines, probably), the big scalar optimizations, register allocation, maybe instruction scheduling?

* Loop optimizations: dependence analysis, all the loop opts, autovectorization, autoparallelization. Maybe cover some OpenMP or heterogeneous computing (e.g., SYCL, CUDA) here

* "Fancy" optimizations: profiling (including what & how to profile), link-time (including thin-lto techniques), SLP vectorization, possibly superoptimization and dataflow analysis

* Dynamic language VMs: JITs, garbage collection, shape optimization, and several of the various tricks (e.g., NaN-boxing, deoptimization guards)

* You might be able to make an entire book out of fuzzing and symbolic/concolic execution, but I think it'd be thinner than the other ones here.

And there are still things I don't know where to put. Alias analysis, exception handling, debugging…