Python Front-end to GCC
C Java C++ Ada Go Fortran Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
INSTALL
boehm-gc
config
contrib
fixincludes
gcc
gnattools
include
intl
libada
libatomic
libbacktrace
libcpp
libdecnumber
libffi
libgcc
libgfortran
libgo
libgomp
libgpython
libiberty
libitm
libjava
libmudflap
libobjc
libquadmath
libsanitizer
libssp
libstdc++-v3
lto-plugin
maintainer-scripts
zlib
.gitignore
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog
ChangeLog.tree-ssa
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
README.gcc
README.org
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
depcomp
install-sh
libtool-ldflags
libtool.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
symlink-tree
ylwrap

README.org

Python Front-End to GCC

This is a fully ahead of time implementation of Python, built ontop of GCC for a feature rich, optimizing middle-end and backend.

Building

Building GCCPY is fairly confsing to most people who haven’t built GCC before:

YOU CANNOT build GCC within the same directory of the sources!

$ apt-get install bison flex build-essential

Then to compile:

$ git clone ...
$ cd gccpy
$ ./contrib/download_prerequisites # optional
$ mkdir gccpy-build
$ cd gccpy-build
$ ../configure --prefix=/opt/gccpy \
  --enable-languages=python \
  --disable-multilib \
  --disable-bootstrap
$ make
$ cd -

Usage

For my development sessions i generally pass:

$ gccpy -fdump-tree-gimple -fpy-dump-dot -fpy-gen-main -fpy-optimize -O0 -g test.py -o test

Options:

-fpy-gen-main Python has no explicit main method so we require at compile time for the user to explicitly say where the main method should be compiled in.

-fpy-dump-dot Dumps out the textural output of the DOT IL

-fpy-optimize Experimental optimizers for Python at the DOT IL level constant folding and propagation to some extend with data-flow analysis could be implemented.

-fdump-tree-gimple Dumps the textural output of the code generated for the GCC middle-end.

You can use all normal GCC options -O2 -g -mtune= -march= etc…

Status

Very must still serves as a proof of concept but most of the core principles are implemented and work fairly well

Major Projects

Garbage collector

We need one.

Port Python stdlib

Port the python stdlib and figure out if we want to implement modules as static libraries or shared libraries.

Multi-core

Implement threading