PIL

Stratego -- Strategies for Program Transformation

Platform Independent Language

Intermediate languages are used in compiler construction to simplify retargeting compilers to multiple machine architectures. In the implementation of domain-specific languages (DSLs), compilers typically generate high-level source code, rather than low-level machine instructions. DSL compilers target a software platform, i.e. a programming language with a set of libraries, deployable on one or more operating systems. DSLs enable targeting multiple software platforms if its abstractions are platform independent. While transformations from DSL to each targeted platform are often conceptually very similar, there is little reuse between transformations due to syntactic and API differences of the target platforms, making supporting multiple platforms expensive.

We introduce PIL, a Platform Independent Language, an intermediate language providing a layer of abstraction between DSL and target platform code, abstracting from syntactic and API differences between platforms, thereby removing the need for platform-specific transformations.

PIL is developed by Zef Hemel and Eelco Visser

Back-ends

PIL can translate programs written in PIL to the following platforms:

  • Java 5
  • Python
Other back-ends are planned.

Publications

Download

Builds are available from our buildfarm: http://hydra.nixos.org/jobset/pil/pil-trunk or you can build from source from subversion. For building you need a recent version of Stratego/XT, Java-front and JDK 5+ and Apache Ant.
svn co https://svn.strategoxt.org/repos/StrategoXT/pil/trunk
./bootstrap
./configure --prefix=/usr/local
make
make install

FAQ

  • Can PIL only be used in combination with Stratego/XT? No, PIL can be used as a separate compiler too (using pilc).

For any questions or further information, please e-mail z.hemel@tudelft.nl