Welcome to Pangea Documentation
Pangea (also known as Pang) is a prefix notation (Polish notation) programming language implemented as an interpreter in Lua. It features a unique evaluation mechanism based on recursive descent and supports bilingual keywords (English and Italian).
Quick Facts
- Version: 028 (PanGea:1.0.1)
- Implementation: Lua interpreter
- Notation: Prefix (Polish)
- Languages: English and Italian keywords
- License: MIT
What is Polish Notation?
In Polish (prefix) notation, operators come before their operands:
Standard Infix:
5 + 6 → Result: 11
Polish Prefix (Pangea):
add 5 6 → Result: 11
This notation eliminates the need for parentheses and operator precedence rules. Everything is evaluated left-to-right based on each operator's arity (number of arguments).
Key Features
🔤 Bilingual Support
Write programs in English or Italian:
// English
print add 5 6
// Italian
stampa somma 5 6
🔧 Core Capabilities
- Arithmetic: add, multiply, modulus
- Logic: if, while, equal, greater, not
- Variables: set/get with lexical scoping
- Functions: define_word for user-defined words
- Strings: Multi-word quoted strings
- File includes: Modular program composition
🎯 How It Works
The interpreter operates in three main phases:
Getting Started
Running Pangea
# REPL mode
lua src/pangea1/main.lua
# Execute a file
lua src/pangea1/main.lua tests/fizzbuzz.words
# Italian mode
lua src/pangea1/main.lua italian tests/fizzbuzz.parole
# Execute file then enter REPL
lua src/pangea1/main.lua tests/factorial.words -
Your First Program
hello.words
print " Hello, World! "
print add 40 2
Output:
Hello, World!
42
Learn More
Explore the documentation sections:
- Polish Notation Tutorial - Deep dive into prefix notation
- Evaluation Mechanism - How the interpreter works (with animations!)
- Examples - FizzBuzz, factorial, and more
- Language Reference - Complete list of built-in words
💡 Philosophy
Pangea was designed as an exploration of Polish notation as a programming paradigm. By eliminating infix
operators and parentheses, it creates a consistent, unambiguous syntax where every expression follows
the same pattern: operator arg1 arg2 ... argN