News for hackers. Stuff that matters.
Re:Mugo, a toy compiler for a subset of Go that can compile ... by jhgb on Monday April 12, 2021 @05:00PM (#26785115)
> whereas mine is 1600 lines of formatted Go.

I wonder how the whole thing compares with the newest Oberon (which should be at around 2900 lines of code or so). After all, if you drink enough beers, Oberon might look like "a subset of Go that can compile itself" to you.

Re:Mugo, a toy compiler for a subset of Go that can compile ... by benhoyt on Monday April 12, 2021 @06:31PM (#26786003)
Wow, I had no idea the Oberon implementation was so small, thanks. And it looks like it's implemented in a similar way, with parsing and code generation mingled together. It is ~2900 lines of code, though it's very dense. You can see it here: http://www.projectoberon.com/

   ORB - symbol table handling - 430 lines
   ORG - code generator (for RISC) - 1115 lines
   ORP - parser (calls scanner and code generator - 997 lines
   ORS - scanner/lexer - 312 lines