r/Compilers • u/Big-Rub9545 • May 15 '26
Compiler implementation language
Currently starting “Writing a C Compiler” by Nora Sandler. I initially wanted to start the project in C, but she herself suggests doing it in another language. Since I like it and she also suggests a language with pattern matching, Rust seems like a very good alternative.
Hoping to get some thoughts on this, particularly from people who’ve gone through this book before.
I like doing projects in C if they need speed and low-level detail (though more often it’s because coding like a caveman is fun), but the repetitive boilerplate, weak generic system and standard library make larger projects a pain to work through.
Rust is much more convenient here, though I’m aware it may get somewhat verbose or constricting for low-level work (at least from my limited experience).
View all comments
Show parent comment
3
u/Hjalfi May 15 '26
C has a much lower barrier of entry, both conceptually and also at runtime --- no garbage collector, for example. It's also got many different implementations meaning you can be sure of finding a compiler for a C program on pretty much any platform you care to mention.
That said, working in a language which has proper data structures does have a lot of appeal. Not that I'm bitter at all after spending too much time working on a pattern-matching code generator for the ACK in C.