View unanswered posts | View active topics It is currently Sun Sep 22, 2019 1:03 pm

Reply to topic  [ 5 posts ] 
 Some C compilers 
Author Message

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1257
(well, the air turned blue there for a while as I lost a previous draft of this...)

Over on stardot, davidb just found an upcoming presentation for a C compiler project, and that led me to an interesting writeup about another project, and I thought it might be good to have some collected links to C compiler projects, inevitably in various states of progress.

First then, Rui Ueyama's interesting story of building a C compiler over 40 days. Even an experienced C programmer might find the language is more complicated than they thought.

Second, I should mention two existing threads here:
- C64 Compiler by Rob, a more-than-C compiler targeting several cores, including FT64 and OPC6
- Ide68k C compiler an IDE found by Dajgoro

And now, here are some links to repositories:
- bbc-c "C compiler for the BBC Micro series of micros" mentioned above (written in python)
- 8cc, the 40-day compiler mentioned above.
- LCC: A Retargetable C Compiler: Design and Implementation
- TCC: Tiny C Compiler by Francis Bellard
- cc65 of course, for the 6502
- Puppeh's gcc-6502 work in progress (and support tools including a libc)
- bcompiler, bootstrapping "a tiny compiler for a toy programming language somewhat reminiscent of C and Forth"
- C in four functions as an educational demonstration (good discussion here.)
- legacy cc - "earliest versions of the very first c compiler"
- selfie, an "educational software system of a tiny self-compiling C compiler, a tiny self-executing MIPS emulator, and a tiny self-hosting MIPS hypervisor."

Once upon a time, there was going to be a huge space-trading-exploration online multiuser game which would involve programming the ship's computer. The architecture was called DCPU-16 and was a bit similar to a 6502. Several people started working on compilers for this architecture - their work might be interesting as starting points.
- dcpu16 target for LLVM (my fork of a vanished project)
- LLVM backend for dcpu-16 processor - a spiritual successor to the above
- DCPUB, "a language similar to B"
- TenC, "A high-level, C-like language for the DCPU-16"
- py-dcpu-c-compiler C to DCPU-16 compiler written in python.
- DCPU-TCC "Super Awesome DCPU C Compiler based on TCC"
- d16cc "A C compiler for notch's DCPU16"
- 0x10c-Compiler "Effort to create a compiler for 0x10c"

Thu Aug 31, 2017 10:34 am

Joined: Thu Aug 24, 2017 8:52 pm
Posts: 4

Here is another C compiler that might belong on your list: or


Tue Sep 05, 2017 8:41 pm

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1257
Thanks Xark - that looks pretty interesting, as it targets x86, MIPS or trillek RISC, and is self-hosting.

Tue Sep 05, 2017 8:43 pm

Joined: Thu Aug 24, 2017 8:52 pm
Posts: 4
You are very welcome. I will also mention that a friend of mine Valentin ported this compiler to his custom Sweet32 FPGA CPU (RISC-ish). It worked quite well. Code (for VHDL CPU and compiler port) are at


Wed Sep 06, 2017 4:10 am

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1257

Wed Sep 06, 2017 7:52 am
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software