Exploring the c4... compiler? (registerspill.thorstenball.com)
from tedu to programming on 10 May 22:14
https://azorius.net/g/programming/p/1r3vm7hYdRQJ1MB874-Exploring-the-c4-compiler

This week I found myself digging through the code of c4, an implementation of C “in four functions”, by Robert Swierczek.

I remember coming across c4 when it was released ten years ago. It got me excited: hey, C in four functions, that means it’s easy to understand right?

That excitement turned into “oh, I see” as soon as I scrolled through the code. c4 is dense, barely commented, and, frankly, strange. It’s unlike anything else I had come across in compiler land.

After reading through the code this week here are the other adjectives I would add to the list: clever, tricky, fascinating, cool. It’s a compiler, it’s a VM, it’s an interpreter, it’s a parser, it’s art, it’s trickshot programming.

#c #compiler #programming

threaded - newest

will_r_s_hansen@mastodon.online on 10 May 22:42 collapse

@tedu

Classic mistake: you went to the evil C4 instead of the good C4 (to say nothing of the explosive C4).

The good C4: https://c4model.com/