VoltLang / Volta

Compiler for the Volt Programming Language
153 stars 8 forks source link

Where to learn how to make a compiler? #5

Closed phase closed 9 years ago

phase commented 9 years ago

It might be a dumb question, but I've always wanted to learn how to make a compiler. I know I won't be able to make it in a week, but it'd be a fun project to do over the summer or something.

Dav1dde commented 9 years ago

This is a great question, but the wrong place to ask it. Feel free to join us at chat.freenode.net#volt

bhelyer commented 9 years ago

Yes, maybe not the best use of an issue, but now that it's here, I may as well answer it. Please do feel free to join us on IRC, as David said.

This is the book that everyone recommends: http://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811 Personally, I found it dense and meandering, and just not compelling. You might be different, so give it a look.

This is a fun little guide which I found fairly easy to follow, even though I wasn't using Pascal, or directly generating x86 assembly. http://www.compilers.iecc.com/crenshaw/

There's also some useful information here: http://programmers.stackexchange.com/questions/165543/how-to-write-a-very-basic-compiler

A lot of it will come down to writing a compiler, figuring out what you did wrong, rewriting, repeat. So don't start with a giant language, start with something simple. Hope this helps!

deadalnix commented 9 years ago

https://fr.coursera.org/course/compilers

For the theorical baggage, if video is preferred.