Files
zen/core/expression
Stefan df9202c2c9 perf(engine): run policy tables typed and cut per-row validation
Run strict collect tables and collect tables with first-hit outputs as
typed units, read optional fields that mix values with nulls as typed
columns, keep selects whose cells read already demanded fields in one
segment, lower powers with computed integer exponents, run membership
in another list of the row typed, and keep lifted declared dates typed.

Validate enums and primitive arrays without the row validator, shred
lists without copying their items, and remember settled selects and
table typability per plan.
2026-11-26 14:24:42 +01:00
..
2026-11-17 17:37:10 +01:00
2026-11-19 18:09:09 +01: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