Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
Expr solves the problem of safely evaluating user-supplied or dynamic expressions within Go applications without exposing the host system to memory vulnerabilities or unintended side effects. It achieves this through a memory-safe design that prevents access to unrelated memory, ensures expressions produce outputs only from their inputs with no state mutations, and guarantees termination to prevent infinite loops. The tool compiles expressions to bytecode and executes them on a virtual machine, combining an optimizing compiler with runtime safety guarantees.
Expr suits projects that need to accept dynamic configuration expressions from users or external sources while maintaining strict safety boundaries. It integrates directly with Go's type system, eliminating the need to redefine types when embedding the evaluator. The tool provides static type checking to catch errors at compile time, user-friendly error messages for debugging, and a straightforward syntax alongside built-in functions like filter, map, all, any, none, and one. Projects requiring high performance expression evaluation will benefit from its bytecode compilation approach.
Development activity shows consistent engagement with the project. The codebase receives regular updates and maintenance. The project maintains active documentation and provides multiple examples and playground environments for users to experiment with the language. Community contributions are integrated into the project, and the maintainers respond to issues and feature requests.