Ferricel compiles CEL (Common Expression Language) expressions into WebAssembly modules.
The produced .wasm files can then be executed in any Wasm runtime.
![NOTE] Development Transparency: Ferricel has been developed with the aid of a code assistant (Claude Sonnet/Opus 4.6).
The code assistant was used for implementation, testing, and documentation. All development has been conducted under direct human supervision, with code review and validation performed throughout.
Ferricel provides the following components:
ferricel: a CLI tool for compiling CEL expressions to WebAssembly or running compiled.wasmmodulesferricel-core: a pure Rust library that powersferricel. You can use it to embed a compiler or runtime in your Rust program
Ferricel targets full compliance with the CEL specification and the cel-go extension libraries. Conformance is validated against the official CEL conformance test suite.
Ferricel also supports the Kubernetes CEL validation libraries.
For more details about Ferricel compliance, please refer to the docs.
Ferricel also supports extending CEL programs with custom functions implemented by the WebAssembly host. See Host Extensions for details.
Let's take this small CEL program:
account.balance >= transaction.withdrawal
|| (account.overdraftProtection
&& account.overdraftLimit >= transaction.withdrawal - account.balance)
We'll compile it to a WebAssembly module using the ferricel CLI:
ferricel build --expression-file validate-balance.cel -o validate-balance.wasmNow we can run it with the ferricel run command. We need to provide the data to be evaluated, which we call "bindings".
Let's create a bindings file named validate-balance.bindings.json with
the following contents:
{
"account": {
"balance": 500,
"overdraftProtection": true,
"overdraftLimit": 1000
},
"transaction": {
"withdrawal": 700
}
}We can now run the compiled Wasm module with the bindings:
ferricel run \
--bindings-file validate-balance.bindings.json \
validate-balance.wasmThe evaluation produces the following output:
trueAlternatively, we can pass bindings as an inline JSON string:
ferricel run \
--bindings-json '{"account":{"balance":500,"overdraftProtection":true,"overdraftLimit":0},"transaction":{"withdrawal":700}}' \
validate-balance.wasmIn this case, the program runs with overdraftLimit set to 0, which causes the validation to return a different result:
falseYou can use ferricel-core to compile CEL expressions and execute them from Rust.
See the ferricel-core documentation for examples and API details.
Download pre-built binaries from GitHub Releases.
Or install from source using Cargo:
cargo install ferricelThe name "Ferricel" is a pun combining "ferrous" (relating to iron and Rust, the programming language) and "CEL" (Common Expression Language).