Skip to content

Releases: expr-lang/expr

v1.15.2

12 Sep 14:12
709c5dd
Compare
Choose a tag to compare
  • Propagate uint32 func argument types in AST (#438)

v1.15.1

06 Sep 08:40
01c358d
Compare
Choose a tag to compare
  • Fixed type checker for the in operator.
  • Fixed memory budget calculations for ranges.

v1.15.0

31 Aug 07:53
Compare
Choose a tag to compare

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

expr repl demo

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()) and map(filter())
    • filter()[0] and filter()[-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

21 Aug 20:44
c2c7603
Compare
Choose a tag to compare
  • Fixed builtin type checks for any

v1.14.2

21 Aug 10:01
cc5d294
Compare
Choose a tag to compare
  • Fixed slice node String() with omitted from or to fields.

v1.14.1

20 Aug 20:05
8cd12a9
Compare
Choose a tag to compare
  • Added ast.String() to nodes.
  • Added keys(), values() and type() builtins.
  • Added the ability to disable builtins via expr.DisableBuiltin().
  • Fixed bunch of errors with corner cases in type checkers.

v1.14.0

16 Aug 09:52
8f2cfbf
Compare
Choose a tag to compare

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

expr repl demo

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

10 Aug 22:38
e646a93
Compare
Choose a tag to compare

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)

v1.12.7

19 Jul 13:26
d2100ec
Compare
Choose a tag to compare

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

12 Jul 09:03
3c23d10
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.12.5...v1.12.6