Mbare is a Turing-complete programming language that uses Sicilian keywords instead of English. It's based on the Lox language from "Crafting Interpreters" but with a Southern Italian twist!
- 🎉 Turing Complete - Can compute anything that's computable
- 🇮🇹 Sicilian Keywords - Programming in Southern Italian
- 🚀 Kotlin-Style Syntax - Optional semicolons, just like Kotlin!
- 🔄 Backward Compatible - Old code with semicolons still works
Mbare is officially Turing complete, meaning it can compute anything that's computable! It supports:
- ✅ Variables
- ✅ Control flow (if/else, while loops)
- ✅ Logical operators
- ✅ Arbitrary computation
Semicolons are now optional! Write cleaner code, just like Kotlin:
// Modern Kotlin-style (no semicolons)
variabbili a = 0
variabbili b = 1
stampa "Fibonacci:"
mentri (i < 10) {
stampa a
variabbili temp = a + b
a = b
b = temp
}Here are all the keywords in Mbare and their English equivalents:
| Sicilian | English | Usage | Status |
|---|---|---|---|
variabbili |
var |
Variable declaration | ✅ Working |
stampa |
print |
Print statement | ✅ Working |
su |
if |
If statement | ✅ Working |
sannunca |
else |
Else clause | ✅ Working |
mentri |
while |
While loop | ✅ Working |
e macari / macari |
and |
Logical AND | ✅ Working |
o |
or |
Logical OR | ✅ Working |
veru |
true |
Boolean true | ✅ Working |
falsu |
false |
Boolean false | ✅ Working |
nenti |
nil |
Null/nil value | ✅ Working |
funzioni |
fun |
Function definition | ✅ Working |
ritorna |
return |
Return statement | ✅ Working |
pi |
for |
For loop | ⏳ Not yet |
classi |
class |
Class definition | ⏳ Not yet |
chistu |
this |
This reference | ⏳ Not yet |
supiru |
super |
Superclass reference | ⏳ Not yet |
# Compile the project
mvn clean compile
# Build the JAR
mvn packagejava -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.MbareThen type statements:
> variabbili x = 10
> stampa x
10
> su (x > 5) { stampa "Grande!" }
Grande!Note: Semicolons are optional but can still be used if you prefer.
java -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.Mbare yourfile.mbare// Define a function with 2 parameters
funzioni somma(a, b) {
ritorna a + b
}
stampa somma(5, 3) // 8
// Functions with 3 or more parameters
funzioni somma3(a, b, c) {
ritorna a + b + c
}
stampa somma3(1, 2, 3) // 6// Classic factorial using recursion
funzioni fattoriali(n) {
su (n <= 1) {
ritorna 1
}
ritorna n * fattoriali(n - 1)
}
stampa fattoriali(5) // 120
stampa fattoriali(10) // 3628800// Recursive fibonacci
funzioni fib(n) {
su (n <= 1) {
ritorna n
}
ritorna fib(n - 1) + fib(n - 2)
}
stampa fib(0) // 0
stampa fib(1) // 1
stampa fib(10) // 55// Function returning a function
funzioni multiplier(factor) {
funzioni multiply(n) {
ritorna n * factor
}
ritorna multiply
}
variabbili double = multiplier(2)
variabbili triple = multiplier(3)
stampa double(5) // 10
stampa triple(5) // 15variabbili a = 5
variabbili b = 10
stampa a + b // 15variabbili x = 10
su (x > 5) {
stampa "Grande"
} sannunca {
stampa "Nicu"
}variabbili i = 0
mentri (i < 5) {
stampa i
i = i + 1
}// Proves Turing completeness: variables + loops = universal computation
variabbili a = 0;
variabbili b = 1;
variabbili n = 10;
variabbili i = 0;
stampa "Fibonacci in Sicilianu:";
mentri (i < n) {
stampa a;
variabbili temp = a + b;
a = b;
b = temp;
i = i + 1;
}
stampa "Fattu!";Output:
Fibonacci in Sicilianu:
0
1
1
2
3
5
8
13
21
34
Fattu!
variabbili x = 5;
variabbili y = 10;
si (x > 0 e y > 0) {
stampa "Tutti dui positivi";
}
si (x < 0 o y < 0) {
stampa "Almenu unu negativu";
} senno {
stampa "Nenti negativu";
}- Variables -
variabbilikeyword for declarations - Print -
stampakeyword for output - Arithmetic -
+,-,*,/ - Comparison -
>,<,>=,<=,==,!= - Logical operators -
e(and),o(or),!(not) - Control flow -
si/senno(if/else) - Loops -
mentri(while) - Blocks -
{ }for scoping - String operations - Concatenation with
+ - Boolean values -
veru,falsu,nenti
- Functions -
funzioniandritorna - For loops -
pi - Classes -
classi,chistu,supiru - Recursion - Via functions
Mbare satisfies all requirements for Turing completeness:
- ✅ Arbitrary memory - Variables (
variabbili) - ✅ Conditional branching - If/else (
si/senno) - ✅ Iteration - While loops (
mentri)
This means mbare can theoretically compute anything that's computable!
Run example programs:
# Variables
java -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.Mbare examples/test_variables.mbare
# Control flow
java -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.Mbare examples/test_if.mbare
# Loops
java -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.Mbare examples/test_while.mbare
# Fibonacci (Turing completeness proof)
java -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.Mbare examples/fibonacci.mbare
# Logical operators
java -cp target/mbare-1.0-SNAPSHOT.jar com.bezkup.mbare.Mbare examples/test_logical.mbareMbare celebrates the rich linguistic heritage of Sicily while making programming more accessible to Sicilian speakers. The name "mbare" itself is Sicilian, adding authenticity to this Southern programming language.
program → declaration* EOF ;
declaration → varDecl
| statement ;
varDecl → "variabbili" IDENTIFIER ( "=" expression )? ";" ;
statement → exprStmt
| ifStmt
| printStmt
| whileStmt
| block ;
exprStmt → expression ";" ;
ifStmt → "si" "(" expression ")" statement
( "senno" statement )? ;
printStmt → "stampa" expression ";" ;
whileStmt → "mentri" "(" expression ")" statement ;
block → "{" declaration* "}" ;
expression → assignment ;
assignment → IDENTIFIER "=" assignment
| logic_or ;
logic_or → logic_and ( "o" logic_and )* ;
logic_and → equality ( "e" equality )* ;
equality → comparison ( ( "!=" | "==" ) comparison )* ;
comparison → term ( ( ">" | ">=" | "<" | "<=" ) term )* ;
term → factor ( ( "-" | "+" ) factor )* ;
factor → unary ( ( "/" | "*" ) unary )* ;
unary → ( "!" | "-" ) unary
| primary ;
primary → "veru" | "falsu" | "nenti"
| NUMBER | STRING
| IDENTIFIER
| "(" expression ")" ;
Feel free to contribute by:
- Adding more Sicilian expressions and idioms
- Implementing the remaining language features (functions, classes)
- Improving documentation
- Creating example programs
See LICENSE file for details.
Bon travagghiu! (Happy coding!) 🇮🇹