What do you know about Carnegie Mellon?

Carnegie Mellon University: What should a student know before taking 15-411 Compiler Design?

  • I'm planning to take 15-411 Compiler Design in Fall 2012 (Andre Platzer will be teaching, I believe). I don't think any of my friends have taken it, so I don't know what to expect. Can anyone share any advice? What skills will the class stress—15-213 (Introduction to Computer Systems) ones or 15-312 (Principles of Programming Language) ones? Both? Is the work evenly spread throughout the semester or are some parts much more difficult than others? How much work will it be in general? My partner and I intend to try writing our compiler in Scala; is this a good idea? A bad one? Any advice at all would be greatly appreciated.

  • Answer:

    I took Compilers without having taken 312, and generally did fine. (I do wish I'd taken 312 at some point just because I think the topic is fascinating, but it's not essential for Compilers.) I had taken 213, and that's important: you need to be familiar with x86 assembly. Although for me, the most indispensable prereq was 212 -- which I think doesn't exist anymore. Either way, you should use a functional language (see last paragraph) and you should be comfortable with functional programming going in. The class itself is hard work but among the top three most interesting CS courses I took (the others being OS and Graphics). Like most upper-level CS courses, it's in the form of a small number of medium-to-large projects, each building on the previous ones. I don't remember any particularly difficult ones. The syllabus varies between instances of the course, so I don't know what the later projects will be -- in our instance, we had a choice of implementing more optimizations, writing a garbage collector, or retargeting to LLVM bytecode. We chose the retargeting, I think partially because we felt we were both too busy for anything but (what seemed like) the easiest option. In hindsight, this was a bad choice. If you have the same or a similar choice, for the love of God write a garbage collector. GC languages are the way of the future, and GC technology is a hot area of research right now. It's also a fascinating systems problem. As for choice of language, I've never written anything in Scala so I don't know how suitable it is for writing a compiler. My partner and I wrote our compiler in SML, as did everyone else (it wasn't clear that there was even a choice). Languages in the ML family (SML, OCaml being the major ones) are very well-suited to metaprogramming tasks like compiler-writing -- well-suited to almost DSL-like levels. I'd definitely think long and hard before choosing anything else. Do make sure that you're comfortable with Scala's lexer- and parser-generating tools; when I took the class, the staff had done most of the hard work of setting up mllex and mlyacc for us, and we didn't have to worry about it.

Owen Yamauchi at Quora Visit the source

Was this solution helpful to you?

Other answers

You don't really need to take 312; it may provide some interesting background, and help you think better about some of the more theoretical parts of the compiler, but 213 is enough.  I would also say that you absolutely should not take it without 213; a good knowledge of how a computer actually works is required (assembly, registers, calling conventions, etc). The work is spread fairly evenly throughout the semester; each assignment is similarly sized, and they all have the same amount of time, roughly.  It is however, a lot of work; these assignments would be considered, in a normal course, difficult assignments.  If you've taken or heard of OS, it's like doing P2 every two weeks all semester.  Thus, you spend basically all semester working hard but not drowning in it. Scala is a fine language to write it in, as long as you have experience with scala.  Ultimately the most important criteria are 1) do you have experience? 2) is the language stable (i.e. not Rust or some other language still in dev)?, and (less importantly) 3), do they release base code in that language?  If you can answer yes to all three, then it's probably fine.  I did SML, which went well (except when we found bugs in sml NJ's compiler). Basically, 411 is hard, but very interesting.  I learned a lot in it.

Paul Dagnelie

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.