April 2026 · 12 min read

Lateralus v0.5.0 — Channels, Macros, Effects, Decorators & Comptime

v0.5.0 is the biggest Lateralus release yet. Five new feature pillars — each designed to work seamlessly with the pipeline operator.

Channels & Select

CSP-style channels for structured concurrency. Send and receive through typed channels, multiplex with select:

let (tx, rx) = channel::<SensorReading>(16)

spawn { sensor_loop(tx) |> await }

loop {
    select {
        reading from rx => process(reading),
        closed => break,
    }
}

Macros

Declarative macros for code generation. Define patterns, expand at compile time:

macro define_builder($name:ident, $($field:ident : $type:ty),*) {
    struct $name { $($field: Option<$type>,)* }
    impl $name {
        fn new() -> $name { $name { $($field: None,)* } }
        $(fn $field(self, val: $type) -> $name {
            $name { $field: Some(val), ..self }
        })*
    }
}

Effect system

Algebraic effects let you declare side effects in function signatures and handle them at call sites:

effect Log {
    fn log(level: String, msg: String) -> ()
}

fn process(items: [String]) -> [String] with Log {
    for item in items {
        perform Log::log("info", "Processing: {item}")
    }
    items |> map(to_uppercase)
}

Decorators

Annotations for cross-cutting concerns — timing, memoization, retry logic, validation:

@timed
@retry(max_attempts: 3, backoff: "exponential")
async fn fetch(url: String) -> Result<String, Error> {
    http::get(url) |> await
}

Compile-time evaluation

const fn and comptime blocks evaluate at compile time with zero runtime cost:

const fn factorial(n: Int) -> Int {
    match n { 0 | 1 => 1, n => n * factorial(n - 1) }
}
const FACT_20: Int = factorial(20)  // Computed at compile time

Upgrade

All features are backward-compatible. Update with pip install --upgrade lateralus-lang and try them in the playground.

Migration guide

Upgrading from v0.4.x to v0.5.0 requires a few changes. Here's a complete migration checklist:

// 1. Error handling: ? operator replaces try/catch
// Before (v0.4.x):
let result = try { parse_json(input) }
catch (e) { default_value }

// After (v0.5.0):
let result = parse_json(input) |?> default_value
// Or with explicit handling:
let result = match parse_json(input) {
    Ok(v) => v,
    Err(e) => { log_error(e); default_value },
}

// 2. Async: spawn() replaced with async/await
// Before:
let handle = spawn(|| fetch_url(url))
let result = handle.join()

// After:
let result = async fetch_url(url) |> await

// 3. Collections: .len property replaced with .len() method
// Before: my_list.len
// After: my_list.len()

Benchmark improvements

v0.5.0 is significantly faster than v0.4.x thanks to pipeline fusion and improved codegen:

New standard library additions

v0.5.0 ships 6 new standard library modules:

// std::http — HTTP client and server
let response = http::get("https://api.example.com/data")
    |> await
    |> json()

// std::toml — TOML parser for config files
let config = read_file("config.toml") |> toml::parse()

// std::regex — Regular expression engine
let emails = text |> regex::find_all(r"[\w.-]+@[\w.-]+\.\w+")

// std::arg — Command-line argument parser
let args = arg::parser()
    |> arg::flag("verbose", short: 'v', help: "Enable verbose output")
    |> arg::option("output", short: 'o', default: "out.txt")
    |> arg::parse()

// std::log — Structured logging
log::info("Processing started", count: items.len(), mode: "batch")

// std::test — Enhanced test framework
test "pipeline produces correct results" {
    let input = [1, 2, 3, 4, 5]
    let result = input |> filter(|x| x > 2) |> map(|x| x * 10)
    assert_eq(result, [30, 40, 50])
}

What's next: the v0.6.0 roadmap

v0.5.0 is a stable foundation. Here's what's planned for v0.6.0 (tentatively Q3 2026):

Lateralus is built by bad-antics. Follow development on GitHub or try the playground.