All languages

Pi languagedormant

Pattern language from TUD Darmstadt whose only construct is the pattern: an EBNF production with an associated meaning, so syntax and semantics extend together from inside the language. Presented at OOPSLA/Onward! '09; never released beyond an alpha-stage Java interpreter.

Overview

Pi is a pattern-oriented programming language whose only construct is the pattern — an EBNF production paired with an associated meaning. Roman Knöll and Mira Mezini built it at TUD Darmstadt to show that a language can extend its own syntax and semantics without a meta-language, making it a testbed for domain-specific languages.

Code

// a pattern declares syntax (≔), type (⇒) and meaning (➞).
declare_pattern integer_potentiation ≔
  integer:i %W- "^" %W- integer:j ⇒ integer ➞
  { int result = i;
    for (int k = 1; k <= j-1; k++) result *= i;
    return result; };

// the new symbol is usable immediately.
print (174^3);
One tab per tour slot — a pattern declares syntax, type and meaning in one line, so the declared symbol is usable immediately; slots compose EBNF productions into a DSL; meanings may be functional or imperative; and reflection lets a program evaluate its own patterns at runtime.

Distinctive traits

  • One construct: a pattern is an EBNF production plus a meaning — syntax and semantics are inseparable.
  • Self-extending: new syntax is declared in the language itself, so no separate macro layer is needed.
  • Explicit types on patterns: a pattern's type states where its symbols may appear, checked dynamically.
  • Reflection completeness: instructions, parse trees and the interpreter itself are reachable as patterns.
  • Libraries are languages: every pattern carries syntax, so extending pi equals designing a DSL.
  • Post-paradigmatic: the core pattern set is a proposal, not fixed syntax — even predefined patterns can be redeclared.

Status

Never left alpha. Version 0.8 shipped as a Java 6 interpreter (pi.jar, class de.tu_darmstadt.informatik.st.pegasus.pi.PiConsole) under CC BY-NC-SA 3.0, with the extended Earley parser disabled and reflection-completeness incomplete; the site shows no activity after 2011.

History

Born from the Pegasus Project at TU Darmstadt, where pegasus_f needed patterns for naturalistic programming. Knöll and Mezini presented pi at OOPSLA/Onward! '09 in Orlando; version 0.8 followed in January 2010.

Sources & references