Initial commit: MPL specification and M0 documentation

- Complete language specification (math_prog_lang.md)
- M0 blocker tracking issue template
- Glyph escape sequences reference
- Operator precedence table
- Example programs from specification
- Project README

Ready for pre-M0 implementation phase
This commit is contained in:
Reverend Steven Milanese 2025-07-25 12:02:20 -04:00
commit 57efd37df6
15 changed files with 602 additions and 0 deletions

View file

@ -0,0 +1 @@
✎"Hello, World!"

View file

@ -0,0 +1,3 @@
factorial ≜ λn∈: n≤1 ⟹ 1 | n×factorial(n-1)
result ← factorial(5)
✎result

View file

@ -0,0 +1,6 @@
processFile ≜ λpath: 🖫path ↴ {
data ← readFile(path)
result ← transform(data)
writeFile(result, 🖫"output.txt")
⟨"success"|"failed"⟩
} ↴ {↯e ⇒ ⟨⊥|e⟩}

View file

@ -0,0 +1,3 @@
downloadAll ≜ λurls: ∀url∈urls: (
fetchData(url) ‖ processData(url)
) ⟹ mergeResults()

View file

@ -0,0 +1,8 @@
𝓜 Mathematics ⇒ {
π ≜ 3.14159
sin ≜ λx∈: ...
cos ≜ λx∈: ...
}
angle ← π/4
result ← Mathematics‧sin(angle)

View file

@ -0,0 +1,9 @@
databaseQuery ≜ λquery:
conn ← database ⊕
result ← execute(conn, query)
✎"Query executed"
result
⌉_db_lock
conn ⊖

View file

@ -0,0 +1,6 @@
generateFunction ≜ λname: ⌜
λx: x × 2
doubler ← ⌞generateFunction("doubler")⌟
result ← doubler(21)

View file

@ -0,0 +1,5 @@
scheduler ≜ ⟳(
tasks ← getPendingTasks()
∀task∈tasks: execute(task) ‖ monitor(task)
, 100ms
)

View file

@ -0,0 +1,9 @@
server ≜ λport:
socket ← bind(port) ⊕
∀request: (
data ← ↽_socket request
response ← processRequest(data)
⇀_socket response
) ‖ handleNext()
socket ⊖

View file

@ -0,0 +1,4 @@
User ≜ {name: String, age: age>0, email: String}
query ≜ λtable∈Database: ∀row∈table: validateUser(row) ↴ {
↯"Invalid user" ⟹ ⊥
}