ICL 2025 - 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 Saturday, June 7, 23:59, via email.
You must submit a tarball containing
- the sources of your compiler;
- a short report;
- possibly other files, e.g. test files of your own.
Important: to gain extra points, 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:
- parsed trees = output of the parser = input of the type checker
- typed trees = output of the type checker = input of the compiler
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
It is wise to split your development into two phases: typing and then
code generation.
- Static Typing
Code to be written in Typing.java or typing.ml.
Test with
bash ./test -2 path-to-your-compiler
(see below)
- Code Generation
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). This is also a
possible source of extra points.
back to the main page