Gccpy - GCC Python Front-end

Philip Herron

Abstract

Gccpy is a Python front-end to gcc from my last years GSOC (2010), I was mentored by Ian Lance Taylor who continues to be a great inspiration to me with his work on gccgo and his help on gcc-help to the community of users and developers.

Additional Information

An overview of what the project aims to achieve is creating an AOT compiled version of Python using GCC as a framework for middle-end, back-end optimization as-well as portable code-generation. Creating AOT languages has been generally aimed for more 'low-level' languages such as C/C++/Fortran where the language requires strong typing and other kinds declarative features; which gives rise to much less dynamic features which languages like Python/PHP/Perl take for granted. The reason these more 'high-level' languages are able to do such things is due to the fact they are generally implemented as interpreted languages and this allows for much of this dynamic logic to take place at runtime when a program is passed through their respective interpreters. But gccpy tackles this by generating code which allows for and efficient runtime as well as the dynamic features required.


Personally I feel this is a very strong and important style of implementing dynamic languages; which needs to be shown and proven to be an effective and strong way of implementing new and up-coming languages and why GCC is the right platform to do so.

Code samples