Releases: expr-lang/expr
Releases · expr-lang/expr
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
})
v1.14.3
v1.14.2
v1.14.1
v1.14.0
Expr is a Go-centric expression language designed to deliver dynamic configurations with unparalleled accuracy, safety, and speed.
In this release:
-
New builtin functions:
- abs, int, float, string, max, min
- trim, trimPrefix, trimSuffix
- upper, lower
- split, splitN, splitAfter, splitAfterN
- replace, repeat, join, indexOf, lastIndexOf
- hasPrefix, hasSuffix
- toJSON, fromJSON, toBase64, fromBase64
- now, duration, date
- first, last, get
-
New pipe
|
operator.1..9 | filter(# < 5) | map(# * 2)
To enable the pipe operator add
expr.ExperimentalPipes()
option.program, err = expr.Compile(code, expr.ExperimentalPipes())
-
New repl with interactive debugger.
v1.13.0
Expr is a Go package that offers a fast, simple, and safe engine for compiling and evaluating expressions. Ideal for implementing complex logic in configuration, it serves as a foundation for a dynamic business rule engine without the need for recompiling the program.
all(Tweets, .Len <= 240)
- Refactor deref by @antonmedv in #398