Interpreter Mode

Before v0.8.2, every code change required a full compilation cycle: LOGOS source → Rust codegen → cargo build → run binary. For large projects, that's minutes of waiting per iteration.

largo run --interpret bypasses codegen entirely. The interpreter walks the AST directly, evaluating expressions and executing statements without generating Rust. Startup is sub-second.

The interpreter supports the full language surface: variables, functions, control flow, collections, structs, enums, pattern matching, string operations, and arithmetic. It handles 1-based indexing, type coercion, and the standard library. The goal is behavioral equivalence with compiled output — if it works in the interpreter, it works when compiled.

Interpreter mode is for development. It doesn't optimize, doesn't type-check at the Rust level, and runs slower than compiled code by orders of magnitude. But it turns the edit-run cycle from minutes to milliseconds.

Optimizer Infrastructure

This release lays the foundation for all subsequent optimization work (v0.8.10–0.8.13). Two passes ship in v0.8.2:

Constant folding evaluates compile-time-known expressions during codegen. 3 + 4 becomes 7 in the generated Rust, not a runtime addition. This propagates through variable assignments when the optimizer can prove the value is constant.

Dead code elimination removes unreachable branches. An if false { ... } block (after constant folding resolves the condition) is dropped entirely from the output. This keeps generated code clean and reduces what rustc has to process.

Both passes operate on the AST before Rust emission — they improve codegen quality without changing language semantics.

Map Insertion Syntax

A new syntax form for map mutations:

Set scores at "alice" to 95.

This generates scores.insert("alice".to_string(), 95) in Rust. Previously, map insertion required method-call syntax that didn't match the natural-language feel of the rest of the language.

FFI Safety Hardening

The C export system introduced in v0.8.0 received safety improvements: thread-local error caching (so FFI errors don't cross thread boundaries), panic boundaries at every exported function (so a LOGOS panic doesn't unwind into C), null handle validation, and a dynamic logos_version() function for ABI compatibility checking.

LogosHandle changed from *const c_void to *mut c_void to correctly represent mutable state. Text/String types are excluded from the C ABI value types — they require explicit conversion through the string API.