# antonmedv/expr

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/antonmedv-expr).**

7,905 stars · 504 forks · Go · MIT

## Links

- GitHub: https://github.com/antonmedv/expr
- Homepage: https://expr-lang.org
- awesome-repositories: https://awesome-repositories.com/repository/antonmedv-expr.md

## Description

Expr is a high-performance expression evaluation engine and language for Go applications. It functions as a dynamic rule engine that parses and executes custom logic and data validations at runtime without requiring the application to be recompiled.

The system utilizes a sandboxed logic executor to run expressions without side effects. It ensures program termination by employing instruction-level loop detection to prevent infinite loops and isolates the evaluation process from the host system.

The engine employs a bytecode-based virtual machine and abstract syntax tree analysis to achieve execution. It includes static type resolution and runtime type validation to ensure data correctness, using reflection to map external object properties to expression identifiers.

## Tags

### Programming Languages & Runtimes

- [Expression Evaluators](https://awesome-repositories.com/f/programming-languages-runtimes/expression-evaluators.md) — Provides a high-performance engine for parsing and executing custom logical expressions at runtime. ([source](https://github.com/antonmedv/expr#readme))
- [Bytecode Virtual Machines](https://awesome-repositories.com/f/programming-languages-runtimes/bytecode-virtual-machines.md) — Compiles expressions into low-level bytecode for high-speed execution via a custom virtual machine.
- [Embedded Logic Evaluation](https://awesome-repositories.com/f/programming-languages-runtimes/embedded-logic-evaluation.md) — Integrates an expression parser and evaluator to execute custom logic within Go applications without recompilation.
- [Type Validation](https://awesome-repositories.com/f/programming-languages-runtimes/expression-evaluators/type-validation.md) — Implements type correctness checks during expression evaluation to ensure consistent data handling. ([source](https://github.com/antonmedv/expr#readme))
- [Expression Languages](https://awesome-repositories.com/f/programming-languages-runtimes/expression-languages.md) — Implements a custom expression language for defining dynamic logic within Go applications.
- [Runtime Type Validation](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-type-validation.md) — Verifies that dynamic expressions adhere to specific data types during execution to ensure behavioral correctness.
- [Logic Sandboxing](https://awesome-repositories.com/f/programming-languages-runtimes/go-runtime-stability/logic-sandboxing.md) — Safely runs untrusted user-provided logic within Go programs to prevent crashes and infinite loops.

### Software Engineering & Architecture

- [Abstract Syntax Tree Parsing](https://awesome-repositories.com/f/software-engineering-architecture/abstract-syntax-tree-parsing.md) — Converts source text into a structured tree for semantic validation and type checking before execution.
- [Dynamic Rule Engines](https://awesome-repositories.com/f/software-engineering-architecture/dynamic-rule-engines.md) — Functions as a dynamic rule engine that parses and executes custom logic and data validations at runtime.
- [Sandboxed Execution Environments](https://awesome-repositories.com/f/software-engineering-architecture/sandboxed-execution-environments.md) — Isolates the expression evaluation process from the host system to prevent unauthorized side effects.
- [Expression Type Resolution](https://awesome-repositories.com/f/software-engineering-architecture/typescript-type-definitions/static-type-checking/expression-type-resolution.md) — Determines expected data types during compilation to avoid runtime type mismatches.
- [Loop Detection](https://awesome-repositories.com/f/software-engineering-architecture/conditional-iteration/infinite-loop-execution/loop-detection.md) — Employs instruction-level loop detection to ensure program termination and prevent infinite loops.
- [Dynamic Property Mapping](https://awesome-repositories.com/f/software-engineering-architecture/reflection-based-unmarshallers/reflection-based-property-accessors/dynamic-property-mapping.md) — Uses Go reflection to dynamically map external object properties and methods to expression identifiers.

### Business & Productivity Software

- [Business Rule Engines](https://awesome-repositories.com/f/business-productivity-software/business-rule-engines.md) — Enables the creation of systems where non-developers can define business logic using a simplified language.

### Security & Cryptography

- [Execution Sandboxes](https://awesome-repositories.com/f/security-cryptography/execution-sandboxes.md) — Restricts the execution environment of dynamic expressions to prevent unauthorized system access and infinite loops. ([source](https://github.com/antonmedv/expr#readme))

### Part of an Awesome List

- [Scripting Languages](https://awesome-repositories.com/f/awesome-lists/devtools/scripting-languages.md) — Fast, non-Turing complete expression evaluation engine.
