Files
zen/core/expression
Stefan Miljakovic 8d41eab863 perf: learned row dedup for typed groups
Typed groups without list inputs (graph: 16+ local rows, not already on
the long-program dedup; policy: root groups) learn per group whether to
run the program on distinct input rows only: warm-up, a deferred probe
of the coded run, then a measured trial against the plain run, repeated
every 64 calls. Rows are keyed by exact value codes (table hints, Dict
keys, numbers by mantissa and scale, text through Coder::keys, cached
per call in the graph store). Graph outputs stay dict-coded (reps plus
ids through widen/expand); policy spreads rep outputs back to rows
(Outputs::spread) because its sinks take row-shaped outputs.
2026-10-12 16:07:51 +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