INF564 - Project - Mini Python

The goal is to build a compiler for a tiny fragment of the Python language, called Mini Python, to x86-64 assembly.

All the details are given in the project statement.

The project is due Sunday March 17, 6pm, via Moodle. You must submit an tarball containing

Important: the project must include an extension of your choice (see the last section of the project statement).

Code supplied

The parser and the abstract syntax are provided. You don't have to read and understand the parser, but you have to read and understand the abstract syntax trees (respectively in Syntax.java and ast.ml). They are two kinds of syntax trees:

Note for Java: a shell script minipython is provided to run your compiler from the command line (useful when testing your compiler; see below).

Roadmap

  1. (labs 4-5) Static Typing

    This is described in section 2.
    Code to be written in Typing.java or typing.ml.
    Test with

    bash ./test -2 path-to-your-compiler
    (see below)

  2. (labs 6-7-8-9) Code Generation

    This is described in sections 3 and 4.
    Code to be written in Compile.java or compile.ml.
    A class/module X86_64 is provided, to build and then print x86-64 assembly code.
    Test with

    bash ./test -3 path-to-your-compiler
    (see below)

Test Files

Test files are provided, together with a bash script to test your compiler: Feel free to add more test files of your own (and if so, do include them in the tarball when you submit your project on Moodle).
back to the main page