Python Compiler Developers Day Session

This session will discuss tools and strategies for compiling and analyzing Python source code. The goal of this session is to bring together developers with experience in this area to develop a common set of tools for building Python compilers. We will discuss general design issues and formulate a plan for building tools that will be used to develop future versions of Python.

A number of projects require better tools for analyzing Python source code. For example, I hope to settle on an abstract syntax that accommodates changes to the grammar while minimizing effects on the bytecode generator.

The primary emphasis of the session will be on tools written in Python, although I don't expect to replace the compilers written in C and Java that are part of the core distributions. Python-based tools should be easier to understand and modify for experimental purposes.

There are several projects underway that can benefit from community cooperation:

  • The next release of Python will probably contain a typechecker based on optional type declarations. This change will require substantial changes to the parser and development of a type checker. I hope that most of the development work will be done in Python. Alternate type inference proposals could leverage the same tools.
  • Other proposed features for Python, e.g. list comprehensions or iterators, could benefit from a powerful prototyping environment.
  • As part of the CP4E project, we hope to develop a soft type system for Python that uses program analysis to help find bugs. When used with IDLE, the tool will likely perform analysis incrementally.
  • Skip Montanaro proposed a warnings framework on the python-dev list a few months ago.
  • Future Python compilers could include an optimization phase.

The format of this session is not finalized. I expect to provide time for developers working in this area to give short talks to describe their work and suggest areas for collaborative work. Possible topics for talks are: current progress on compiler projects; useful tools for compiler writers; and design issues for a Python compiler. If you are interested in talking, send me email.

Jeremy Hylton
jeremy@cnri.reston.va.us

Related work

Computer Programming for Everybody
http://www.python.org/doc/essays/cp4e.html
Guido's "low-hanging fruit" message on types-sig
http://www.python.org/pipermail/types-sig/1999-December/000654.html
Python-dev thread: 'Catching "return" and "return expr" at compile time'
http://www.python.org/pipermail/python-dev/1999-September/002330.html
(and other messages in same thread)
Py2C
http://lima.mudlib.org/~rassilon/p2c/
SPARK
http://www.csr.uvic.ca/~aycock/python/
Viper
ftp://ftp.cs.usyd.edu.au/jskaller/viper_2_0_a1.tar.gz

If you have other relevant URLs, please mail them to me.