[Coco] C compiler self-hosting on NitrOS9 again!

Jeff Teunissen deek at d2dc.net
Sun May 3 23:36:11 EDT 2020


Some of you know I've been hacking on the "C3" compiler that's been
bouncing around, and anyone else who's played with it knows that it
doesn't really work right.

Well, it does now. :)

In the "CoCo C" repository on GitHub is a K&R C preprocessor and
compiler that can be built (in a multi-stage process requiring the old
Tandy compiler to start from), that is also capable of compiling its
own code, so we can produce a new version of the compiler by using its
own code.

The code it produces is slightly more efficient than that produced by
the Tandy compiler, so as far as I can tell will almost always produce
smaller binaries.

Note: the code _also_ compiles on modern x86 systems, but the
resulting binaries don't produce working code -- there are endianness
problems that need tracking down before it will be a good
cross-compiler. If anyone locates the code that's producing the
errors, let me know. :)

It's available at <https://github.com/Deek/CoCoC>.


More information about the Coco mailing list