CS 440 HW3
In this homework you will be writing an interpreter for the language MiniML. See the language spec, walkthrough video and For HW3, MiniML is dynamically typed, so no type-checking is done, and type errors ( Your code for this homework will go in |
Collaboration
This assignment is to be completed individually, subject to the academic integrity policy on the course website. Make sure you read and understand these. At the end of this assignment, we will ask you to list any students you discussed the homework with, as well as any websites or other resources (please list specific URLs when applicable) you referred to. |
Important notes about grading
Your submissions will be graded automatically for correctness, as well as checked by hand. Please keep our autograder (and Xincheng, who has to run it) happy:
|
MiniML Interpreter (30 points)
Fill in the remaining cases of Recall that you will use the definition |
Testing
Compile and run your code using:
This will open something similar to the OCaml toplevel, which will let you type declarations and will print out the bindings introduced:
You can also use the binary
This will interpret the entire file and print out the value of every top-level binding. We've provided some sample files in the |
Bonus: Recursion using backpatching (5 points)
Backpatching isn't just good for making recursive environments, we can also use it to implement recursive functions. In Hint: When implementing You can test your backpatching code with |
Extra questions
These questions are worth 0 points, but are nevertheless important. Answer these questions in
|
Submission
When you are done with your work, make sure you have compiled your code using When you're finished, use the following commands to submit:
(You only need to add There are no additional files you need to add to the repo, just |