Polyglot

A compiler front end framework for
building Java language extensions

download
documentation
mailing lists
developers

Download Polyglot

[Change log]

Polyglot 2.x

[Show all] [Change log]

Polyglot 1.x

[Show all]
  • – 21 Feb 2008
  • Previous versions:
    • – 4 Aug 2006
    • – 1 May 2006 (fixed broken javacup tarball)
    • – 6 Jul 2005
    • – 24 Mar 2005
    • – 30 Jul 2004
    • – April 2004

Documentation

Polyglot is a highly extensible compiler front end for the Java programming language. It is implemented as a Java class framework using design patterns to promote extensibility. Using Polyglot, language extensions can be implemented without duplicating code from the framework itself. Polyglot has been used to implement domain-specific languages, to explore language design ideas, to simplify Java for pedagogical purposes, and for various code transformations such as optimization and fault injection. Polyglot has been used for both major and minor language extensions; our experience suggests that the cost of implementing an extension scales well with the degree to which it modifies Java.

Polyglot compiles and runs on (at least) Linux, Solaris, Windows, and Mac OS X. Ant and the JFlex scanner generator are required to build it. On Windows, you will also need Cygwin.

Polyglot includes PPG, an extensible LALR parser generator based on the CUP LALR parser generator for Java (extended with improved debugging support).

Polyglot supports Java version 1.4, but a Polyglot extension that supports Java 5. has been developed at UCLA.

A version of Polyglot written in the J& language is also under development. It makes extending the base compiler even easier with new features that remove the need for many Polyglot design patterns.

Mailing lists

  • Subscribe to polyglot-announce-l to be notified of new releases of Polyglot and to receive other related announcements. Messages are archived here.
  • Subscribe to polyglot-users-l to participate in discussions about Polyglot and language extensions and to ask and answer questions about Polyglot. The developers will monitor the list: bug reports are welcome; bug fixes are even more welcome. Messages are archived here.

Some Polyglot-based projects

  • Jif – information flow and program transformations for security
  • PolyJ 2.0 – orthogonal parameterized types
  • JMatch – abstract iterable pattern matching for Java
  • Jx/J& –  nested inheritance for extensible, composable frameworks.
  • J0 – a Java for novice programmers
  • Soot – a Java optimization framework (McGill)
  • Jedd – a BDD-based relational extension of Java (McGill)
  • abc – an AspectJ compiler (Oxford, McGill)
  • Java 5 extension – generics, autoboxing, enums, ... (UCLA)
  • JPred – practical predicate dispatch (UCLA)
  • LazyJ  – seamless lazy evaluation in Java (UCLA)
  • X10 –  the experimental concurrent programming language (IBM)
  • XJ –  integrating XML processing into Java (IBM)
  • J-LO – the Java Logical Observer, for runtime verification (Aachen)
  • DJ – adding type-safe higher-order code mobility to Java (Imperial)
  • HydroJ – object-oriented pattern matching for evolvable distributed systems (Washington)
  • AtomJava – a novel approach to atomic blocks (Washington)
  • Classages – interaction-based programming (Johns Hopkins)
  • jCilk – a multi-threaded programming language (MIT)
  • DeepJava – multi-level programming in Java (Victoria University, TU Darmstadt)
  • SJ – session-based distributed programming in Java (Imperial))
A partial family tree:

Credits and acknowledgments

The Polyglot core developers currently include:

Past contributors:

  • Michael Brukman
  • Michael Clarkson
  • Matt Harren
  • Aleksey Kliger
  • Daniel Lee
  • Jed Liu
  • Naveen Sastry
  • Dan Spoonhower
  • Steve Zdancewic
  • Lantian Zheng

The Polyglot project is supervised by Andrew Myers at the Cornell University Computer Science Department.

The development of the Polyglot project has been supported by a number of funding sources, including DARPA Contract F30602-99-1-0533, monitored by USAF Rome Laboratory, ONR Grant N00014-01-1-0968, NSF Grants CNS-0208642, CNS-0430161, and CCF-0133302, an Alfred P. Sloan Research Fellowship, and an Intel Research Ph.D. Fellowship.