> <i>[[]] | implode crashes jq, and this was not fixed at the time of writing despite being known since five years.</i><p>Well, taking into account that jq development has been halted for 5 years and only recently revived again, it's no wonder that bug reports have been sitting there for that time, both well known and new ones. I bet they'll get up to speed and slowly but surely clear the backlog that has built up all this time.
It's so awesome when projects shout out other projects that they're similar to or inspired by or not replacements for. I learned about <a href="https://github.com/yamafaktory/jql">https://github.com/yamafaktory/jql</a> from the readme of this project and it's what I've been looking for for a long time, thank you!<p>That's not to take away from JAQ by any means I just find the JQ style syntax uber hard to grokk so jql makes more sense for me.
I love the idea of jq but i use it infrequently enough that I have to search the manual for how to use their syntax to get what I want.<p>Sadly 99% of what I do with jq is “| jq .”
<a href="https://github.com/01mf02/jaq/blob/main/Cargo.lock">https://github.com/01mf02/jaq/blob/main/Cargo.lock</a><p>That's a lot of dependencies..
While jq is a very powerful tool, I've also been using DuckDB a lot lately.<p>SQL is a much more natural language if the data is somewhat tabular.
I guess it's cute that there's some terminal line art library in Rust somewhere, but when I tried to invoke jaq it just pooped megabytes of escape codes into my iTerm and eventually iTerm tried to print to the printer. Too clever.<p>I tried to do `echo *json | rush -- jaq -rf ./this-program.jq {} | datamash ...` and in that context I don't think it's appropriate to try to get artistic with the tty.<p>The cause of the errors, for whatever it's worth, is that `jaq` lacks `strftime`.
My first impression is it has fancy error messages but no halt_error/0<p><pre><code> $ ./jaq-v1.2.0-x86_64-unknown-linux-gnu -sf aoc22-13.jq input.txt
Error: undefined filter
╭─[<unknown>:30:18]
│
30 │ ╭─▶ "bad input" | halt_error
31 │ ├─▶ end;
│ │
│ ╰───────────────── undefined filter
────╯
</code></pre>
and (after commenting out halt_error) slower than both jq and gojq<p><pre><code> $ time jq -sf aoc22-13.jq input.txt
6415
20056
real 0m0.023s
user 0m0.010s
sys 0m0.010s
$
$ time gojq -sf aoc22-13.jq input.txt
6415
20056
real 0m0.070s
user 0m0.030s
sys 0m0.000s
$
$ time ./jaq-v1.2.0-x86_64-unknown-linux-gnu -sf aoc22-13.jq input.txt
6415
20056
real 0m0.103s
user 0m0.065s
sys 0m0.000s
</code></pre>
aoc22-13.jq is here <a href="https://pastebin.com/raw/YiUjEu2n" rel="nofollow noreferrer">https://pastebin.com/raw/YiUjEu2n</a>
and input.txt is here <a href="https://pastebin.com/raw/X0FSyTNf" rel="nofollow noreferrer">https://pastebin.com/raw/X0FSyTNf</a>
The fact that jq takes almost a second to run on a Pi is crazy[0]. And the tool is written in C.<p>[0] <a href="https://github.com/jqlang/jq/issues/1411">https://github.com/jqlang/jq/issues/1411</a>
><i>nan > nan is false, while nan < nan is true.</i><p>If this wrong behavior from jq, or some artifact consistent with how the floating point spec is defined, surprising, but faithful to IEEE 754 nonetheless?
The 2nd and 3rd examples make no sense to me.<p>echo '{"a": 1, "b": 2}' | jaq 'add'<p>3<p>Construct an array from an object in two ways and show that they are equal:<p>$ echo '{"a": 1, "b": 2}' | jaq '[.a, .b] == [.[]]'<p>true
I find jq's syntax (and docs) kind of opaque, but I guess we have no other options. And I don't think this latest incarnation breaks any new ground there. But it'd be better if I just wrote it myself - "be the change ...."
I think the best alternative for JQ is datawave, but it is not open source. <a href="https://dataweave.mulesoft.com/" rel="nofollow noreferrer">https://dataweave.mulesoft.com/</a>
> nan > nan is false, while nan < nan is true.<p>You learn something new everyday. Does anyone have any idea why this might be happening? Seems like more than just a bug..
and in powershell you don't need to learn all those syntaxes for different tools for different formats like jq, xmlstarlet, etc. Just convert everything to an object and query the data by using powershell syntax
I applaud this project's focus on correctness and efficiency, but I'd also really like a version of `jq` that's easy to understand without having to learn a whole new syntax.<p>`jq` is a really powerful tool and `jaq` promises to be even more powerful. But, as a system administrator, most lot of the time that I'm dealing with json files, something that behaved more like grep would be sufficient.
jq have been in my toolbox since a while it’s a very great tool. But yet another query language to learn, jaq seems identical on that. I think that’s where LLMs can help a lot to make it easier for adoption, I started a project on that note to manipulate the data just with natural language, <a href="https://partial.sh" rel="nofollow noreferrer">https://partial.sh</a><p>‘cat’ your json file and describe what you want I think should be the way to go
Somewhat off-topic, but is there a tool which integrates something like this/jq/fx and API requests? I’d like to be able to do some ETL-like operations and join JSON responses declaratively, without having to write a script.
I think my benchmark[1] would be a great test for this. The jq[2] version takes 50s on my machine.<p>[1] : <a href="https://github.com/jinyus/related_post_gen">https://github.com/jinyus/related_post_gen</a><p>[2]: <a href="https://github.com/jinyus/related_post_gen/blob/main/jq/related.jq">https://github.com/jinyus/related_post_gen/blob/main/jq/rela...</a>