# Mathematical Programming Language (MPL) ๐
**Breaking the last language barrier in technology**




**โ child โ world : canCode(child)**
[๐ For Educators](#for-educators) | [๐ป For Developers](#for-developers) | [๐ For Humanity](#for-humanity)
---
## ๐จ Project Status: Proof of Concept
**The M0 core runs โ with ratified semantics.** This repository contains the grammar, the parser, and the browser interpreter (`js/mpl.js`) that runs the M0 core today at [mpl.codes](https://mpl.codes). Its semantics are not folklore: every judgment call is recorded and ruled in [conformance/JUDGMENT_CALLS.md](conformance/JUDGMENT_CALLS.md), pinned by **89 ratified conformance tests** that gate CI, and a differential fuzzer holds the interpreter and the grammar to zero divergence. A native runtime beyond the browser core does not exist yet โ building it is the next milestone, and contributors are welcome.
### What Works Today โ
Every item below is enforced by [CI](.github/workflows/ci.yml) on every push:
- An ANTLR 4 grammar built from mathematical symbols that compiles with zero errors and zero warnings (warnings are treated as errors)
- All 10 [example programs](examples/) parse (`./gradlew parseExamples`)
- A test suite covering the lexer, the parser, the examples, and every ```` ```mpl ```` code block in this README (`./gradlew test`)
- An ASCII escape sequence for every Unicode symbol ([glyph-escapes.md](glyph-escapes.md))
- The M0 core executes with ratified semantics: 89 ratified conformance tests (`node conformance/harness/run.mjs --ratified`), exact rational arithmetic, and a recorded ruling for every semantic question ([conformance/JUDGMENT_CALLS.md](conformance/JUDGMENT_CALLS.md))
### What Doesn't Work Yet ๐ง
- **No native runtime** - The M0 core runs in the browser interpreter (`js/mpl.js`); everything beyond it parses but does not run yet
- **No type checking** - Types are recognized but not validated
- **No standard library** - No built-in functions
- **No tooling** - Basic parser only
## Vision: Programming Without Language Barriers
In a world where 80% of humanity doesn't speak English, why should programmingโthe literacy of the 21st centuryโrequire it? MPL demonstrates that we can build programming languages using mathematical symbols that children already understand, making computational thinking accessible to billions previously excluded by language barriers.
**This is cognitive justice in action.**
---
## ๐ฏ The Fatima test
> "Why do I need to know English to write a program?" โ Fatima, 10 years old, Cairo
Every design decision in MPL must pass one simple test: **Can a 10-year-old non-English speaker understand this?**
### Traditional programming
```python
# English required:
for n in [1, 2, 3, 4, 5]:
print(n * n)
```
### MPL - Universal understanding
```mpl
-- Mathematical symbols only:
โ n โ [1, 2, 3, 4, 5] : โ(n ร n)
```
If Fatima can't understand it with her basic math knowledge, we redesign it. No exceptions.
---
## ๐ Quick start journey
### Choose your path
| ๐ **Educator?** | ๐ป **Developer?** | ๐ **Changemaker?** |
|:---:|:---:|:---:|
| [See the Vision](#educational-vision) | [Technical Details](#technical-architecture) | [Why This Matters](#why-this-matters) |
| Imagine teaching without English | Help build the runtime | Support cognitive justice |
### Hello, world in 30 seconds
| Traditional (English Required) |
MPL (Universal) |
|
```python
print("Hello, World!")
```
|
```mpl
โ"Hello, World!"
```
|
| English words: print |
Universal symbol: โ (output/trace) |
**Note**: This syntax is valid and parses. The M0 core runs in the browser interpreter at [mpl.codes](https://mpl.codes); features beyond the M0 core parse but do not run yet.
---
## ๐ฎ How it works
### For everyone
Write code using mathematical symbols instead of English words. It's that simple.
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Mathematical Notation โ
โ ฮปn: (n โค 1 โน 1) | (n ร fact(n-1)) โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Unicode Input โ
โ (Visual palette, voice, keyboard) โ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ANTLR 4 Parser โ
โ Lexer โ Parser โ AST โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
### Five ways to write ฮป (lambda)
Today the parser accepts two spellings of every symbol: the Unicode glyph (ฮป) and its ASCII escape (`\lambda`). The rest are the input methods we envision tooling for:
1. **โจ๏ธ Type** โ `\lambda` (works today, in any editor)
2. **๐ Click** โ Visual symbol palette (envisioned)
3. **๐ค Speak** โ "Lambda" in ANY language (envisioned)
4. **โ๏ธ Draw** โ Handwriting recognition on tablets (envisioned)
5. **โก Shortcut** โ Platform shortcuts (envisioned)
๐ง Technical details (click to expand)
### Unicode implementation
- Full Unicode support, including supplementary-plane symbols (๐, ๐น, ๐ซ)
- Every glyph has exactly one ASCII escape ([glyph-escapes.md](glyph-escapes.md))
### Parser architecture
```
Input Methods โ Unicode Stream โ ANTLR 4 Lexer โ Parse Tree
```
Type checking, optimization and code generation are planned, not built.
### Grammar specification
- Compiles with zero ANTLR errors and warnings (enforced in CI)
- Operator precedence documented in [precedence.csv](precedence.csv)
- [View full ANTLR grammar](src/main/antlr4/MPL.g4)
---
## โจ Core features
### ๐ Cognitive universality
**Mathematical symbols as humanity's common language**
- **No translation needed** โ Math is already universal
- **Cultural neutrality** โ No linguistic imperialism
- **Instant comprehension** โ Symbols map to concepts directly
### ๐จ Multi-modal input (envisioned)
**Meet learners where they are**
Only ASCII escapes exist today; the rest is the tooling we want to build:
```
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ Visual โ Voice โ Keyboard โ Handwriting โ
โ Palette โ Input โ Escapes โ Recognition โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโค
โ Click ฮป โ Say "lambda"โ Type \lambdaโ Draw ฮป โ
โ from menu โ in any lang โ (works now) โ on screen โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
```
- **ASCII escapes** โ `\lambda`, `\forall`, โฆ work in any editor today
- **Visual palette** โ Click symbols like emoji (envisioned)
- **Voice input** โ Speak in your native language (envisioned)
- **Handwriting** โ Natural for mathematical notation (envisioned)
### ๐ Progressive complexity
**From arithmetic to algorithms**
```mpl
-- Level 1: Basic math (everyone knows this!)
x โ 5 + 3;
y โ x ร 2;
-- Level 2: Logic (learned in school)
x > 10 โง y < 20 โน โ"Success!";
-- Level 3: Advanced (natural progression)
squares โ 0;
โ n โ [1, 2, 3, 4, 5] : squares โ squares + n ร n;
```
---
## ๐ Educational Vision
### The Problem We're Solving
Consider a hypothetical student, "Maria" from Sรฃo Paulo:
- She loves math and logic puzzles
- She wants to learn programming
- But she must first memorize English keywords like `for`, `while`, `if`, `else`
- The Portuguese word "for" means "went" - adding confusion
- She spends more time translating than learning computational thinking
### What MPL Could Enable (Vision, Not Reality)
With MPL fully implemented, we envision students could:
- Write their first program in minutes using familiar mathematical symbols
- Focus on logic and problem-solving, not foreign vocabulary
- Learn alongside parents who also don't speak English
- Build confidence through immediate understanding
### Hypothetical Benefits We Aim For
If MPL were fully implemented and deployed in classrooms, we hypothesize it could achieve:
| Potential Metric | Traditional Approach | MPL Vision |
|-----------------|---------------------|------------|
| Time to understand loops | Days of memorizing `for` | Minutes with โ symbol |
| Cognitive load | High (translate + learn) | Lower (direct understanding) |
| Parent involvement | Limited by English | Possible with math symbols |
**Note: These are aspirational goals based on our hypothesis, not measured results.**
### Envisioned Success Stories
These are hypothetical scenarios we hope MPL could enable once fully implemented:
๐ Imagine: A student's potential journey
We envision students could progress like this:
**Starting point**: Basic math knowledge, no English
```mpl
-- Month 1: First program using familiar symbols
โ"Jambo!" -- Hello in their language
```
**Growing skills**: Applying math knowledge to programming
```mpl
-- Month 6: Using mathematical concepts they know
data โ [23, 45, 67, 34, 89, 12];
total โ 0;
โ x โ data : total โ total + x;
average โ total รท 6;
โ("Average: " + average)
```
**Sharing knowledge**: Teaching others in their community
*This is our vision - not current reality. Help us make it possible!*
---
## ๐ป Code examples (Syntax Demonstration)
**Note**: These examples show valid MPL syntax that our parser accepts (a test extracts every code block on this page and parses it). The M0-core subset runs in the browser interpreter at [mpl.codes](https://mpl.codes); the rest parses but does not run yet.
Some notation you might expect from math class โ โ, โ, ยฒ, `%` (modulo), |x|, ranges like [1..10] โ is deliberately absent: it is deferred to milestone M1, where each symbol will arrive together with defined semantics (see [DECISIONS.md](DECISIONS.md)).
### Level 1: Arithmetic thinking ๐ข
*What every child knows*
```mpl
-- Store values (like math class!)
length โ 5;
width โ 3;
area โ length ร width;
โ("Area = " + area);
-- Make decisions: (condition โน result) | fallback
age โ 15;
(age โฅ 18 โน โ"Adult") | โ"Minor";
```
### Level 2: Logical reasoning ๐งฉ
*Natural progression from math*
```mpl
-- Do something for every element (โ = "for all")
โ n โ [1, 2, 3, 4, 5] : โ(n ร n);
-- Accumulate a running total
total โ 0;
โ n โ [1, 2, 3, 4, 5] : total โ total + n;
โ("Total: " + total);
```
### Level 3: Real-world applications ๐
*Solving community problems*
```mpl
-- Weather data analysis
temperatures โ [28, 30, 27, 31, 29, 33, 28];
total โ 0;
โ t โ temperatures : total โ total + t;
ฮผ โ total รท 7;
โ("Average: " + ฮผ + "ยฐC");
-- Parallel processing (โ = parallel)
results โ analyzeNorth() โ analyzeSouth() โ analyzeEast();
```
### Level 4: Advanced concepts ๐
*For those ready to go deeper*
```mpl
-- Function composition (โ, straight from math class)
double โ ฮปn: n ร 2;
addOne โ ฮปn: n + 1;
transform โ double โ addOne;
โ(transform(5));
-- Higher-order functions
apply โ ฮปf, x: f(x);
โ(apply(ฮปn: n ร n, 6));
```
---
## Why Release a Parser Without Execution?
We believe the core innovation of MPL is proving that mathematical notation can replace English keywords. By releasing the parser, we demonstrate this is grammatically possible and invite the community to help build the rest.
The parser alone proves several key points:
- Mathematical symbols can express the core programming constructs (see the ten [examples](examples/))
- A language without English keywords is technically feasible
- The grammar compiles with zero ANTLR errors and warnings, enforced in CI
- ASCII fallbacks make it universally typeable
Sometimes the idea is more important than the implementation. By sharing MPL now, we hope to inspire others to think differently about programming languages and who they exclude.
---
## ๐๏ธ Technical architecture
### Grammar specification
- Every symbol has exactly one meaning and one ASCII escape ([glyph-escapes.md](glyph-escapes.md))
- Operator precedence is documented in [precedence.csv](precedence.csv) and exercised by the test suite
- The grammar compiles with zero ANTLR errors and warnings (`-Werror`, enforced in CI)
- 200+ syntax assertions across the lexer, parser, example, and documentation test suites
- [Full grammar specification](src/main/antlr4/MPL.g4)
### Implementation stack
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Input Layer (Multi-modal) โ
โ Visual โ Voice โ Keyboard โ Handwriting โ
โโโโโโฌโโโโโดโโโโฌโโโโดโโโโโฌโโโโโดโโโโโโโโฌโโโโโโโโโ
โ โ โ โ
โโโโโโผโโโโโโโโโผโโโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโ
โ Unicode Normalization โ
โ (UTF-8 with BiDi support) โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ ANTLR 4 Parser โ
โ Lexer โ Parser โ AST Generation โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ Semantic Analysis (planned) โ
โ Type Checking โ Effect Analysis โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ Code Generation (planned) โ
โ LLVM โ JVM โ JavaScript โ Python โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
Only the parser stage exists today; the lower stages are the planned architecture. We publish no performance numbers until CI measures them.
---
## ๐บ๏ธ Pilot program roadmap
### Phase 1: Foundation ๐๏ธ (Months 1-3) โ
- [x] Core parser implementation
- [x] Basic syntax examples
- [x] Grammar validation complete
- [ ] Educational materials in development
### Phase 2: Interpreter ๐ (Current Focus) **โ We are here**
- [ ] Basic expression evaluation
- [ ] Control flow implementation
- [ ] Function calls
- [ ] Standard library basics
### Phase 3: Educational Materials ๐ (Future)
- [ ] First pilot classroom test
- [ ] Basic curriculum development
- [ ] Teacher guide creation
- [ ] Community feedback integration
### Phase 4: Expansion ๐ (Long-term Vision)
- [ ] Multi-school pilots
- [ ] Research partnerships
- [ ] Policy advocacy
- [ ] Global community building
---
## ๐ค Community & contribution
### For educators ๐
| Resource | Description | Get Started |
|----------|-------------|-------------|
| **Classroom Kit** | Future: Lesson plans and exercises | Coming soon |
| **Teacher Training** | Future: Online certification | Planned |
| **Community Forum** | Future: Educator community | In development |
| **Student Showcase** | Future: Project gallery | Under consideration |
### For developers ๐ป
```bash
# Clone and build
git clone https://github.com/developtheweb/mpl.git
cd mpl
./gradlew build
# Run tests
./gradlew test
# Parse examples (validation only, no execution)
./gradlew parseExamples
```
**Key contribution areas:**
- ๐ค Symbol input methods
- ๐ Localization systems
- ๐ Educational content
- ๐ง Language features
- ๐ฑ Mobile applications
[Contributing guidelines](CONTRIBUTING.md) | [Architecture docs](docs/ARCHITECTURE.md) | [GitHub issues](https://github.com/developtheweb/mpl/issues)
### For researchers ๐ฌ
- **Cognitive load studies** โ Measuring comprehension rates
- **Learning outcome analysis** โ Long-term retention data
- **Cultural adaptation** โ Symbol interpretation across cultures
- **Neurodiversity research** โ Benefits for different learning styles
[Research collaboration](mailto:developtheweb@protonmail.com)
### For advocates ๐ข
**Help us reach more children:**
- ๐ Policy templates for education ministries - Coming soon
- ๐ค Speaker materials for conferences - In development
- ๐ Research findings - See [whitepaper](whitepaper/mpl-whitepaper.md)
- ๐จ Media kit - Coming soon
---
---
## ๐ Why This Matters
### The Vision
Imagine a world where:
- A teacher in Beijing could explain loops using โ instead of `for`
- A parent in Mumbai could understand their child's code without knowing English
- Education ministers could provide programming education without requiring English literacy
These aren't testimonials - they're possibilities we're working toward. MPL is still just a parser, but it proves that programming without English is possible.
---
## ๐ฏ Join the movement
### **Every child deserves to code in the language of their thoughts**
| ๐ **Educators** | ๐ป **Developers** | ๐๏ธ **Institutions** | ๐ฐ **Supporters** |
|:---:|:---:|:---:|:---:|
| Share the vision | [Contribute code](https://github.com/developtheweb/mpl) | Contact us to explore | Star the project |
| Imagine the possibilities | Build the runtime | Research partnerships | Spread the word |
---
## ๐ Resources
| ๐ [Documentation](docs/) | ๐ฌ [Whitepaper](whitepaper/mpl-whitepaper.md) | ๐ง [Contact](mailto:developtheweb@protonmail.com) |
|:---:|:---:|:---:|
| View specs | Read the vision | Get in touch |
---
## ๐ The inspiration
The idea for MPL came from a simple observation: children worldwide learn the same mathematical symbols (+, -, ร, รท, =) but must learn English to program. This creates an unnecessary barrier.
Imagine a student asking: *"Why do I need to know English to tell a computer what to do? I know math. Isn't that enough?"*
This hypothetical question captures the essence of MPL. Mathematical thinking IS enough. We're building this proof of concept to demonstrate it's possible.
---
## ๐ฌ Cognitive science foundation
Why mathematical symbols work universally (click to expand)
### Symbolic universality
Mathematical notation evolved over millennia to be:
- **Culture-agnostic** โ Symbols transcend linguistic boundaries
- **Cognitively efficient** โ Direct concept-to-symbol mapping
- **Progressively learnable** โ Builds on existing knowledge
### Neurological evidence
fMRI studies show mathematical symbol processing activates language-independent brain regions, enabling comprehension without linguistic translation.
### Pedagogical advantages
1. **Reduced cognitive load** โ Single-step comprehension
2. **Transfer learning** โ Math knowledge directly applies
3. **Cultural preservation** โ Think in your native language
4. **Universal collaboration** โ Code readable globally
[Read our whitepaper](whitepaper/mpl-whitepaper.md)
---
## ๐ Global partnership vision
### Partnership Opportunities
We envision collaborating with organizations like:
| Type of Partner | Potential Role | Envisioned Impact |
|-----------------|----------------|-------------------|
| **UN Agencies** | Education frameworks | Global policy influence |
| **Universities** | Research partnerships | Cognitive studies |
| **Tech Companies** | Technical support | Infrastructure development |
| **Local NGOs** | Community implementation | Grassroots adoption |
*Note: We are actively seeking our first institutional partners. Contact us if interested.*
### Join as a partner
We're seeking partnerships with:
- ๐ซ **Schools & Universities** โ Pilot programs
- ๐ข **Tech Companies** โ Internships for MPL students
- ๐๏ธ **Governments** โ National curriculum integration
- ๐ **Research Institutions** โ Impact studies
- ๐ก **NGOs** โ Community implementation
[Contact us](mailto:developtheweb@protonmail.com) to explore partnerships
---
## ๐ฎ Future roadmap
### Beyond programming
MPL is just the beginning. Our vision extends to:
1. **Mathematical Interfaces** โ Operating systems using symbols
2. **Universal IDE** โ Development environments without language barriers
3. **Symbolic Databases** โ Query languages using set notation
4. **AI Training** โ Teaching AI in mathematical notation
5. **Global Standard** โ ISO standardization for universal programming
### The 2030 vision
By 2030, we envision a world where:
- โ
**Any child** can learn programming in their native cognitive framework
- โ
**No talent** is lost to language barriers
- โ
**Global collaboration** happens without linguistic friction
- โ
**Cognitive diversity** strengthens our collective problem-solving
- โ
**Technology** truly serves all humanity
---
## ๐ A world where code speaks the language of human thought
### Not English. Not Chinese. Not Spanish.
### The language of logic itself.
**Together, we're not just teaching programming.**
**We're democratizing the power to create.**
---
*This is what we're building toward - a world where every child's way of thinking matters in programming.*
---
### [โญ Star this repository](https://github.com/developtheweb/mpl) to support cognitive justice in programming
### **The next Fatima is waiting. Let's make sure nothing is lost in translation.**
---
**Mathematical Programming Language** โ Where every mind can code
[GitHub](https://github.com/developtheweb/mpl) โข [Documentation](docs/) โข [Contact](mailto:developtheweb@protonmail.com)
Made with โค๏ธ for the 80% of humanity waiting to code