Expression language and expression evaluation for Go
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
output, err := expr.Eval("metric > 100", map[string]any{
"metric": 200,
})
In this release:
sum()
builtin (#592)sum()
compiler optimization c2b609e edb1b5aWithContext
to work for methods on env struct (#602)count()
builtin: now predicate is optional 725b702Expr Editor
The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.
Expr Pro
Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.
This release reverts a wrong compiler optimization for all, any, one, none predicates (#555).
The optimization contains error logic which can lead to a wrong expression.
It is highly recommended to upgrade to the latest version.
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
program, err := expr.Compile(`let x = 2 + 2; x ^ x`)
output, err := expr.Run(program, env)
In this release:
{(foo + bar): 42}
Expr Editor
The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.
Expr Pro
Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
program, err := expr.Compile(`now() - created_at < duration("24h")`)
output, err := expr.Run(program, env)
In this release:
1 < 2 < 3
(#581)int
: unwraps underlying int value (#611)min
, max
, sum
, mean
, median
(#580, #576)reflect.DeepEqual
(#585)expr.Operator
passes before expr.Env
caused error (#606)-1 not in []
expressions (#590)Expr Editor
The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.
Expr Pro
Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
program, err := expr.Compile(`now() - created_at < duration("24h")`)
output, err := expr.Run(program, env)
In this release:
?.[
operator (ffaec9e)groupBy()
and sortBy()
builtins (#562)expr.Function()
(#408)concat()
builtin (#565)reverse()
builtin (#553)program.Locations()
method (e53cefe)array?.[42]
(#550)all
, any
, one
, none
functions (#555)Expr Editor
The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.
Expr Pro
Expr Pro is a set of extensions for Expr for advanced use cases. It includes expressions explanation, performance profiling, and more.
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
.Node()
(#528)Valuer
patcher (#525)expr.WarnOnAny()
optionexpr.As*()
options behavior to accept any
by defaultany
type in type checkerIn addition to open-source version of Expr, we have an embeddable Expr Editor and Expr Pro packages.
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
output, err := expr.Eval(`now() - created_at < duration("24h")`, env)
In this release
`raw string`
The Expr Editor is an embeddable code editor written in JavaScript with full support of Expr language.
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
$env
. (#495)GetSource()
method to vm.Program
. (#491)expr-lang/epxr
⚠️expr.WithContext()
option to pass context to custom functions.vm.Program
.ceil()
, floor()
and round()
function.