Hacker News new | past | comments | ask | show | jobs | submit login

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




> 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.


If you compare it to the gargantuan that is an actual production compiler, it sure is tiny.


767 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.


The 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...


I propose the tinyness of a compiler is directly proportional to the number of comments spontaneously arguing it isn't.


That means it can be gamed




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: