Polyglot extensible compiler framework (original) (raw)
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 supports Java 1.4, Java 5, and Java 7, including features such as generics and annotations. Key features of Java 8 are also supported: notably, lambdas. Support for Java 5, 7, and 8 is provided as Polyglot extensions, but other Polyglot extensions can build on any version of the language, and can generate any version of Java as output.
Polyglot includes PPG, an extensible LALR parser generator based on the CUP LALR parser generator for Java (extended with improved debugging support). The Accrue analysis framework (from Harvard) extends Polyglot with interprocedural, object-sensitive program analysis.
Some Polyglot-based projects
- Jif – information flow and program transformations for security
- 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)
- X10 – the concurrent programming language (IBM)
- Jedd – a BDD-based relational extension of Java (McGill)
- abc – an AspectJ compiler (Oxford, McGill)
- JPred – practical predicate dispatch (UCLA)
- LazyJ – seamless lazy evaluation in Java (UCLA)
- 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 (U Washington)
- AtomJava – a novel approach to atomic blocks (U Washington)
- Classages – interaction-based programming (Johns Hopkins)
- jCilk – a multi-threaded programming language (MIT)
- DeepJava – multi-level programming in Java (Victoria University, TU Darmstadt)
- SessionJ – session-based distributed programming in Java (Imperial)
- IMP – Eclipse IDE Meta-tooling Platform (Eclipse, IBM TJ Watson Hawthorne)
- JCoBox – generalizing active objects to concurrent cooperative tasks (TU Kaiserslautern)
News
- Polyglot 2.8.0 was released (6 January 2022). Now supported: lambdas!
- An LLVM back end for Polyglot exists and now supports concurrency (June 2020).
- Polyglot now hasan Eclipse IDE that can be extended to support Polyglot extensions.
- Polyglot is now hosted on GitHub at https://github.com/polyglot-compiler/polyglot
Download Polyglot
Polyglot 2.x
[Show all]
- – 6 January 2022
- – 23 June 2016
- – 1 August 2015
- Previous versions:
- – 10 June 2014
- – 4 June 2014
- – 21 Jun 2013
- – 25 Apr 2013
- – 15 Oct 2012
- – 10 Aug 2012
- – 14 Aug 2008 (Eclipse plugin)
- – 5 Oct 2007 (Eclipse plugin)
- – 27 Jul 2007 (Eclipse plugin)
- – 5 Jun 2007 (Eclipse plugin)
- – 11 May 2007 (Eclipse plugin)
- – 23 Feb 2007 (Eclipse plugin)
- – 8 Feb 2007 (Eclipse plugin)
- – 8 Jan 2007 (Eclipse plugin)
- – 22 Dec 2006 (Eclipse plugin)
- – 8 Dec 2006 (Eclipse plugin)
- – 7 Jun 2006
- – 2 Feb 2006
- – 25 Nov 2005
- – 31 Aug 2005
- – 6 Jul 2005
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 compatibility with Java 1.4
- Polyglot Tutorial (PLDI 2014)(see also these notes)
- Older tutorials: How to Use Polyglot, Introduction to Polyglot with SwapJ
- Polyglot: An Extensible Compiler Framework for Java. Proc. 12th International Conference on Compiler Construction, Warsaw, Poland, April 2003. LNCS 2622, pp. 138–152. Nathaniel Nystrom, Michael R. Clarkson, Andrew C. Myers.
- Polyglot Technical Report (PDF)
- Polyglot 2 API (2.6.x)
- Polyglot 1 API (1.3.x)
- Slides from the CC'03 talk (PDF)
Mailing lists
Subscribe to polyglot-users-l@cornell.edu to be notified of new releases of Polyglot, to participate in discussions about Polyglot and to ask and answer questions about Polyglot. The developers do monitor the list: bug reports are welcome; bug fixes are even more welcome. To subscribe, send mail to polyglot-users-l-request@cornell.eduwith a subject line of join, or use the form on the right.
Many other people have contributed to Polyglot, including but not limited to:
Owen Arden Michael Brukman Michael Clarkson Matt Harren Chinawat Isradisaikul Rob Jellinek Aleksey Kliger Daniel Lee Samarth Lad Jed Liu | Todd Millstein Xin Qi Naveen Sastry Dan Spoonhower Milan Stanojevic Steve Zdancewic Lantian Zheng Xin Zheng Sam Zhou |
---|
Development of Polyglot has been supported by several 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.