MALDA™ Reference Manual

The AI-First Programming Language - Version 1.0.11

Welcome to the MALDA Reference Manual

MALDA: The AI-First Programming Language is a modern, object-oriented programming language designed for building AI agents and automation workflows. With native support for LLM integration, agent orchestration, and multi-agent systems, MALDA makes it simple to create intelligent, autonomous applications.

MALDA: Multi Agent Language with Development Automation - The name MALDA reflects the core principles of the language: Multi Agent (native support for orchestrating multiple AI agents working together), Language (a complete programming language with syntax, runtime, and tooling), Development (a full toolchain - interpreter, compiler, IDEs, language server - for building and shipping real software), and Automation (coding agents can write MALDA thanks to the language pack in docs/llm/, and MALDA programs automate development work in turn, since prompts, agents, and durable workflows are language constructs).

What ships today: MALDA 1.0.11 (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. Every feature described in this manual runs on the interpreter; where a feature is unavailable in one of the transpilers, the chapter says so.
Recommended onboarding: MALDA works best with a dual-track start. New programmers should begin with the language fundamentals path. Experienced builders can jump straight into prompts, agents, APIs, and full-stack showcases. After the core path, branch into Testing and Quality, Data and Databases, and Browser Apps. 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 runnable beginner programs in the same style, see Examples and Start Here.

Choose Your Path

Path 1: Learn Programming With MALDA

Start here if you are learning programming for the first time. Follow this sequence:

  1. First Look (prompt + schema + validate)
  2. Hello World
  3. Variables and Arithmetic
  4. Conditionals
  5. Loops
  6. Functions
  7. Complete Starter Program
  8. Input Example

See Examples for runnable beginner programs.

After the core path, branch into Testing and Quality, Data and Databases, and Browser Apps.

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 23. Web UI Overview. 29. Full-Stack Development with MALDA ties the pieces together end to end.

Key Features

Core Language

AI-First Capabilities

Web & API Features

Table of Contents

Getting Started

To get started with MALDA, run malda Examples/Basics/first_look.malda from the CLI. The Desktop IDE is the Windows reference (WPF); the Web IDE is a browser playground (not Desktop parity); VS Code + LSP is the cross-platform editor. The Desktop IDE provides:

If you are new to the language, work through the Quick Start examples above from top to bottom before jumping into agents and full-stack features.

When you are ready to tune runtime behavior, see Appendix for the command-line profiling flags (including optional periodic file snapshots for long runs) and report summary.

Example: Simple Agent

Here's a quick example of creating an AI agent in MALDA:

// Create an agent (pass a client; for remote models use OpenRouterClient)
var client = new OpenRouterClient();
var agent = new Agent("Assistant", "helper", "You are a helpful assistant.", client);
var response = agent.think("What is 2+2?");
io.print(response.content);

When you use await prompt(...) or specialized agents (e.g. CodingAgent) without passing a client, MALDA uses a default local LLM (Qwen/Qwen2.5-0.5B-Instruct, downloaded as a GGUF build from Hugging Face on first use—no API key required).