5 ms·
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 sou
by spekcular 7y ago
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.
- chrisseaton 7y agoIt'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.
- jcranmer 7y agoOne 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…