News for hackers. Stuff that matters.
Re:Writing a Compiler is Surprisingly Easy (part 1) by HarHarVeryFunny on Wednesday November 08, 2023 @07:24AM (#38189457)
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.

Re:Writing a Compiler is Surprisingly Easy (part 1) by red-iron-pine on Wednesday November 08, 2023 @10:28AM (#38191768)
i'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.

Re:Writing a Compiler is Surprisingly Easy (part 1) by elegantlie on Wednesday November 08, 2023 @01:33PM (#38194785)
Exactly 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.