5 ms·
Shameless self promotion of my work in progress C compiler https://github.com/andrewchambers/cc https://github.com/andrewchambers/cc which is attempting to crea
by andrewchambers 11y ago
Shameless self promotion of my work in progress C compiler https://github.com/andrewchambers/cc https://github.com/andrewchambers/cc which is attempting to create a modern cross platform C compiler.
One of my goals is to make the entire toolchain rapid to port and hack on. I am pretty sick of gcc and llvm taking 20 mins just to build from source.
I would love to find serious collaborators.
- beagle3 11y agoI am all in favor of hacking for studying and fun. But for practical reasons - are you familiar with Bellard's tcc?
- andrewchambers 11y agoI am, it is referenced in the readme. Tcc's code is not really so readable in my opinion, which is something I want to address. Tcc also has no desire to become an optimizing compiler in the future. Personally I think 8cc is far superior to tcc in many important ways, but is not as mature as tcc. I love C so considered using 8cc as a base for expansion, but there is a reason llvm and gcc are in C++ and not C. I dislike C++ for many logical and illogical reasons, and think Go is a fair compromise with keeping close to C roots.
- jevinskie 11y agoFrom the README: The code is heavily inspired by https://github.com/rui314/8cc https://github.com/rui314/8cc as well as http://bellard.org/tcc/ http://bellard.org/tcc/. I recommend studying the source code of 8cc before contributing here, as 8cc is currently far more mature.
- rswier 11y agoThe last time I checked, tcc lacked even a simple AST. This led to some pretty weird emitted code (such as swapping parameters on the stack.) Implementing an AST is not hard, just push and pop nodes on a stack. It also makes a nice front-end/back-end interface.
- andrewchambers 11y agoEliminating memory allocations made tcc extremely fast, They use a value stack rather than an AST. I just think an AST is a bit easier to follow because it means the parser has less code generation logic embedded in it.
- rswier 11y agoNo malloc/free necessary. Just pile up nodes on a stack, then "deallocate" to any saved position.
- nightcracker 11y ago> I don't need bug reports unless you are also willing to fix the bug yourself in a pull request or by emailing a diff. That sounds very condescending and off-putting.
- rwallace 11y agoSounded quite straightforward to me. How else would you have preferred him to phrase it?
- andrewchambers 11y agoI can rephrase - bug reports are fine, But I don't need issues which ask why it cant compile xyz yet (Usually the answer is because there aren't enough hours in the day). edit: I have tweaked the readme, don't let it put you off
- martanne 11y agoDid you consider contributing to libfirm[0]/cparser[1] 0: http://pp.ipd.kit.edu/firm/ http://pp.ipd.kit.edu/firm/ 1: https://github.com/MatzeB/cparser https://github.com/MatzeB/cparser
- andrewchambers 11y agoI've looked at libfirm a fair bit. I do think it is interesting. Thanks for the link to the c frontend.