Brussels / 3 & 4 February 2018

schedule

Introduction into the ppci project


Ppci is a compiler written entirely in Python. This allows for easy compiler development, portability and installation. The compiler is able to process C code into WASM, WASM into xtensa code, but there are more possible code paths. During this session a demo will be shown on how to compile some webassembly to the riscv platform.

The ppci project was started by the need for a better system level programming language then C. The compiler is implemented in python, and hence is not very fast. On the other hand, the compiler is portable and is easier to develop due to being implemented into a higher level language. Currently it supports msp430, x86, xtensa, avr, arm, open risc and stm8 computer architectures, in various levels of maturity. The supported languages are C3 and brainfuck. Language support for C is a work in progress.

The C3 language was the starting point for the compiler, aiming at being a better version of C. It has no header files, but features a more modular approach like C# and java. Furthermore its syntax is context free, making it easier to parse using standard compiler tools.

The backend of the compiler consists of a code generator featuring both instruction selection and register coloring algorithms. The output of the compiler is an instruction stream, which can be serialized as text or in binary form.

Possible uses of this library are:

Compile code and include it into the currently running python instance
Create ctypes bindings for C code by making use of the C parser frontend
Create a programming language using ply/textx and generate machine code from it using ppci

During this session, we will explore the various parts of the ppci library and have a good overview what it is capable of.

Speakers

Windel Bouwman

Attachments

Links