Skip to content

0.10.0

Compare
Choose a tag to compare
@01mf02 01mf02 released this 06 Mar 12:03
· 926 commits to main since this release

jaq is a jq clone with a focus on correctness, speed, and simplicity.
jaq 0.10.0 improves JSON parsing speed, supports regular expression filters and walk(f), and improves compatibility of foreach syntax and arguments handling.

Details:

  • JSON parsing: This release parses JSON using the new hifijson crate instead of serde_json.
    This increases JSON parsing performance, in one benchmark by up to 87% compared to jaq 0.9.0 and by 68% compared to jq.
  • Regular expressions: The filters test, scan, match, capture, splits, sub, gsub are now supported.
    Note that for named capture groups, the syntax (?<name>exp) is not supported when installing jaq by cargo install jaq;
    however, it is supported when installing jaq using cargo build, cargo install --path jaq or cargo install --git https://github.com/01mf02/jaq.
    This is because the underlying crate for parsing regular expressions, regex-syntax, does not support the (?<name>exp) syntax at the time of writing, so jaq currently uses a patched version of this crate, which is however not considered by cargo install jaq. In the future, the (?<name>exp) syntax is likely to be included in regex-syntax, which will make the (?<name>exp) syntax available also when installing jaq via cargo install jaq.
  • foreach, for: In jq 0.9, the semantics of foreach xs as $x (init; f) were changed such that it yielded the output of init, unlike jq. Following some discussion, the suggestion by @pkoppstein was implemented that restored the previous semantics of foreach, while introducing a new filter for xs as $x (init; f) that yields the output of init. More information can be found in the README.
  • Arguments handling: The --slurpfile and --rawfile options are now supported. Furthermore, arguments (such as passed by --arg a b) are now bound to $ARGS.

New Contributors

Full Changelog: v0.9.0...v0.10.0