Language Basics

AodhML is a statically-typed programming language designed for AI/ML workloads. Its syntax draws from modern systems languages while introducing AI-native constructs that feel natural to the domain.

Hello World

Every AodhML program starts with a fn main() entry point:

fn main() {
    println("Hello, AodhML!")
}

Comments

// Single-line comment
/*
 * Multi-line comment
 */

Statements & Expressions

AodhML distinguishes between statements (which do something) and expressions (which produce a value). The last expression in a block is its return value:

fn add(a: i32, b: i32) -> i32 {
    a + b  // No 'return' needed for the last expression
}

Blocks

Code is organized into blocks delimited by curly braces. Variables are scoped to their enclosing block:

fn main() {
    let x = 10
    {
        let y = 20
        println(x + y)  // 30
    }
    // y is not accessible here
}

Entry Point

The main function is the program entry point. It takes no arguments and returns void (or an exit code as i32):

fn main() -> i32 {
    println("Starting up...")
    return 0
}