Analysis of separate compilation techniques for a subset of Python

Bachelorarbeit

Python, first released in 1991, is one of the emerging programming languages of this decade. It supports multiple programming paradigms, features a dynamic type system, automated garbage collection and dynamic name resolution. Its general concept of modules and object-oriented ideas is based on Modula-3.

Besides the canonical implementation of the whole Python environment (interpreter, libraries etc.) in C, there has been a project called PyPy that offers an implementation of the Python environment in the language Python itself. Furthermore, the translator that was developed in the PyPy project is able to translate the Python interpreter etc. into different languages and onto various platforms like C or JVM bytecode. The result is an interpreter that behaves like the canonical interpreter. Note that this translation process accepts a subset of Python (called RPython) as the input language and is generic allowing the translation of any program written in this subset.

Currently, the translator works like a whole program compiler freezing the target program like it was found at translation time. This makes it impossible to e.g. extend the program at runtime with additional separately compiled functions or classes originally written in RPython.

This bachelor thesis will explore the possibility of the introduction of a separate compilation feature into the aforementioned translation process. If the user has defined the interface of the various modules he wants to compile, the translation could be started for every of these. These modules could be bound at runtime to offer access to the classes and functions of each other.

This feature would be the foundation for the ability to load separately compiled modules on the level of the target program which is the Python interpreter in this case. So the goal needs to be solved on two levels. On the one hand, the translator needs support for generating modules that can be linked against other modules generated by this new facility. On the other hand, the Python interpreter needs to be extended to use this feature and define an interface that can be used to write modules that link against this interface.

Bearbeiter: Alexander Schremmer

Ausarbeitung: Analysis of separate compilation techniques for a subset of Python

Betreuer: Peter Pfahler

Impressum | Datenschutzerklärung | Webmaster | Letzte Änderungen am : 16.10.2013