The Pizza Compiler

The Pizza language is an extension to Java with three new features:
- Generics (aka Parametric polymorphism)
- Function pointers (aka First-class functions)
- Class cases and pattern matching (aka Algebraic types)

Pizza FAQ

 

 

 

Basic questions

  • Is Pizza fully compatible with Java? Are there Java programs which Pizza does not accept?
  • Can Pizza binaries be used as applets?
  • Where can I get a reference to Pizza's extensions of Java?
  • Where is Pizza heading? Does Sun know about/support the Pizza project?

    Installation and Troubleshooting

  • The pizza compiler doesn't run. Help!
  • When I try to run Pizza I get ``Can't find class pizza/compiler/Main''
  • I can compile a class, but when I try to run it I get ``Can't find mypackage.MyClass''
  • How can I install Pizza on OS/2,the Macintosh OS, Windows 3.11, etc.?

    The Pizza language

  • How can I define a named first-class function?
  • Would it be possible to make the case-classes into fully functional inner classes, with different initializers and so forth?
  • "private protected" does not work.

    Compiler and compatibility issues

  • Is the Pizza compiler a preprocessor or a full-blown compiler?
  • How does the performance of the Pizza compiler compare to that of javac? How does the generated code compare?
  • Are sources for the compiler available?
  • The Pizza compiler does not seem to automatically compile auxiliary classes, like javac does.
  • Does pizza run with JIT compilers (e.g. Kaffe)?

    Pizza and Java

  • How can I generate Java code as the output of the compiler, rather than class files?
  • Using the Java reflection API, I can find the names, types and values of object fields at runtime. What happens when the fields have function types or other Pizza types?
  • I'd like to use Pizza to generate abstract syntax trees (AST's) for Java programs. Is there a compiler switch that will output AST's? If not, how can I access the them?
  • When I compile my pizza-code into Java, I see several lines of the type throw new Error(); // inserted for safety. What kind of error do they indicate?

    Other questions

  • Why did you choose the name Pizza?
  • What are current developments and future plans for Pizza and GJ?
    Answers by Martin Odersky, Christian Kemper, Enno Runne and John Maraist.