MALDA™ Reference Manual

The AI-First Programming Language - Version 1.0.39

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.

What ships today: MALDA 1.0.39 (this manual). Tier 0 language semantics are specified in malda-language-1.0. A C# interpreter, a compiler that transpiles to C# or JavaScript, a Windows Desktop IDE, a browser playground, and a language server for cross-platform editors. The interpreter is the full host surface; C# transpile shares it. JavaScript is a subset: 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.
Find a concept: Use the sidebar search (press / or Ctrl+K) or browse the glossary. Short names such as cap jump to capability tokens in 13.19.3 and 12.6.
How to get MALDA: on Windows, download the win-x64 zip from GitHub Releases and run 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.
Recommended onboarding: MALDA works best with a dual-track start. New programmers should begin with Learn MALDA. Experienced builders can jump straight into prompts, agents, APIs, and full-stack showcases. After the core path, follow Learn MALDA — After the core path (algorithms, then one hub). The from-scratch nets — perceptron, XOR, then chapter 14 — are the AI theory track in Start Here. For runnable example paths and CLI quickstarts, see Start Here.

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:

  1. Hello World — Examples/Basics/hello_world.malda
  2. Variables and Arithmetic — Examples/Basics/variables_arithmetic.malda
  3. Conditionals — Examples/Basics/conditionals.malda
  4. While Loop — Examples/Basics/while_loop.malda
  5. For Loop — Examples/Basics/for_loop.malda
  6. Functions — Examples/Basics/functions.malda
  7. Lists and Indexing — Examples/Basics/lists_indexing.malda
  8. Complete Starter Program — Examples/Basics/complete_starter_program.malda
  9. Input Example — Examples/Basics/input_example.malda
  10. Dictionaries — Examples/Basics/dictionary_example.malda
  11. Recursion — Examples/Basics/recursion.malda
  12. Classes — Examples/Basics/classes_intro.malda
  13. try / catch — Examples/Basics/try_catch.malda
  14. Prompt as a template — Examples/Basics/prompt_template.malda
  15. Mini project — Examples/Basics/gradebook.malda
  16. Check a mistake — Examples/Basics/check_a_mistake.malda
  17. Two files and a test — Examples/Basics/modules_include.malda
  18. 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.

Full-Stack Quickstart: MALDA supports both MALDA-native full stack (server-rendered UI) and hybrid full stack (React/Vue/etc. frontend + MALDA backend). Not sure which UI chapter to read? Start with 25. Web UI Overview. 31. Full-Stack Development with MALDA ties the pieces together end to end.

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.