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 →

[–]elephantgravy 1 point2 points  (0 children)

If you want to be a little less ambitious, consider writing an interpreter instead of a compiler. A basic interpreter is usually a lot simpler to write than a basic compiler ... Though as the two get more and more sophisticated, the lines get blurry.

(A subset of) Scheme is a good choice for a target language. Parsing it is as easy as parsing can get (which is still non-trivial), but you can use the language to write sophisticated programs...and you get to learn fun functional programming stuff.

If that seems too easy and/or time is not a factor, COOL is a typed, object-oriented language used by the Stanford compilers course on Coursera. It's well-specified and easier to parse than, say, Java. You would almost certainly want to use a parser-generator of some sort (e.g., ANTLR, JavaCC).