UNDER CONSTRUCTION
Open Source Software
CEL Interpreter
Common Expression Language (CEL) is a non-Turing complete language designed for simplicity, speed, safety, and portability. I've used the Go implementation extensively, but needed a Rust implementation for a work project.
Rust CEL
WHAT IS CEL?

Common Expression Language (CEL) is a non-Turing complete language designed for simplicity, speed, safety, and portability. The Common Expression Language (CEL) implements common semantics for expression evaluation, enabling different applications to more easily interoperate.

WHY RUST?

One of our mission-critical services at work is written in Rust and we needed a way to evaluate user-provided CEL expressions, so I took it upon myself to fork a partial implementation of the interpreter and start from there. The project already implemented a complete parser, and the basics of an interpreter, but there’s a long way to go to make it fully compliant with the CEL-spec.

WHAT’S NEXT?

I’ve been slowly whittling a way at the project in my spare time and so far have added support for the following:

  • Improved the user-facing API with conversion trait implementations.
  • Added a bunch of built-in functions like has, max, map, filter, all, and many more.
  • Added Duration and Timestamp types with their associated methods and operators.
  • Optimized performance (surprisingly) by switching from arrays to vectors as the underlying list data structure.

Some of the problems and solutions were interesting enough to me that I plan to write a few blog posts about them. I’ll link them here as I write them.

RELATED CONTENT
In case you're interested...
CEL Rust: Variable Shadowing and Scopes
Implementing .map() and .filter(). Variable shadowing, scopes and why we need them for map and filter expressions.
CEL Rust: Parsing Duration Strings with nom
Learning how to use nom by adding support for the duration type to the CEL Rust implementation.