Skip to content

Releases: 01mf02/jaq

2.0-epsilon

18 Nov 10:56
Compare
Choose a tag to compare
2.0-epsilon Pre-release
Pre-release

This release improves the performance of many function calls #226.
Furthermore, it allows passing non-UTF-8 file paths as command-line options #234 and improves compatibility for command-line options in general, in particular around -f and --args.
Finally, it now interprets search paths via -L as relative to the current working directory, improving compatibility with jq #228.

This is hopefully the last release before jaq 2.0. I'm aiming for a small number (ε) of changes between this release and the final version.

Full Changelog: v2.0.0-delta...v2.0.0-epsilon

2.0-delta

08 Nov 10:20
Compare
Choose a tag to compare
2.0-delta Pre-release
Pre-release

New features

  • Support --args #224
  • Add missing gamma/0 math function, thanks to @wader #222

Improvements

  • Use regex-lite instead of regex 0840b1b: This can drastically decrease the compile time of regexes, at the cost of increasing regex execution time. This also increases the MSRV (minimal supported Rust version) for jaq, jaq-std, and jaq-json to 1.65.
  • Improve compiler complexity #223

Bug fixes

All following bugs were detected by @wader, who has relentlessly worked with me on getting jqjq to work with jaq (#216). My heartfelt thanks go out to you, @wader!

  • Correct tail recursion optimisation (TCO) #223
  • Correct destructuring behaviour 4560c86
  • Correct empty regex behaviour #221

Full Changelog: v2.0.0-gamma...v2.0.0-delta

2.0 gamma

23 Oct 10:05
Compare
Choose a tag to compare
2.0 gamma Pre-release
Pre-release

This release adds support for patterns in variable bindings, also known as destructuring.
Furthermore, this release more lazily evaluates the right-hand side of concatenation (,) #220.

Finally, rounding functions now actually round to integer values, thanks to @null-dev #219.

Full Changelog: v2.0.0-beta...v2.0.0-gamma

2.0 beta

11 Oct 09:56
Compare
Choose a tag to compare
2.0 beta Pre-release
Pre-release

The highlight of this release likely is the comeback of foreach/3 840aa77. I removed this in jaq 0.9.0 because I was not able to implement foreach/2 and foreach/3 without duplicating lots of code. In the meantime, however, I found a nice way to implement all of foreach/3, foreach/2, and reduce/2 using the same code.

As a consequence, this release removes for/2 f44a224. The addition of foreach/3 would have made it logical to also add for/3, but unfortunately, for/3 can only be implemented in a quite awkward way. Because for/2 was a jaq-only experiment anyway, it felt better to remove it. This change also increases compatibility with jq, because it allows using for as function name in both jq and jaq.

This release now short-circuits on errors in try ... catch ... c83749a. Previously, try f catch g would run g for all errors produced by f, whereas now, it stops after the first error.
As a result of this, jaq now terminates for all examples in the jq manual, meaning that jaq --run-tests man.test runs the whole test suite generated from the manual without "getting stuck". (jaq passes 187 out of 227 tests in the current man.test.)

New functions

Smaller changes

  • Expand ~ and $ORIGIN at the start of search paths c3f9259
  • Correct printing of UTF-8 encoded characters in strings #209
  • More consistent date formatting #214
  • Omit clones in .[f] |= g for higher performance 0eaa0f0
  • Custom value types now must implement Default ad74938
  • Change name format of released binaries #211

New Contributors

Full Changelog: v2.0.0-alpha.1...v2.0.0-beta

2.0 alpha.1

02 Sep 14:22
Compare
Choose a tag to compare
2.0 alpha.1 Pre-release
Pre-release

This release corrects the handling of search paths that contain more than one element in its array. For example:

include "path" {search: ["foo", "bar"]};

Full Changelog: v2.0.0-alpha...v2.0.0-alpha.1

2.0 alpha

02 Sep 10:51
Compare
Choose a tag to compare
2.0 alpha Pre-release
Pre-release

This release brings many new features to jaq:

  • Module & data import: You can now include and import modules like in jq with include "path"; or import "path" as mod;, as well as import data (JSON) files with import "path" as $data;. Each import/include directive can be followed by (optional) metadata, of which the search attribute is considered.
  • label...break expressions: label $x | f | ., break $x returns at most one output of f.
  • //= operator: thanks to @bb010g #142!
  • Nested definitions: You can now put definitions into any subterm, e.g. 1 + def a: 2; a is now valid.
  • (l // r) |= f can now be executed 2daf986.

Under the hood, the jaq compiler has been completely rewritten to allow for these changes.
Furthermore, the API has seen a complete overhaul, hopefully making it easier to use #188:

  • jaq-core now handles parsing, compilation, and execution.
  • jaq-std now includes all standard library filters, both implemented by definition and as native functions.
  • jaq-json implements JSON support for jaq.

As a result, jaq-core and jaq-std are completely agnostic towards their data format. This makes jaq a good choice also for processing non-JSON data.

In particular, feedback for the new API is solicited.

Full Changelog: v1.6.0...v2.0.0-alpha

1.6

30 Jul 09:43
Compare
Choose a tag to compare

This version includes a completely rewritten parser which massively increases speed and decreases build time, see #196.
Furthermore, it allows using keywords as object keys (e.g. {if: 1}.if).

This is most likely the last stable release before jaq 2.0, which will bring support for label...break and modules.

Smaller Changes

  • Support building on armv6, thanks to @tranzystorekk #193
  • Use chrono instead of time to make jaq build on Rust 1.80 #199
  • Update hifijson to correctly handle control characters in strings (01mf02/hifijson#3)

New Contributors

Full Changelog: v1.5.1...v1.6.0

1.5.1

07 Jul 11:20
Compare
Choose a tag to compare

This release reintroduces the @base64d filter that was accidentally removed in 1.5 (#192).
Furthermore, jaq now respects the NO_COLOR environment variable (#189).

Full Changelog: v1.5.0...v1.5.1

1.5

26 Jun 10:18
Compare
Choose a tag to compare
1.5

This release finishes the work started in jaq 1.4 towards making jaq being able to process non-JSON values. In particular, a vast majority the filters in jaq's core library can now process any kind of value that satisfies certain conditions; see the corresponding PR. Currently, this is mostly interesting for people who want to use jaq as an API.

Compilation errors

Since about two months, the compilation of jaq via cargo install jaq failed. This happened because a dependency of jaq called ariadne (responsible for printing compilation errors in jaq) broke semantic versioning. Unfortunately, despite the issue being known upstream, at the time of writing there has been no action towards resolving this problem. This put jaq in an awkward position and was somewhat ironic: the library responsible for reporting compilation errors caused compilation errors.

Eventually, I decided to resolve this problem by replacing ariadne. After having evaluated a number of alternative code span printing libraries, such as miette and codespan-reporting, I wrote a new library called codesnake. Starting from this release, codesnake is in charge for formatting code that is printed during compilation errors in jaq. One direct benefit of this change is that compilation errors are now also colored on the jaq playground.

At this point, I would like to thank @zesterer for having created and maintained ariadne. Without it, the error reporting in jaq would not be close to what it is today.

Smaller changes

This release corrects escaping of special characters in strings; in particular, newlines tabs, and quotes (") were not correctly escaped. For example, for the filter "\n" | tojson, jaq 1.4 yields "\"\n\"", whereas jaq 1.5 yields "\"\\n\"" (the difference being an additional backslash before n). Among others, this shows up in string interpolation ("\(.)"), tostring, and tojson.

Apart from ariadne, this release also removes another dependency, namely colored_json. This makes it possible to print output values without first converting them to a format that colored_json can interpret (serde_json::Value). This should favourably influence the performance of printing output values. In the long run, this will allow to remove jaq's dependency on serde, further contributing to shorter compilation times and smaller binary size.

Furthermore, when using --color never, compilation errors are now also printed without colors (#177).

Full Changelog: v1.4.0...v1.5.0

1.4

23 May 17:06
Compare
Choose a tag to compare
1.4

Work on this release has been sponsored by the NLnet foundation, to whom I would like to express my deep gratitude.

This release brings an exciting new addition: the jaq playground! Unlike its counterpart, the jq playground, the jaq playground runs jq filters on your computer and does not send data to a server to process it there. This makes it also suitable to run filters that yield an infinite number of outputs. For more details, see here.

The other big change is that when jaq is used as a library, you can now use it to process custom types of values. That makes it possible to adapt jaq to process non-JSON data, similarly to fq. See ValT for a description of the functions that every value type has to provide. (Thanks to @wader for providing feedback!)
In this version, the core and standard libraries of jaq (which provide named functions, such as length) still only provide functionality for JSON, but I plan to also change this in the future.

New features

  • New command-line options: --indent and --tab by @chutz #153
  • New filters: indices, index, and rindex by @kklingenberg #158 #165
  • Division of strings (string splitting) #167
  • Subtraction of arrays #164

Smaller changes

  • Fall back to regular file loading if memory mapping fails #168
  • More cleanly handle range(from; upto; 0) #170
  • Provide binary builds for aarch64-apple-darwin (Apple Silicon) by @amitksingh1490 #166
  • Make jaq-interpret tests pass on 32-bit platforms by @nekopsykose #159
  • Add Windows install (Scoop) instructions by @IndyV in #171

New Contributors

Full Changelog: v1.3.0...v1.4.0