The quiz will made available online late in the evening of April 17, and must be turned in by 11:59 p.m. America/Los Angeles time, on April 25. You are allowed only 100 minutes to work on it, but you can choose any 100-minute period in the allotted range.
The quiz covers syntax, semantic analysis and optimization, so make sure to review the relevant course notes.
There will be twenty questions, each worth five points. The questions will be a mix of multiple choice, true/false, and short answer. The quiz will be open book, open notes, open internet, but you may not collaborate with anyone else. You can neither solicit answers (from a human or chatbot) nor can you answer anyone else’s questions. You may not discuss the quiz with anyone else until after the deadline has passed.
Here are hints on each of the questions:
- Things that are not context free
- How generics should be treated (or, why they are needed in a statically typed language)
- Inheritance of generics
- Something about a
|>
operator
- Optimization and string literals
- How you might handle the analyze method for a certain operator
- Getting Ohm to parse
x-----x
- Python-style positional args vs kwargs, the syntax
- Something about what Ohm does for an ambiguous grammar
- How to analyze given a requirement that a return statement must appear in a function
- Understanding type checking for an subscript expression, in Swift and Python
- Which Turing machine does a certain thing (multiple-choice)?
- Given a TM, which statements are true about it?
- Given an Ohm grammar, which of these statements are true about it?
- Java and the Billion Dollar Mistake
- What kinds of things should be done in an analyzer to make a certain program work
- Understanding the pieces of a compiler
- Extending Carlos to have more flexible array expressions
- Extending Carlos to have something interesting about types
- Something about how assignment is to be understood
Things to do in preparation:
- Review the course notes
- Review Ohm docs
- Do whichever reinforcement problems that seem to make sense for this class, as well as all of the recall questions at the bottom of the relevant pages of notes.
- Study the Bella and Carlos grammars, and make sure you know what each are saying
- Make a big list of things that are semantic errors (and not syntax errors) in high-level languages you already know (e.g. JavaScript, Swift, Python, C++, Java, etc.)
If you work on the practice problems that sufficiently look like they cover material we’ve discussed in class, you should be fine. I recommend studying in groups with friends. Take over a whiteboard. Bring food. Play some nice background music. Studying should be fun and not stressful. You should learn things together.