News for hackers. Stuff that matters.
Re:My First Fifteen Compilers by lboasso on Friday July 12, 2019 @11:11AM (#20421269)
I wrote a self-hosted one pass compiler exactly to showcase Niklaus Wirth's approach to writing compilers: https://github.com/lboasso/oberonc

We often forget this alternative way (with its pros and cons).

Re:My First Fifteen Compilers by AnimalMuppet on Friday July 12, 2019 @12:46PM (#20422096)
I think that you need Wirth's approach to writing languages, not just compilers. I'm not sure that a one-pass C++ compiler would be easy. But Pascal (and Oberon?) were designed with that in mind. ("No forward references" is one place this shows.)
Re:My First Fifteen Compilers by mntmoss on Friday July 12, 2019 @04:46PM (#20424349)
Another one-pass data point is Action![0] for the Atari 8-bit computers. The compiler is extremely efficient for its day and a source code release was made just a few years ago. [1] But good luck making sense of it -- besides being all 6502 assembler, the source code is tremendously complicated by the amount of codesize optimization taking place, and discussion in the AtariAge forums from the folks who got it released indicates that writing this compiler pushed the author to his very limits. It probably could have benefited from a compiler-compiler!

[0] http://wiki.c2.com/?ActionLanguage

[1] https://sourceforge.net/projects/atari-action/