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 Compiler FAQ

 

 

 

Is the Pizza compiler a preprocessor
or a full-blown compiler?

  Both. The Pizza compiler generates byte-codes directly, without invoking another compiler. It can also be used as a preprocessor by setting the source output option -s.

How does the performance of the Pizza compiler compare to that of javac? How does the generated code compare?

  The last time we measured (using Solaris 5.5 and Win95 with the Borland JIT compiler), Pizza was about twice as fast as javac at compiling large Java programs. For small programs, where compiler start-up time dominates all other costs, the difference is negligible. However, if you use the resident compiler in PizzaExpress, small programs will be compiled much more quickly. Numbers can vary between different versions of the Pizza compiler and javac.

In terms of the speed of the generated bytecode, Pizza is somewhat less efficient than Java's output, in particular when javac compiles with optimization on. How much depends on the kind of program and the virtual machine it runs on. The slowdown should be often around zero, but can in extreme cases be around 20%. Any slowdown can be eliminated by compiling with source output option -s and recompiling the emitted Java sources with javac. We are currently working on a bytecode optimizer to improve the quality of generated code.

Are sources for the compiler available?   Yes, the Pizza Compiler is distributed under the Artistic License.

The Pizza compiler does not seem
to automatically compile auxiliary
classes, like javac does.

  That's right. Unlike javac, the Pizza compiler will not compile auxiliary classes automatically. You must explicitly indicate all of the source files to be compiled. If there are cyclic dependencies, you must compile all of the source files together.

Does Pizza run with JIT compilers?

  In general, yes, since the Pizza compiler generates standard JVM code. However Pizza does reveal bugs in some JIT compilers, which fail to produce code for Pizza classes!