Syntax
The fundamental syntax rules of Autolang. Autolang scripts are designed for clean orchestration of host capabilities, executing top to bottom without boilerplate wrapping.
File Extension & Top-Level Execution
Autolang source files use the .atl extension. Code is executed sequentially from top to bottom at file scope. Scripts do not require a main() function wrapper.
val orderId = "ORD-9021"
val status = "INITIALIZED"
println("Workflow started for order: " + orderId + " [" + status + "]")Statements & Semicolons
Each statement is typically written on its own line. Semicolons (;) are optional line terminators, but can be used to separate multiple statements on a single line or inside a block. Standalone semicolons are also permitted.
// Multiple statements on a single line separated by semicolons
var totalAmount = 1500; var discountApplied = false; var currency = "USD"
// Standalone semicolons are valid no-ops
;
;;
// Semicolons used in compact state transitions
if (totalAmount > 1000) { discountApplied = true; totalAmount -= 150; }
println("Final amount: " + totalAmount + " " + currency)Code Blocks
Curly braces {} delineate lexical scopes for control flow structures (such as if, when, and for), functions, and classes. Variables declared inside a block remain local to that scope.
val stockAvailable = true
if (stockAvailable) {
val reservedQuantity = 5
println("Stock reserved: " + reservedQuantity)
}Comments
Use // for single-line comments. Everything following // on that line is ignored by the compiler. Use /* ... */ for multi-line block comments.
// Single-line comment: check customer status
val isVerified = true // Inline comment
/* Multi-line comment:
Host capabilities provide customer risk scores.
Scripts orchestrate business rules deterministically. */
val riskScore = 15Whitespace & Case Sensitivity
Whitespace and indentation do not affect program semantics. Indentation is recommended for readability. Autolang is strictly case-sensitive: identifiers with different casing refer to distinct bindings.
val batchSize = 100
val BatchSize = 250
println(batchSize) // 100
println(BatchSize) // 250