Welcome to the MALDA Reference Manual
MALDA is an object-oriented language with prompts, agents, and durable workflows as language constructs — not a library bolted onto another stack. The name and runtime architecture are in 1. Introduction.
dom.* / game.* / three.* / @shader() are JS-only, while agents, HTTP servers, file I/O, VectorDB, and workflows stay on the host. Each chapter states its backends; the table is the backend capability matrix.
cap jump to capability tokens in 13.19.3 and 12.6.
MaldaDesktop.bat (CLI + Desktop IDE), then Start With MALDA. Linux: the linux-x64 zip and ./malda. From source: dotnet run --project MaldaLang -- Examples/Basics/hello_world.malda. No install: the Web IDE playground. After that, a student only needs malda file.malda — see Learn MALDA.
Quick Start
If you already program, start with the characteristic constructs. -> Review binds the prompt to the schema. Without await, the call is a rendered template (no API key). validate("Review", …) is the same check await would run on the model JSON. Type annotations elsewhere are IDE/LSP hints, not runtime checks. Same file: Examples/Basics/first_look.malda.
1. First Look
schema Review {
summary: string;
issues: string[];
}
prompt codeReview(code, language) -> Review {
system: "You are an expert reviewer of {language}.",
user: "Review this {language} code:\n\n{code}"
}
var rendered = codeReview("function add(a, b) { return a + b; }", "javascript");
io.print(rendered.user);
var checked = validate("Review", {
"summary": "Looks fine",
"issues": []
});
if (checked.ok) {
io.print("schema ok: " + checked.data.summary);
} else {
io.print("schema failed: " + checked.error);
}
Then the syntax path, if you want the core language before agents and APIs. Prefer namespaced calls (io.print, math.sqrt, str.upper); flat print still runs.
2. Print Output
io.print("Hello, World!");
3. Variables and Arithmetic
var price = 12;
var quantity = 3;
var total = price * quantity;
io.print("Total: " + total);
4. Conditionals
var score = 82;
if (score >= 60) {
io.print("Pass");
} else {
io.print("Fail");
}
5. Loops and Functions
function printCountdown(start) {
var current = start;
while (current > 0) {
io.print(current);
current = current - 1;
}
io.print("Go!");
}
printCountdown(3);
6. Complete Starter Program
This example combines variables, arrays, a loop, a function, and an if statement in one linear program:
var cart = [12, 18, 7];
var total = 0;
for (var item in cart) {
total = total + item;
}
function describeTotal(amount) {
if (amount >= 30) {
return "big order";
}
return "small order";
}
io.print("Items: " + cart.length);
io.print("Total: " + total);
io.print("Summary: " + describeTotal(total));
For more of this, one lesson at a time, see Learn MALDA. The folder catalog is Examples; CLI paths are in Start Here.
Choose Your Path
Path 1: Learn Programming With MALDA
Start here if you are learning programming for the first time. The course is Learn MALDA — one lesson, one example file, one chapter section:
- Hello World —
Examples/Basics/hello_world.malda - Variables and Arithmetic —
Examples/Basics/variables_arithmetic.malda - Conditionals —
Examples/Basics/conditionals.malda - While Loop —
Examples/Basics/while_loop.malda - For Loop —
Examples/Basics/for_loop.malda - Functions —
Examples/Basics/functions.malda - Lists and Indexing —
Examples/Basics/lists_indexing.malda - Complete Starter Program —
Examples/Basics/complete_starter_program.malda - Input Example —
Examples/Basics/input_example.malda - Dictionaries —
Examples/Basics/dictionary_example.malda - Recursion —
Examples/Basics/recursion.malda - Classes —
Examples/Basics/classes_intro.malda - try / catch —
Examples/Basics/try_catch.malda - Prompt as a template —
Examples/Basics/prompt_template.malda - Mini project —
Examples/Basics/gradebook.malda - Check a mistake —
Examples/Basics/check_a_mistake.malda - Two files and a test —
Examples/Basics/modules_include.malda - Offline prompt eval —
Examples/Basics/prompt_eval.malda
If you already program, optionally start with First Look (prompt + schema + validate) before Hello World. See Learn MALDA — Lesson 0 and Examples/README.md.
After the core path, follow Learn MALDA — After the core path: algorithms, then one hub first-read. The from-scratch nets — perceptron, XOR, then chapter 14 — are the AI theory track in Start Here.
Path 2: Build AI Apps With MALDA
Start here if you already know the basics and want to reach prompts, agents, and full-stack AI apps quickly.
- 10. Prompts — prompt blocks and reusable prompting
- 19. Agent Orchestration — agents and tool-based workflows
- 29. REST API Server and 26. Web UI Server Components — APIs and UI controls (choose a model in 25)
- 31. Full-Stack Development with MALDA — end-to-end web and API showcases
Browser games
JavaScript only — not the interpreter. Preview with malda play app.malda (live reload unless --no-watch). Language: game.* / three.* / @shader() in 28.9–28.10. Catalog: 35.3. Playable showcase: 39. Same folder: Examples/Games/.
Table of Contents
Getting Started
Run malda Examples/Basics/first_look.malda from the CLI. The Desktop IDE is the Windows reference (WPF): install it from the win-x64 GitHub Release zip and run MaldaDesktop.bat. The Web IDE is a browser playground (not Desktop parity); VS Code + LSP is the cross-platform editor. Tooling, debug, and malda check are in 2. Tools & Tooling. Profiling flags live in the Appendix.
A first live agent is 19. Agent Orchestration (needs a client or the default local GGUF). Keep working through Quick Start before that if you are new to the language.
Architecture and the numbered reference start at 1. Introduction.