3 ms·
Not sure what the parent means by it, but here is lines of code data generated using David A. Wheeler's 'SLOCCount'. SLOC Directory SLOC-by-Language (Sorte
by tom_mellior 7y ago
Not sure what the parent means by it, but here is lines of code data generated using David A. Wheeler's 'SLOCCount'.
SLOC Directory SLOC-by-Language (Sorted)
36270 top_dir ansic=35504,sh=460,perl=306
28825 win32 ansic=28716,asm=109
9692 tests ansic=8806,asm=858,sh=28
2395 lib ansic=2252,asm=143
158 include ansic=158
140 examples ansic=140
Totals grouped by language (dominant language first):
ansic: 75576 (97.54%)
asm: 1110 (1.43%)
sh: 488 (0.63%)
perl: 306 (0.39%)
As far as I can tell, the top-level directory is the actual compiler itself. 35k lines is pretty small for a real C compiler that can bootstrap GCC (the versions that were still written in pure C).
- vkazanov 7y agoWhat I mean is what I said :-) 70k is not tiny. And one cannot just throw away a backend and say that it's not part of the compiler. Compare it with a few others: 8cc/9cc - 10K LOC cproc - 7K LOC lcc - 30K LOC
- tom_mellior 7y ago> And one cannot just throw away a backend and say that it's not part of the compiler. OK. Let me rephrase: TCC doesn't have 35k lines of code, but with five minutes' work it could be turned into a compiler with 35k lines of code capable of bootstrapping GCC on Linux. That should be enough to compare it to the ones you list.
- vkazanov 7y agoThat's an interesting way to put it. :-D I believe we could do that to a lot of other compilers, say, lcc (30k) with its multiple backends and get something like 10-20k. Anyways, what I was trying to say is that "tiny" in "tinycc" has lost its meaning already.
- userbinator 7y agocproc is not 7K self-contained either; from the GitHub page: "cproc is a C11 compiler using QBE as a backend".
- vkazanov 7y agothat's correct. But even if you add qbe you only get 12k more, or about 20k, not 70k.