Releases: 01mf02/jaq
2.0.1
2.0
jaq is a jq clone focussed on correctness, speed, and simplicity.
Compared to jaq 1.x, jaq 2.0 adds support for many features of the jq programming language.
As a result, jaq can now run jqjq, a jq interpreter written in jq itself, which has a code base of more than 3000 lines of jq code!
The largest single change in jaq 2.0 is support for jq's module system, allowing jaq to import module and data files (alpha).
Furthermore, the libraries underlying jaq are now agnostic towards their data format. This makes jaq a candidate for embedding it as language interpreter into other applications for processing non-JSON data.
Under the hood, jaq's compiler component has been completely rewritten to allow for the changes in jaq 2.0.
New syntax:
New command-line parameters:
I would like to thank all people that have contributed to this release, in particular @wader for extensively testing jaq, contributing features and adapting jqjq to make it work with jaq. It has been a joy working with you!
My work on jaq since version 1.4 has been sponsored by the NLnet foundation, to whom I would like to express my deep gratitude for letting me live my dream.
2.0-epsilon
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
New features
Improvements
- Use
regex-lite
instead ofregex
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) forjaq
,jaq-std
, andjaq-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
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
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
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
This release brings many new features to jaq:
- Module & data import: You can now include and import modules like in jq with
include "path";
orimport "path" as mod;
, as well as import data (JSON) files withimport "path" as $data;
. Each import/include directive can be followed by (optional) metadata, of which thesearch
attribute is considered. - label...break expressions:
label $x | f | ., break $x
returns at most one output off
. //=
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
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 oftime
to make jaq build on Rust 1.80 #199 - Update
hifijson
to correctly handle control characters in strings (01mf02/hifijson#3)
New Contributors
- @tranzystorekk made their first contribution in #193
Full Changelog: v1.5.1...v1.6.0
1.5.1
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