Releases: expr-lang/expr
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
v1.12.7
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.
- Added new opcode
OpInvalid
for debugging purposes.
v1.12.6
What's Changed
- Churn: remove duplicate codes by @Schneizelw in #356
- Fix: fixed a compilation error. by @PranavPeshwe in #355
- Doc: update Visitor-and-Patch.md by @mdmcconnell in #369
- Feature: env[] keyword implemented in parser by @mdmcconnell in #382
New Contributors
- @Schneizelw made their first contribution in #356
- @PranavPeshwe made their first contribution in #355
- @mdmcconnell made their first contribution in #369
Full Changelog: v1.12.5...v1.12.6