4 ms·
Does 767 LoC / 17KB really get to be considered tiny? I mean, sure, it's small and efficient.. but there are other contenders to consider, such as Fabrice Bell
by jaytaylor 12y ago
Does 767 LoC / 17KB really get to be considered tiny? I mean, sure, it's small and efficient.. but there are other contenders to consider, such as Fabrice Bellard's [0] tiny obfuscated self-hosting c-compiler in under 500 lines.
How can we unambiguously distinguish between what qualifies for the classification of a "tiny" c-compiler versus just a "small" one?
[0] http://www.bellard.org/otcc/otcc.c http://www.bellard.org/otcc/otcc.c
- huegh 12y agoI propose the tinyness of a compiler is directly proportional to the number of comments spontaneously arguing it isn't.
- EGreg 12y agoThat means it can be gamed
- wlievens 12y agoIf you compare it to the gargantuan that is an actual production compiler, it sure is tiny.
- boomlinde 12y ago> How can we unambiguously distinguish between what qualifies for the classification of a "tiny" c-compiler versus just a "small" one? We don't care about an unambiguous distinction.
- vidarh 12y ago767 LoC of code including comments describing the grammar. Strip out the comments and you're already do to 600. Move opening brackets and a other very few steps, and you get it down to 560. Getting this below 500 lines should be fairly trivial. So if your comparison is the completely unreadable otcc, then I'd say yes, this qualifies.
- userbinator 12y agoThe distinctions are quite arbitrary since there currently isn't anything like a size-competition for compilers, but if forced to make categories, I'd consider <1kLoC to be "tiny" and <10kLoC "small". In contrast, GCC is nearing 10MLoC - 4 orders of magnitude difference - and its C parser alone is >10kLoC: https://github.com/gcc-mirror/gcc/blob/master/gcc/c/c-parser.c https://github.com/gcc-mirror/gcc/blob/master/gcc/c/c-parser...