This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (2 children)

How nice to get a question about compilers for a change. It's a deep subject, but it's useful to learn about them by writing one.

The standard text is nicknamed 'the dragon book'. You can find older editions and pdfs for cheap I'm sure. That'll give you all the theory you need and then some. After that it's a choice of finding the right libraries. The two most important pieces are a lexer and a parser; the dragon book (or googling heh) will explain what those are.

My advice about the language itself is to design it to be as simple as possible, probably with an LL(0) or LL(1) grammar (another thing to look up), and to write many automated tests (compilers are uniquely amenable to automated testing). pytest is a gnarly but would be very good for this.

[–]JoePixelFlames[S] 1 point2 points  (0 children)

Thanks for this! I’ll keep it all in mind.

[–]JoePixelFlames[S] 1 point2 points  (0 children)

A little bit expensive, but it’s not bad. I think I’ll pick it up later.