Skip to content

Releases: expr-lang/expr

v1.15.8

07 Jan 18:25
f631fd2
Compare
Choose a tag to compare

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

10 Dec 10:07
515f38b
Compare
Choose a tag to compare

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 to vm.Program. (#491)

v1.15.6

03 Dec 21:08
4391851
Compare
Choose a tag to compare
  • New module path expr-lang/epxr ⚠️
  • Added expr.WithContext() option to pass context to custom functions.
  • Added ast package comments.
  • Hidden internal fields in vm.Program.

v1.15.5

24 Nov 16:31
ad0e877
Compare
Choose a tag to compare
  • Added ceil(), floor() and round() function.
  • Fixed type checker for float arguments.

v1.15.4

16 Nov 22:02
939aca1
Compare
Choose a tag to compare
  • 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 with ast.Patch

v1.15.3

20 Sep 12:01
5916dc2
Compare
Choose a tag to compare
  • Added type checks to detect 42 in ["a"] as invalid.

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