News for hackers. Stuff that matters.
Re:The Super Tiny Compiler by GuB-42 on Thursday March 02, 2023 @08:54PM (#35004840)
I thought is was about this: https://bellard.org/otcc/otcc.c (a tiny, obfuscated C compiler, winner of the 2001 IOCCC). It has led to TinyCC (https://bellard.org/tcc/), not as tiny, but also more complete, not obfuscated and actually useful.

It turns out the compiler in the article is the opposite of that. It it a simple toy transpiler and the code is very clear and mostly made of comments. The former is a feat of optimization, the latter is a tutorial.

Re:The Super Tiny Compiler by userbinator on Thursday March 02, 2023 @10:33PM (#35005456)
Whenever the subject of tiny learning-oriented compilers comes up, I always recommend C4: https://news.ycombinator.com/item?id=8558822

It's a tiny self-compiling compiler which also includes a bytecode interpreter, and terse but also very understandable.

Re:The Super Tiny Compiler by dunham on Thursday March 02, 2023 @10:46PM (#35005541)
One of my favorites is the self-hosting Haskell compiler from the 2019 IOCCC: https://www.ioccc.org/2019/lynn/hint.html

There is a series of articles on how it was built here: https://crypto.stanford.edu/~blynn/compiler/