5 ms·
I think it's great to look at existing compilers, but probably better to look at past compilers. I stumbled upon the first edition of cc the other day: https://
by xigency 10y ago
I think it's great to look at existing compilers, but probably better to look at past compilers. I stumbled upon the first edition of cc the other day: https://github.com/mortdeus/legacy-cc https://github.com/mortdeus/legacy-cc It's also helpful to look at the overall structure of something like LLVM or to study the internals.
What seems totally useless, though, is to fix bugs! Compiler writing is a very high level field. Fixing bugs on a database server provides equal experience to fixing bugs on a compiler to compiler writing: which is being able to write bug-free code in the given language. So it seems the author is trying to advertise for free labor.
Also, in the first example
Learn regular expressions. This isn’t ... how real compilers work, but regular expressions...
This is a good example of why practical experience isn't as valuable as knowledge, and that's because the class of regular languages are crucial to compiler writing! So yes, that is how they work, especially for parts and passes of tokenization and parsing.
The best advice, which isn't given here, is to read! There are many, many great resources on all of the ins-and-outs of front end, backend, optimization and all the other facets of compiler writing, and there are very few new ideas. Most of the research dates from the 60's and 70's. It's better to be well read on compilers than to have actually written one, depending on the circumstance.
Also, many people always ask for resources on compiler writing, but if you spend even a little time looking for books you will find tons.