Hi,
How could one write the simplest C compiler possible. Like the one that
came in Unix V7? I guess some knowledge of binutils development would would
be needed right?
There exist lots of nice candidates. I myself have collected over the years, over 250 small compiler projects.
Some suggestions (just the first ones coming in mind):
- nwcc by Nils Weller
- pcc (revamped)
- the compiler projects at ftp://compilers.iecc.com
- plan9 compilers
- subc by Nils Holm (t3x.org)
- Lennart Augustsson's obfuscated compiler to ELF for x86 (otcc)
- smallc compilers (not ANSI/ISO C per se)
- tcc
There are many, many more, with varying level of ANSI/ISO C (89) support.
For a production-level compiler, I have three suggestions:
1) GCC
2) LLVM
3) COINS (search for COINS compiler infrastructure)
GCC and LLVM are the dominant open-source compilers. The latter one in the list is a real neglected jewel.
Best regards
Nikolaos Kavvadias