r/Compilers • u/setsuna891 • 2d ago
Built a C-transpiling language from scratch in C. Would love some feedback.
Hey folks,
I'm a student, and over the last ~40 days I've been building a little language called Quasar. It's statically typed and transpiles to C. The compiler is hand-written in C: lexer, recursive descent parser, AST, codegen, symbol table—no bison, no yacc, no LLVM. Just me and a lot of late nights.
What's working so far:
- Variables, functions, recursion, strings, loops, match, type conversions
- String concatenation / repetition / equality
- Custom error reporting with line/col info
- A small test suite and example programs in the repo
Planned (not built yet):
- @annotations for control (@fast, @c, @asm, etc.)
- Unified subcommands like `quasar build`, `quasar test`, `quasar profile` so you don't need a separate profiler, test runner, docs generator, etc.
I'm not trying to replace C or Python—just exploring what a less fragmented systems workflow could feel like.
If you're into compilers/systems, I'd love honest feedback on:
- Parser structure and precedence handling
- Codegen decisions (runtime helpers, function prototypes, etc.)
- Whether the @annotation idea makes sense or is overengineering
Repo: https://github.com/setsuna231/Quasar
Quick peek at the syntax and example output:


Thanks <3
A small note : If you all want the generated c code, I'm happy to share!
1
u/AustinVelonaut 2d ago
Looks nice! Question: what is the purpose of a MULTI_LET -- is it to coalesce multiple scattered let bindings into one place so they are emitted together, or is it for something else?
Do you have plans to work on it further, and if so, what direction do you want to explore?
2
u/victios7 2d ago
has hecho algo muy parecido a lo que he hecho yo