Measures Concepts
GitHub icon

Pizza

Pizza - Programming language

< >

Pizza is a programming language created in 2001.

#595on PLDB 23Years Old

Pizza is an open-source superset of Java 1.4, prior to the introduction of generics for the Java programming language. In addition to its own solution for adding generics to the language, Pizza also added function pointers and algebraic types with case classes and pattern matching. In August 2001, the developers made a compiler capable of working with Java. Read more on Wikipedia...


Example from hello-world:
class HelloWorld { public static void main(String[] args) { System.out.println("Hello World"); } }
Example from Wikipedia:
public final class Main { public int main(String args[]) { System.out.println( new Lines(new DataInputStream(System.in)) .takeWhile(nonEmpty) .map(fun(String s) -> int { return Integer.parseInt(s); }) .reduceLeft(0, fun(int x, int y) -> int { return x + y; })); while(x == 0) { map.create.newInstance() } } }

Language features

Feature Supported Token Example
Strings βœ“ "
"Hello world"
Print() Debugging βœ“ System.out.println
Scientific Notation βœ“
Binary Literals βœ“
// 0[bB][01][01_]*[lL]?
Integers βœ“
// 0|[1-9][0-9_]*[lL]?
Floats βœ“
// ([0-9][0-9_]*\.([0-9][0-9_]*)?|\.[0-9][0-9_]*)([eE][+\-]?[0-9][0-9_]*)?[fFdD]?|[0-9][eE][+\-]?[0-9][0-9_]*[fFdD]?|[0-9]([eE][+\-]?[0-9][0-9_]*)?[fFdD]|0[xX]([0-9a-fA-F][0-9a-fA-F_]*\.?|([0-9a-fA-F][0-9a-fA-F_]*)?\.[0-9a-fA-F][0-9a-fA-F_]*)[pP][+\-]?[0-9][0-9_]*[fFdD]?
Hexadecimals βœ“
// 0[xX][0-9a-fA-F][0-9a-fA-F_]*[lL]?
Octals βœ“
// 0[0-7_]+[lL]?
Conditionals βœ“
Inheritance βœ“
Access Modifiers βœ“
Switch Statements βœ“
Exceptions βœ“
Constants βœ“
Classes βœ“
While Loops βœ“
Booleans βœ“
Case Sensitivity βœ“
MultiLine Comments βœ“
/* A comment
*/
Threads βœ“
Line Comments βœ“
// A comment
Increment and decrement operators βœ“
Module Pattern βœ“
// Package = directory. Java classes can be grouped together in packages. A package name is the same as the directory (folder) name which contains the .java files. You declare packages when you define your Java program, and you name the packages you want to use from other libraries in an import statement.
// The first statement, other than comments, in a Java source file, must be the package declaration.
// Following the optional package declaration, you can have import statements, which allow you to specify classes from other packages that can be referenced without qualifying them with their package.
// This source file must be Drawing.java in the illustration directory.
package illustration;
import java.awt.*;
public class Drawing {
 // ...
}
Zero-based numbering βœ“
Iterators βœ“
Iterator iter = list.iterator();
//Iterator iter = list.iterator();    in J2SE 5.0
while (iter.hasNext()) {
    System.out.print(iter.next());
    if (iter.hasNext())
        System.out.print(", ");
}
Interfaces βœ“
interface MyInterface{  
   /* This is a default method so we need not
    * to implement this method in the implementation 
    * classes  
    */
   default void newMethod(){  
       System.out.println("Newly added default method");  
   }  
   /* Already existing public and abstract method
    * We must need to implement this method in 
    * implementation classes.
    */
   void existingMethod(String str);  
}  
public class Example implements MyInterface{ 
  // implementing abstract method
    public void existingMethod(String str){           
        System.out.println("String is: "+str);  
    }  
    public static void main(String[] args) {  
      Example obj = new Example();
      
      //calling the default method of interface
        obj.newMethod();     
        //calling the abstract method of interface
        obj.existingMethod("Java 8 is easy to learn"); 
  
    }  
}
File Imports βœ“
import javax.swing.*;
import javax.swing.JOptionPane;
// use fully qualified name without import:
javax.swing.JOptionPane.showMessageDialog(null, "Hi");
// There are 166 packages containing 3279 classes and interfaces in Java 5.
// import java.io.*; Input-output classes.
Garbage Collection βœ“
Constructors βœ“
Comments βœ“
Single Dispatch βœ“
Generics βœ“
List v = new ArrayList();
v.add("test");
Integer i = v.get(0); // (type error)  compilation-time error
Assert Statements βœ“
// By default, assertions are disabled
// java –enableassertions Test
int score = 10;
assert score >= 10 : " Below";
System.out.println("score is "+score);
Case Insensitive Identifiers X
Semantic Indentation X
Operator Overloading X
Macros X
Pointers X
Variable Substitution Syntax X
S-Expressions X

View source

- Build the next great programming language Β· Search Β· Add Language Β· Features Β· Creators Β· Resources Β· About Β· Blog Β· Acknowledgements Β· Queries Β· Stats Β· Sponsor Β· Day 605 Β· feedback@pldb.io Β· Logout