News for hackers. Stuff that matters.
Re:Tiny-C Compiler by bullen on Monday March 13, 2023 @06:35PM (#35144056)
I wish I had time to make a list what would be required to bootstrap this.

Either by adding complexity (more features to the compiler) or dropping complexity (fewer C features in the implementation).

Did you ever look at that?

Re:Tiny-C Compiler by feeley on Monday March 13, 2023 @07:30PM (#35144780)
Haven't looked at what it would take to support C89 (or other) fully. Certainly it is possible to extend the compiler in small increments to implement more stuff: all the operators, local variables, arrays, pointers, functions, etc. The hardest part I would say is implementing types (starting with the C syntax for types!) and also handling the memory allocation for them. Nothing too complex when you know what you are doing. My personal interest is with higher-level languages and I have worked on various Scheme systems over the last 30 years. If you like small language implementations then take a look at Ribbit which is feature-full with a tiny VM. Also check out sectorlisp (not my work) which is a fascinating tour de force.