3 ms·
I thought is was about this: https://bellard.org/otcc/otcc.c https://bellard.org/otcc/otcc.c (a tiny, obfuscated C compiler, winner of the 2001 IOCCC). It has l
by GuB-42 4y ago
I thought is was about this: https://bellard.org/otcc/otcc.c 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/ 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.
- userbinator 4y agoWhenever the subject of tiny learning-oriented compilers comes up, I always recommend C4: https://news.ycombinator.com/item?id=8558822 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.
- dunham 4y agoOne of my favorites is the self-hosting Haskell compiler from the 2019 IOCCC: https://www.ioccc.org/2019/lynn/hint.html 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/ https://crypto.stanford.edu/~blynn/compiler/