r/ProgrammingLanguages • u/thunderseethe • Feb 19 '26
Blog post Compiler Education Deserves a Revolution
https://thunderseethe.dev/posts/compiler-education-deserves-a-revoluation/
70
Upvotes
r/ProgrammingLanguages • u/thunderseethe • Feb 19 '26
22
u/superstar64 https://github.com/Superstar64/Hazy Feb 19 '26
I'm still perplexed why people say query based compilers are that different. Is it really that much more then just adding lazy evaluation to a batch compiler? I know I'm rather biased because of how much time I've put into writing batch compilers in Haskell, but still.
26
u/Breadmaker4billion Feb 19 '26
I agree that it needs to improve, but not to be turned upside down. The issue here is pedagogical. It's easier to understand each pass of the compiler separately.
The motivation to write query-based compilers is about code reuse: you want to reuse the code of your compiler in your LSP. But most compiler writers are hobbyists. Yes, query-based compilers are a must if you want to write a production compiler. But you can get away with a LSP using last century architecture.
Writing a new book that has as a requirement knowledge of older books? Yep, makes all the sense in the world. Writing a book for beginners that starts up front with query based compilers? Doesn't seem pedagogically sound.
2
u/dnpetrov Feb 20 '26
Indeed, it focuses too heavily on the compiler front end, and often just skims through backend and runtime topics. This creates a (false) impression that compiler development is mostly about lexing/parsing and maybe a little bit of type checking. Industrial compiler development today, though, is heavily focused on the backend and runtime. Yes people still design new languages, and those new languages need frontends. But, as usual, from those new languages only rare few actually matter for the industry. There's nothing wrong in designing a language "for the science", but we don't need so much focus on that, no thank you.