Files
zen/core/expression
Stefan 718ccde978 feat(expression): host function registry, count_distinct alias, null-skipping mode and statistics
Ports register_host_function/HostFunction from 3def2637 onto the lane VM branch:
FunctionKind::Host is parsed, type-checked, completed, compiled by the stack VM and
driven by the lane VM through the registry definition. mode, stddev, variance,
percentile and percentileApprox over plain lists skip nulls like their callback forms.
2026-10-20 21:44:01 +02:00
..
2026-10-02 12:40:20 +02:00

ZEN Expression Language

The expression language of ZEN Engine, the open-source Business Rules Engine (BRE) from GoRules.

License: MIT crates.io

ZEN expressions are readable by business users and fast enough for hot paths: a complete language for conditions, calculations and data transformation, with lexer, parser, compiler, VM, type checking and editor completions included in this crate.

use serde_json::json;
use zen_expression::evaluate_expression;

fn main() {
    let result = evaluate_expression(
        "sum(items) * multiplier",
        json!({ "items": [10, 20, 30], "multiplier": 2 }).into(),
    )
    .unwrap();
    // => 120
}

Reusable expressions compile once via compile_expression and evaluate repeatedly against different contexts.

Resources

License

MIT License