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 examples




Quicksort   Quicksort is a well-known sorting algorithm, first described by Hoare. The algorithm is very efficient in the average case, and is quite frequently used. This problem is a good example because the details of the algorithm are almost universally taught in computer science education, because the implementation is large enough to be interesting without drowning us in details, and (of course!) because the new features of Pizza improve the possible codings of the algorithm in a number of ways.
Enumerator   This problem shows how Pizza's first-class functions and parametric polymorphism help code reuse.