Re:CC500: a tiny self-hosting C compiler
by boomlinde on Saturday November 08, 2014 @07:04AM
(#8576623)
> 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.
Re:CC500: a tiny self-hosting C compiler
by vidarh on Saturday November 08, 2014 @10:51AM
(#8577188)
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.
Re:CC500: a tiny self-hosting C compiler
by wlievens on Saturday November 08, 2014 @02:56AM
(#8576317)
If you compare it to the gargantuan that is an actual production compiler, it sure is tiny.
Re:CC500: a tiny self-hosting C compiler
by userbinator on Saturday November 08, 2014 @10:55AM
(#8577203)
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.
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