Releases: expr-lang/expr
Releases · expr-lang/expr
v1.15.8
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
- Added builtin functions for bit operations. (#496)
- Added support for raw string literals. (#485)
`raw string`
- Fixed type checker panic on embedded pointer to struct field. (#500)
- Removed redundant fields from ast nodes. (#504) (#503)
- Improved Language Definition documentation.
Expr Editor
The Expr Editor is an embeddable code editor written in JavaScript with
full support of Expr language.
v1.15.7
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
In this release:
- Fixed commutative property for comparison between a value and a pointer. (#490)
- Checker: forbid accessing built-ins and custom functions from
$env
. (#495) - Enhanced the number parser to include support for parsing hexadecimal, binary, and octal literals. (#483)
- Added
GetSource()
method tovm.Program
. (#491)
v1.15.6
v1.15.5
v1.15.4
- Improved type checking for
$env
- Added support for floats in
sort()
built-in - Fixed: AST printing for
??
operator - Fixed: only emit
OpEqual{Int,String}
for simple types - Fixed: fetch without
OpDeref
(#467) - Docs: categorize Language Definition functions (#452)
- Changed:
ast.Node
type now is not copied withast.Patch
v1.15.3
v1.15.2
v1.15.1
v1.15.0
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
In this release:
- Added support for variables.
let foo = filter(tweets, .Text contains "foo"); let name = foo?.Author?.Name ?? "unknown"; upper(name)
- Added configuration to enable/disable builtin functions.
- Added a bunch of optimizations for builtin function combinations:
len(filter())
andmap(filter())
filter()[0]
andfilter()[-1]
- Added a bunch of new builtin functions:
sort
,sortBy
groupBy
toPairs
,fromPairs
take
,reduce
,mean
,median
.
- Fixed in-range optimization to be only applied to integers.
- Fixed float folding optimization.
- Fixed duration*integer mutliplications.
- Improved language and developer documentation.
Examples:
tweets | filter(.Size < 280) | map(.Content) | join(" -- ")
filter(posts, {
let span = now() - .CreatedAt;
let limit = 7 * duration("24h");
span >= limit
})