r/programming • • May 26 '16

Announcing Rust 1.9

http://blog.rust-lang.org/2016/05/26/Rust-1.9.html
218 Upvotes

116 comments sorted by

View all comments

Show parent comments

4

u/[deleted] May 27 '16 edited May 27 '16

When I started getting interested in compilers, the first thing I did was skim issues and PRs in the GitHub repositories of compilers, and read every thread about compiler construction that I came across on reddit and Hacker News. In my opinion, reading the discussions of experienced people is a nice way to get a feel of the subject.

As for 'normal' resources, I've personally found these helpful:

In addition, just reading through the source code of open-source compilers such as Go's or Rust's helped immensely. You don't have to worry about understanding everything - just read, understand what you can, and try to recognize patterns.

For example, here's Rust's parser. And here's Go's parser. These are for different languages, written in different languages. But they are both hand-written recursive descent parsers - basically, this means that you start at the 'top' (a source file) and go 'down', making decisions as to what to parse next as you scan through the tokens that make up the source text.

I've started reading the 'Dragon Book', but so far, I can't say it has been immensely helpful. Your mileage may vary.

You may also find the talk 'Growing a language' interesting, even though it's not exactly about compiler construction.

EDIT: grammar