rui314/chibicc ? reverse-engineered prompt
Reverse engineered prompt
I want to build a small C compiler, written in C. The main goal here is for learning, so the code should be really simple and easy to understand, much like the chibicc project. It needs to support most of the C11 standard—enough that it's not just a toy and can actually compile some real-world programs.
Let's structure it in the classic stages. It should have a tokenizer, a preprocessor for handling macros, a recursive descent parser to build abstract syntax trees and add type information, and finally a code generator that emits x86-64 assembly. Don't worry about performance or optimization; the priority is clear, readable code. It's more important that I can follow how each feature is implemented. Let's include a basic Makefile to build the whole thing.
Are you gonna build this?
make sure you review the code using coderabbit