Option A — C++ runtime (primary, recommended):
cd M++/cpp
.\build.bat
.\mpp.exe -r ..\examples\hello.mpp
Option B — Python-based .exe (fallback runtime):
cd M++
python build_exe.py
dist\mpp.exe -r examples\hello.mpp
See cpp/README.md for C++ build details.
M++ apps are packaged using the native runtime. The C++ mpp.exe supports:
.\mpp.exe build ..\examples\hello.mpp -o ..\apps\HelloApp
..\apps\HelloApp\run.bat
This creates a distributable folder with:
mpp.exe (runtime)app.mpp (your program)run.bat (launcher)M++ UI apps use the app folder format in apps/APP_FORMAT.md.
Example app included:
apps/editor_app/ (HTML/CSS/JS editor UI + app.mpp backend)Packaging command (C++ runtime):
.\mpp.exe build-app ..\apps\editor_app -o ..\apps\EditorBuild
Window hosting is provided by the native WebView2 host (C++). See apps/terminal_ui_cpp_host/.
See installer/README.md to build a real Windows installer that installs mpp.exe and can add it to PATH.
M++ has exec(cmd) so you can call other languages/tools:
print(exec("python -c \"print(6*7)\""))
Run the regression suite against a runtime:
# Dist runtime (fallback)
npm run test:dist
# C++ runtime (primary) once you have cpp/mpp.exe built
npm run test:cpp
| From C++ | From JavaScript | From Python |
|---|---|---|
| Optional static typing | Dynamic flexibility | Clean, readable syntax |
C-style for loops |
First-class functions | Implicit returns |
| Classes with pub/priv | Arrow functions => |
List literals [1,2,3] |
Braces {} blocks |
Object literals {a:1} |
Comments // |
let x = 42
let y: int = 100
fn add(a, b) { a + b }
fn double => x * 2
for (let i = 0; i < 10; i = i + 1) {
print(i)
}
for (x in [1, 2, 3]) {
print(x)
}
if (x > 0) { print("positive") }
elif (x < 0) { print("negative") }
else { print("zero") }
class Person {
pub name
priv age
fn init(self, name, age) {
self.name = name
self.age = age
}
fn greet(self) {
print("Hello, " + self.name)
}
}
let p = new Person("Alice", 30)
p.greet()
print(...) — outputlen(x) — length of array or stringrange(n) — [0, 1, ..., n-1]typeof(x) — type stringM++/
├── mpp/
│ ├── lexer.py # Tokenizer
│ ├── parser.py # AST builder
│ ├── ast.py # AST nodes
│ └── interpreter.py# Runtime
├── examples/
│ ├── hello.mpp
│ ├── fibonacci.mpp
│ ├── classes.mpp
│ └── functions.mpp
├── run.py # Entry point
├── SPEC.md # Full specification
└── README.md