CS-8803-O08 - Compilers - Theory & Practice

Search for a Course:

    Toggle to Select Spcific Semesters

    Reviews


    Semester:

    Take this course if you want to learn how compilers work end to end, and if you have the time to dedicate to it.

    This class is great for breadth and gaining practical experience in how compilers work. A large time portion of the class is spent on the coursework which involves writing a compiler from scratch

    The best part about the coursework is that the problems are ambiguous and don’t just involve execution, this makes it challenging and parallel with real life. Additionally i loved that we get to create the entire compiler from scratch (other than using parser generators on the frontend which is how it’s done in practice) - this gives a full breadth of knowledge on different parts of the compilation process

    Improvements:

    • As other reviews have mentioned the assignments don’t need to be as elongated as they are and involve a lot of hand written manual solutions
    • The exam carries around a third of the overall weighting which is hugely disproportionate to the amount of time spent on the coursework and it’s mostly just a repetition of the assignments it would have been a better approach to drop the exam entirely and give more time to the coursework, for example covering optimisation


    Semester:

    I loved this class. It’s an excuse to implement a bunch of really interesting algorithms.

    Advice:

    • Be completely comfortable coding in whichever language you’re going to use (Java or C++) because the project is thousands of lines of code, written from scratch with no skeleton / starter code. It’s a lot of work, even for those of us who’ve been programming a long time, so you don’t want to be struggling with fundamentals.
    • Write code to answer the homework problems for you. Doing them by hand is way less fun and far more error-prone.
    • Don’t take this unless you’re pretty interested in the topic. To reiterate, it’s a ton of work.

    Complaints: The final is a large part of the grade, there’s no study guide and no previous quizzes or tests to tell you what to expect, and it’s very tough. I didn’t feel like it added anything to the class except stress.


    Semester:

    My main issue with this course is that there is too much mundane and tedious work. I feel like I could’ve learned 80-90% of the material through doing only 50% of the assigned work; in other words, the amount of content learned per hour of work in this course is very low.

    For example, some of the homework and exam questions require running algorithms by hand on programs of substantial size. An analogy would be, imagine in an algorithms course you get a homework question that is run Dijkstra’s by hand, showing each step, for a graph with 50 vertices. Does it help the student learn? Sure. But is it efficient in doing so? No.

    Same goes for the project. I do get that writing a full compiler from beginning to end is cool, but there are parts of the project that were huge time sinks but didn’t teach me much about compilers. One example: having to write dozens of if-statements to account for global vs. local, array vs. scalar, float vs. int and various combinations of these for assign and other instructions in phase 3. I would suggest stripping out some of the complexities that are time-sinks but aren’t that valuable in terms of learning.

    TA’s are very responsive and helpful though.


    Semester:

    DO NOT TAKE

    The amount of time and energy this course requires is orders of magnitude greater than what you will learn, and take away from the course. You might think: “I’m a professional software engineer, it shouldn’t be that bad for me”. Perhaps the concepts will be easier for you, but there is no escaping the work load. It’s like a second job where you don’t get paid, and you have to work nights, weekends, holidays, and especially while you take vacation from your other job.

    Project

    The main problem with this class is the project. I am not even done with the project, and my code base is over 9,000 lines of C++. You have to implement a compiler using C++ or Java, making use of an Antlr4 lexer/parser generator. This Antlr thing was clearly meant for Java developers, as the C++ examples and documentation are very scarce. There are also some bugs in the C++ interface which can trip you up for hours. The compiler you are tasked to create supports the “Tiger” language. It would be nice if the language was more “Toy”. This language is moderately complex in that it supports global statics, local variables, arrays, floats, integers, and integer promotion to float. Plus the usual full suite of operators. This means that there is heavy case analysis in the code. The last disappointing part of the project is the fact that you must generate assembly code in MIPS. MIPS is a dead language, yet I’ve been spending weeks of my life figuring out how it works.

    Homework

    The homework for this class is also very involved, and each one can take a full week of effort (There are 4). They are manually graded, and require drawing up a lot of diagrams. The homework is more reasonable than the project, because it forces you to watch the lectures, and apply the learning at a smaller scale.

    TAs

    The TAs for this class are fantastic. They frequently provide great feedback via Ed discuss, and they grade fairly. The trouble is the TAs cannot debug your 9,000 lines of code for you.


    Semester:

    This was a fun course for me personally and hits a programming bucket list item (write a compiler), so I was very motivated to take this course. It was a big challenge and took a toll on my psyche but I ultimately don’t regret it since I needed some extrinsic motivation to go through with an undertaking like this.

    Pros

    • If you like project-focused classes, this is probably the biggest one - the whole semester you write a compiler in phases (lexing/parsing, semantic analysis/IR codegen, machine codegen).
    • I can’t understate the value of learning how compilers work end-to-end. It really helps turn compilers from magic black boxes to something you can conceivably understand and use to your advantage, as either a compiler writer or someone optimizing code.
    • You can use Java or C++.
    • TAs were very helpful and kind.
    • The homework mostly helped build understanding of some of the concepts needed to implement the compiler.
    • Feedback from the autograder was useful and the grading on the project wasn’t too all-or-nothing.

    Cons

    • Optionally a group project. Be very careful - the overhead of collaboration can hurt you more than it helps you sometimes.
    • There is a certain amount of irreducible complexity and labor associated with writing an entire compiler from scratch, so it always feels like there is just too much work to do a good job on each phase of the compiler.
    • The project is open-ended, but has no supporting boilerplate code. You write everything from scratch, and that burns a lot of time exercising skills that don’t get you a better grade (argument parsing, assembling your build system, etc).
    • Dr. Pande’s grading schemes are kind of brutal. The compiler has a good grading suite but the homework assignments and final exam feel tedious (especially doing live variable analysis by hand on complex programs, that felt downright sadistic after having implemented it in code 3 separate times already).
    • Both the lectures and textbook don’t fully explain concrete strategies for implementing instruction selection, so almost every team failed to do that step completely right. Having at least some material on how to handle mapping from virtual to physical registers in MIPS when you have multiple different register allocation algorithms in play would help, a lot. Even just some prewritten material providing common ways of implementing various constructs in MIPS (loops, function calls, recursion, etc) without stomping on your own registers would have helped.


    Semester:

    This is a light version of compiler course comparing CS6241-A. Because of the time limitation, it does not touch interesting LR parser and other topics in backend. Lecturer is very knowledgeable to compiler world; bad thing is the semester is too short that you can’t learn too much from him.

    The project is also a short version of compiler for Tiger Language. It covers a full cycle of compiler phase from source code to assembly but it doesn’t include loader. ANTLR is used as the compiler framework, instead of LLVM being used at CS6241-A, it’s fine for people who want to learn compiler, but you might want to study LLVM if you really want to work on compiler world in the future. The setting for the project is clear but not optimized. The final project asks to get the least number of machine instruction; which makes students choose some uncommon mechanism to optimize their code.

    Pro:

    1. You get touch on the full cycle of a compiler implementation.
    2. Project is fun and challenged.
    3. If you want, you can explore a lot more on compiler theorem.

    Con:

    1. Semester is too short for people who has no compiler background.
    2. Project could be challenged for the student who has no CS background and don’t know MIPS


    Semester:

    What a great course! The reward is definitely proportional to the workload, as is true with most of the great OMSCS courses. The material is pretty introductory as far as compiler theory goes; you won’t cover any crazy optimizations or more complex language features, but you will master the fundamentals of compilation in theory and practice (or else this course will eat you alive).

    First, the lecture/textbook material:

    • I found the lectures to be very helpful and clear, even despite some minor errata. The course staff are good about providing addenda correcting any errors.
    • The textbook was neat and had a lot of good info in it, but I didn’t find it to be absolutely necessary; most of the exam/homework material relied more heavily on the lectures. Good for background, but I personally didn’t find it vital to read the book.

    The homework and final:

    • The homework assignments took a fair amount of time and thought, and I found that a careful attention to detail was vital for each of them (many of the questions involve stepping through a particular algorithm manually and displaying state at each individual step; I found it necessary to check and recheck my work to make sure no typos led me to the wrong answers). That being said, they were interesting, stayed centered around the core concepts, and were good preparation for the final exam.
    • The final exam was fairly challenging in a vacuum, but I found it to be a decent continuation of the homework assignments. There weren’t many surprises, but I still felt like the exam was a challenge. As long as you really put effort into the homework assignments and keep up with the lecture material, you’ll be in pretty good shape.

    The project(s):

    • The project in this class is super cool. You pretty much start from nothing and build a working compiler.
    • By its very nature, building a compiler is a very complex undertaking, even a toy compiler like this. Starting early on the project phases is mandatory.
    • You have the option to work with a partner, which I recommend, given the amount of work required.
    • Looking at past reviews, it does appear that the project has gotten some reworks. A significant portion of the work is autograded, so you’ll get feedback on how things are running long before the deadline. In addition, the rubric is quite clear and well laid out (no “random” grading that I saw). In addition, the project makes use of some more modern parser generator tools, so you won’t be manually implementing a scanner or parser or anything like that.

    The staff/logistics:

    • Professor Pande and the TAs were all very helpful and responsive. The team behind this course is very knowledgeable and genuinely interested in seeing you succeed.
    • My only gripe with this course has to do with the pacing. I found that the homework and project deadlines didn’t line up very well with the material being covered each week. In some cases I found myself needing to understand a concept or algorithm from a lecture three weeks ahead in the syllabus in order to implement the project in a timely manner. Not sure there’s any way around this, but I found that I needed to really manage my time carefully to account for the gap.

    Overall, I highly recommend this course. I don’t think that my experience lines up with it being “the most difficult course in OMSCS,” and I encourage anybody who’s scared off by its reputation to reconsider and give it a try!


    Semester:

    It’s a tough class with demanding project. I had to take 2 days off work to finish first project on time, but I worked alone without group. I wouldn’t suggest taking this if you don’t have much of programming/CS background. My tips would be to learn as much as possible about graph and graph algorithms, ANTLR4, and MIPS. that way you can have more time to spend actually doing the project and the course will be more enjoyable. Also, learn how to use makefile, I spent stupid amount of time trying to get my project working.

    Pros:

    1. You will learn something that is actually useful.

    Cons:

    1. The project is kind of big, naturally there are many ambiguities and it’s your responsibility to confirm everything in piazza. (if the assignment is more properly described I’d give this course a strong like)


    Semester:

    This is by far the most rewarding course I’ve taken in OMSCS so far. Do not get scared by the other reviews on this page or what people on Reddit say. If you really want to maximize the ROI of the Masters and are not just in it for the diploma, take this course. This felt like a true Master’s/graduate level course that really challenged me and was not just a “check the boxes” kind of course.

    You will essentially build a compiler from scratch in either Java or C++. You will intimately know all the theory and practical details of what makes up a compiler and will really give you a solid foundation as a software engineer. I really noticed this towards the end of the semester when I took a look at the GCC source code and realized that I understood at a high level how the different GCC phases worked. I then looked at LLVM and really understood for the first time why it’s so powerful.

    I also applied these concepts to my day-to-day job as a full time software engineer, where I created a transpiler to help upgrade our code from one JS framework to another automatically. I noticed that this knowledge helps me pick up new programming languages faster because I know what the foundational elements of a language are now. It is also another way to think about solving problems.

    I will agree that it is a large commitment, but the more you invest into it, the more you will get out of it. I did the projects alone (can be done in teams) because I wanted to really understand everything from end-to-end. Attend the office hours to get all your curious questions answered. The book is very helpful and deep dives into what the lectures do not cover.

    Again, this course is not for those who are in it for the easy A or the diploma. This course is for those who are genuinely curious about what happens in the blackbox of compilers and really want to dive under the hood to understand them. This course will not hold your hand, but if you’re really invested and do the readings and work hard on the projects, I promise you’ll come out the other end really understanding compilers, assemblers, transpilers, linters, linkers, finite state machines, ASTs, and much more.


    Semester:

    Good:

    • Very practical. The projects use industry-standard compiler tools and algorithms, so you could easily apply the knowledge gained in this class elsewhere if you needed to.
    • You will (most likely) learn a LOT. It is impossible to make it through this class without deeply understanding the parts of the compiler you’re supposed to implement (lexing, parsing, symbol table generation, semantic analysis, IR generation, register allocation, instruction selection), the abstractions used under the hood (regular languages, context-free languages, parse trees, attribute grammars, control flow graphs, SSA, live ranges, live webs, etc.).
    • The 4 written homeworks were relatively short, but very topical, and struck a good balance between reinforcing the practical things we had to know for the projects and complementing them with the theoretical things we learned in lectures.
    • When you’re done, you’ll be happy you took it (if you were able to make it).

    Bad:

    • The professor is uninvolved, and the TAs run the show. However, at least my semester, the TAs were distinctly unhelpful.
      • Answers on Piazza were vague; project descriptions were underspecified or flat out wrong (this is not an opinion - one of the requirements of the first project was provably impossible, and when I pointed this out to the TAs, they were unable to understand the issue, despite agreeing with me that it was impossible).
      • It turns out that compilers are extremely detailed, and those details are really important; expect to spend a lot of time looking for clarifications that may or may not be provided. We had to just make arbitrary decisions on a lot of issues, and document those decisions in our writeup.
    • The 2 projects are both group projects (3 person teams), and you must have the same group for each project (since project 2 builds on project 1).
      • The only allowed languages are Java and C++. Be very comfortable in at least one of them.
      • The projects are both large enough that you can afford to have 1 slacker, but not 2.
      • The projects are sizable enough (i.e. 10,000+ lines of code) that you will either learn/use good software engineering practices, or fail. Again, your group composition can make or break you.
      • Both projects are “green field” projects, meaning there is no starter code, no push in the right direction. This is a double-edged sword because it forces you to think about the design you want, but it’s definitely less forgiving than it could be.

    Overall, this class wouldn’t be that hard, if it weren’t for the projects (which I hope get reworked). The material is interesting, and it’s useful to be able to imagine the internals of whatever compiler you happen to be using (e.g. for work) so you can structure your code to provoke certain optimizations.


    Semester:

    If you take this course without having taken the undergraduate equivalent, you will be in for a wild ride (i.e. what are you doing here, walk away slowly). Per other descriptions, you will be implementing an entire compiler!

    Pros:

    1. The lectures are very good and don’t cover useless material like other courses (cough, cough, CV).
    2. The projects are useful. You will get an actual compiler at the end of the day.
    3. There’s no hand holding while creating the compiler - you will build everything from the ground up.
    4. The TAs (now gradudated) responded almost instantly on Slack and Piazza.

    Cons:

    1. The HW is graded far too rigorously.
    2. The actual project is haphazardly graded (i.e. they’re not using a rubric so you will get a somewhat random grade).
    3. The project specification is so vague that you will be constantly asking for clarification on Piazza. This was nerve wrecking and frustrating. The lack of professionalisim on behalf of the TAs made this worse.


    Semester:

    PROS:

    1. If you are interested in this material, it is a good class in terms of what is being taught. You will build a compiler from the ground up.
    2. The grading was generous.

    CONS:

    1. You better learn about registers and memory on your own because it is NOT covered in the least. A lot of times is spent on parsing, regex, languages, etc. and zero time is spent on the technical part of a compiler.
    2. As another reviewer said, the course is run mostly by the TAs. When I took it, there was one very vocal TA in that they were active on Piazza and Slack, but their answers were TERRIBLE. When I realized this, I tried phrasing my questions as yes\no or as multiple choice, to try and steer them towards actually answering them, but never did they just give me an answer!
    3. The professor participated in office hours, but had no idea what the current homework was. He would be asked a question and would have to look at the homework as if it was the first time he’s ever seen it. The homework had plenty of typos and ambiguities.
    4. All the answers, from the professor and the TAs were always so laconic. This is an online class based mostly on text. This is a place to answer in full sentence and elaborate, or else what is the function of having a class vs. just having lectures?
    5. The lectures are very general, so not very helpful for the homework and the project.

    This class makes all other classes I’ve taken before and after seem like a dream.


    Semester:

    This is an incredibly difficult class with a very large time commitment. The lectures are dense but helpful for the most part. These lectures gloss over some details which force you to read the book which has moments of utility but is by and large, a jargon-riddled dumpster fire. The book uses some dreamed up syntax to express some of the algorithms which is pretty taxing to understand. The best approach is just to re-write the algorithm in code into you get the results you expect. The homework is very difficult because the questions are vague but expect precise answers. Fortunately, if you head my advice for dealing with the text book, you can use the same approach and produce code to solve your homework. You don’t get credit for the code but it certainly make producing nice LaText and reduces the chance of you transliterating something in your process. If you can explain your approach, you might be able to retain some points but overall, the homework grading is very strict. The coding portion of the project is massive. Absolutely massive. I think it should have been split into at least 3 projects but that may have slowed the class down and there is a lot of ground to cover. I have no complaints about the project grading or what they asked of us. The project document is pretty vague and you have to interpret and justify a lot of your design decisions, just like in real life :)

    The final was not fun and was pretty much like the homework. Treat the homeworks like a practice exam in order to get a feel for the final. The final grading has a decent curve so don’t give up, always submit at least something. The way the assignments are weighted, you can’t afford to skip any single task.


    Semester:

    The first pre-requisite of this course is patience. Lectures are long and intense and the project is also very long, but you get to learn. Homeworks require pen and paper work but are interesting and not as hard as project. Final is said to be consisting of some MCQs and some essay type questions, but what we got are 3 MCQs (worth about 10%) and rest problems. Final is similar to homework problems.

    There are a few logistic issues like you dont have a practice exam or you dont know the cutoffs for grades, but overall it was a decent course. Grading is not that strict, but cutoffs are high (not as high as absolute grading). Being patient and not giving up will be rewarded in this course.


    Semester:

    This was a fantastic course. The lectures, HW, projects were self sustaining and HARD, but you will walk away a much better programmer and have had an opportunity to really apply topics related to computer science. I loved the course topic and organization so much, that I may take it again in Spring or Fall at some point in future.

    The projects require a SOLID understanding of C++ or Java, and if you are not an super start programmer with strong data structure and algorithm skills you will need a VERY STRONG partner. This class is not watered down at all, and partially what made the class so great. If this course is a reflection of the Professors other courses, I plan to take all of them.


    Semester:

    Excellent course: content, organization, staff, and programming assignments. Very interesting to learn how code is compiled, and how compilers optimize the code internally to make it more efficient. The course covers all compilers phases. Lectures are crystal clear. Professor has been very committed to the office hours (weekly), open to different types of question. TA is very prompt, rarely let a day pass with unresolved piazza questions, with clear concise answers.

    Programming projects! Not for the faint of heart. Implemented either in C++ or Java. No starter code. As I understand, the summer version of the projects is a bit different than Fall/Spring which included more compiler phases but with starter code. Be very well prepared with one of those 2 languages. And explore data structures, you’ll need to use lots of sets, vectors, stacks,… etc as well as structs. Projects can be done solo or in teams of 2, but we were strongly advised to work in teams. And having taken the solo option and spent tons of time to keep up with this choice, I recommend you find a team mate unless you’re an experienced programmer.

    There are 2 projects, the first is a front-end project where you implement a simple scanner, and implement a parser generator and an LL(1) parser. The second project was much harder, where you implement 3 methods of register allocation on IR code and convert the code into assembly, and simulate the assembly using SPIM simulator.

    There were 4 HWs, that take a bit of time, pen and paper work, but they were excellent in measuring how well you undrstand the material.

    There’s a final exam, haven’t taken it yet, but it should cover the entire syllabus.

    As I remember Projects: 35%, HW; 35%, final exam: 30%

    Perhaps the only con would be the absence of an auto grader, and being given basic tests to try our code against, you will have to devise your own tests, otherwise risk failures with the grading tests.

    Highly recommended.