Skip to main content

Expression Language for Go

Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.

Expr Gopher mascot

Expressive and Intuitive

Write complex logic in simple, readable expressions.

Access Control

user.Group in ["admin", "moderator"] || user.Id == comment.UserId

Date Arithmetic

request.Time - resource.Age < duration("24h")

Collection Predicates

all(tweets, len(.Content) <= 240)

Why Expr?

Safe, fast, and intuitive expression evaluation optimized for Go.

Safe Execution

Memory-safe, side-effect-free, and always terminating. No access to unrelated memory or infinite loops.

Go Integration

Seamlessly integrates into Go projects without redefining types. Use your existing structs and maps directly.

Static Typing

Catches type errors at compile time, not runtime. Know your expressions are correct before executing them.

User-Friendly Errors

Clear, precise error messages with position indicators to help debug expressions quickly.

Built-in Functions

Rich set of built-in functions like all, none, any, one, filter, map, and more out of the box.

High Performance

Optimizing compiler with a bytecode virtual machine delivers best-in-class evaluation speed.

Trusted in Production

Used by leading companies and open-source projects worldwide.

GoogleUberByteDanceGoDaddyAlibabaArgoOpenTelemetryCrowdSecCoreDNSAviasalesChaos MeshKEDA

Install

Add Expr to your Go project with a single command.

go get github.com/expr-lang/expr

Ready to get started?

Read the documentation or explore the source on GitHub.