clauf is a work-in-progress C interpreter that is developed live on YouTube: https://www.youtube.com/playlist?list=PLbxut1xyrkCZ-9d_03G0KBU4uh782J1eN
-
Support an interesting subset of C23, until we get bored.
-
Don’t become a production ready C interpreter.
-
Don’t invest a lot of time in generating good error messages; only test happy path.
-
Don’t try and implement an existing C ABI.
-
Do not implement the C preprocessor (for now).
-
Try to turn as much undefined behavior into runtime panics as possible (integer overflow, invalid pointers, …).
- Why is it called clauf?
-
It uses lauf, a bytecode interpreter I’m working on as its backend.
- Why?
-
Two reasons: I wanted to try out livecoding and I needed something to see how usable lauf is.
- Why C?
-
Short answer: It won the twitter poll.
Long answer: C is a relatively small language that I am familiar with. It can be compiled in a single pass, does not require implementation of fancy type inference algorithms, and is low-level enough to really stress lauf’s sandboxing abilities.
- What external libraries are you using?