Interpreters

Write an interpreter for a fragment of the Python programming language in the style of the Tolk Racket interpreter that we covered in class.

You may use the Python parser and any other tools provided with the Tolk repo.

In class we will cover, step by step, how to interpret various language features of the Racket language. You should make a Lisp package for your Python interpreter and write an interpret function which operates on the Python AST and behaves similarly to the Racket interpret function. You should also include tests in a similar way. Your Python interpreter should at least be able to interpret all expressions that the Python parser can parse.

You can find full information about the fragment of the Python language that Tolk parses in Tolk Python Language Fragment as well as a detailed description of the AST it outputs in Tolk Python AST.

Also helpful may be The Official Python Language Reference

Author: Breanndán Ó Nualláin <o@uva.nl>

Date: 2026-05-07 Thu 09:14