4 ms·
What about the Tiny C Compiler (TCC) that Fabrice Bellard wrote? https://bellard.org/tcc/ https://bellard.org/tcc/
by msclrhd 7y ago
What about the Tiny C Compiler (TCC) that Fabrice Bellard wrote? https://bellard.org/tcc/ https://bellard.org/tcc/
- Skywalker13 7y agohttps://bellard.org/otcc/ https://bellard.org/otcc/
- vkazanov 7y agoit not tiny anymore :-)
- ainar-g 7y agoCould I ask you what do you mean by that?
- megous 7y agoThe referenced compilers are a different level of tiny, like 500 lines of tiny. :)
- ainar-g 7y agoAh, I see. tcc is still tiny compared to clang and gcc though :-)
- tom_mellior 7y agoNot 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.
- agumonkey 7y agoI wonder if anybody ported tcc-linux