CSCI 1730 · Fall 2026
Code
To aid you in the migration from Plait to Shplait, here are some of the programs from the lectures, rewritten in Shplait. You are welcome (indeed, encouraged!) to download and run these and play along.
A key detail: The tests in these files are deliberately sparse. That is an expository choice, not something you should emulate! Your homeworks are required to have extensive testing. They’re just left out here to reduce clutter (and to avoid doing your homework for you!).
calc.rhm: The smallest possible language: numbers, +, and *. No parser yet. Write abstract syntax trees by hand!
calc-with-parse.rhm: Adds a parse function that turns text of type Syntax into the corresponding syntax tree, so you can write much more convenient programs. Observe that single-quotes create values of type Syntax, which is what parse consumes.
calc-parse-cond.rhm: Adds booleans and if to the language. The result of evaluation now needs its own datatype.
interp-let.rhm: Adds variables and let. Evaluation now needs an environment.
The descriptions above are not substitutes for the lecture/book, nor are they meant to make sense in their absence.