swisd/Micro-C ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Rust compiler for a tiny C like language that can target a few back ends, mainly x86_64, and also have support for Windows x64, ARM64, and a custom system target. I want it to feel lightweight and understandable, with minimal dependencies so it can work in no_std style environments too.

It should let me write simple functions, local variables, if, else, elif, loops, basic math, structs if possible, plus pointer style memory access and extern functions. Please make it compile source into assembly through a clear pipeline, first lexing and parsing, then a simple IR, then target specific code generation with basic register allocation.

I’d also like a small example program, decent error messages, and a way to call the compiler from Rust code. If anything is unclear, look up current docs online if you need to, but keep the project focused and minimal.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab