4 ms·
Writing a toy compiler is easy enough - often given as a comp. sci. student exercise. Writing a highly optimizing standards compliant one, one with dozens of re
by HarHarVeryFunny 3y ago
Writing a toy compiler is easy enough - often given as a comp. sci. student exercise. Writing a highly optimizing standards compliant one, one with dozens of real world constraints is another story, especially if you are writing the whole thing and not building atop of something like LLVM.
It's a bit like saying that building a rocket is no big deal, and wanting others to assume you've built a space shuttle when really it's a hobby rocket.
- red-iron-pine 3y agoi'd have phrased it more like building a shed vs. building a mansion or shopping mall. you can learn a lot of basics building a shed -- pouring concrete, adding spaces for wiring, drainage, etc. -- but ultimately it's just a small one off for learning.
- elegantlie 3y agoExactly this, the complexity of a production compiler project is its sheer vastness. Hundreds to thousands of language features need to work together in a performant and correct manner. Plus, the language itself is probably less than 15% of the work. You'll need a build system, a standard library, a code formatter, a syntax highlighter, support for incremental and cached builds, helpful error messages, bindings for a systems language like C, among other things.