4 ms·
I think the ones which can self-compile are most interesting, because it passes a "it's not just a trivial example anymore" point. To do that in a single relati
by userbinator 7y ago
I think the ones which can self-compile are most interesting, because it passes a "it's not just a trivial example anymore" point. To do that in a single relatively small file also makes it convenient for studying.
Mini-C is even more amazing if you look at its description:
I set myself a challenge: write a self-hosting C compiler in 10 hours.
Although the language it accepts, being untyped, is closer to B.
Also nice to see my personal favourite, C4, in the list.
- onlyrealcuzzo 7y agoHe wrote a self hosted C compiler in 10 hours?! How?! That is straight up sorcery.
- progfix 7y agoIt's not that hard if you have experience in writing compilers.
- mras0 7y agoHadn't seen Mini-C before, that's quite the feat. Apart from the awesome C4, I also like 8cc (https://github.com/rui314/8cc https://github.com/rui314/8cc) in this category. Recently did this myself (https://github.com/mras0/scc/blob/master/scc.c https://github.com/mras0/scc/blob/master/scc.c) but it took waaaaay more than 10 hours and I had many previous failed attempts before that.