cparser
BCause
cparser | BCause | |
---|---|---|
2 | 2 | |
319 | 45 | |
0.9% | - | |
4.6 | 5.6 | |
6 months ago | 9 months ago | |
C | C | |
GNU General Public License v3.0 only | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cparser
-
Compiling History: A brief tour of C compilers
> QBE is a new optimizing backend much simpler than LLVM; cproc and cparser are two of the C compilers that target it, in addition to its own minic.
I thought cparser targeted libFirm. That's what their GitHub page says [0].
"It acts as a frontend to the libFirm intermediate representation library."
> We really need a production quality open source C compiler that is actually written in C.
I honestly think cproc or cparser are almost there already. For cproc, you just need to improve the quality of code optimization; it's really QBE you'd need to change. For example, you could change unnecessary multiplications by powers of 2 into left shifts, improve instruction selection so that subtraction is always something like "sub rax, rdi" and not "neg rdi / add rax, rdi" [1]).
For cparser, I notice slightly higher quality codegen; libFirm just needs more architecture support (e.g. AMD64 support appears to work for me, but it's labeled as experimental).
[0]: https://github.com/libfirm/cparser
[1]: I'm pretty sure this is the line of code that generates it, too: https://c9x.me/git/qbe.git/tree/amd64/emit.c#n418
- Cparser – A C99 parser (with GNU extensions) (2020)
BCause
-
BCause - a Compiler for the B Programming Language
B is the predecessor of C and was developed by Ken Tompson and Dennis Ritchie at Bell Labs roughly 1969. It is a compiled, at that time high level language intended for the development of system applications. **BCause** is a small single-pass compiler written in under 2000 lines of C99 code. **libb.a** is B's standard library, also implemented in pure C99 and doesn't depend on anything, not even libc. This project is currently only available for `x86_64-linux` platforms. Repository: https://github.com/spydr06/BCause B Users' Reference: https://www.bell-labs.com/usr/dmr/www/kbman.pdf
What are some alternatives?
fart - Brainfuck to 8086 machine instructions
proc - Procedural Intel x86_64 compiler from scratch, inspired by Fortran, Pascal and Assembly.
Arobase - Arobase is a simple programming language with a c-like syntax.
jstar - A lightweight embeddable scripting language
cognate - A human readable quasi-concatenative programming language
metalang99 - Full-blown preprocessor metaprogramming