For everyone pining for a Jq with a different syntax: I have a bunch of links to alternatives collected, you might want to try some of them (some may be for different things than JSON):<p><a href="https://github.com/fiatjaf/awesome-jq" rel="nofollow">https://github.com/fiatjaf/awesome-jq</a><p><a href="https://github.com/TomConlin/json2xpath" rel="nofollow">https://github.com/TomConlin/json2xpath</a><p><a href="https://github.com/antonmedv/fx" rel="nofollow">https://github.com/antonmedv/fx</a><p><a href="https://github.com/fiatjaf/jiq" rel="nofollow">https://github.com/fiatjaf/jiq</a><p><a href="https://github.com/simeji/jid" rel="nofollow">https://github.com/simeji/jid</a><p><a href="https://github.com/jmespath/jp" rel="nofollow">https://github.com/jmespath/jp</a><p><a href="https://github.com/cube2222/jql" rel="nofollow">https://github.com/cube2222/jql</a><p><a href="https://jsonnet.org" rel="nofollow">https://jsonnet.org</a><p><a href="https://github.com/borkdude/jet" rel="nofollow">https://github.com/borkdude/jet</a><p><a href="https://github.com/jzelinskie/faq" rel="nofollow">https://github.com/jzelinskie/faq</a><p><a href="https://github.com/dflemstr/rq" rel="nofollow">https://github.com/dflemstr/rq</a><p>Personally I think that next time I might just fire up Hy and use its functional capabilities.
1) refuses to operate on stdin; requires a filename argument, which is so irritating.<p>2) doesn't accept values that jq accepts<p><pre><code> % time jq -r '[expression]' < parcels | wc
365 1454 7978
jq -r < parcels 1.39s user 0.00s system 99% cpu 1.390 total
wc 0.00s user 0.00s system 0% cpu 1.390 total
% time ~/.yarn/bin/q '[expression]' parcels | wc
q: internal error, uncaught exception:
Yojson.Json_error("Line 56, bytes -1-32:\nJunk after end
of JSON value: '{\n \"OBJECTID\": 155303,\n \"BOOK\"'")</code></pre>
Are we sure it should get a single-letter 'q' binary name though? Docs seem to point that it's short for 'query-json'? Why not call it 'query-json' and let the user decide that as a shell alias or whatever. Even the ubiquitous 'ls' and 'cd' are two characters.
This looks interesting, but could be confusing given the programming language of the same name (<a href="https://code.kx.com/q/" rel="nofollow">https://code.kx.com/q/</a>)
> Aside from that, q isn't feature parity with jq which is ok at this point, but jq contains a ton of functionality that query-json misses and some of the jq operations aren't native, are builtin with the runtime. In order to do a proper comparision all of this above would need to take into consideration.<p>> The report shows that q is between 2x and 5x faster than jq in all operations tested and same speed (~1.1x) with huge files (> 100M).<p>While faster for somethings....that's a pretty large set of caveats!
Would be good if someone adds an explanation why this new approach is better, is it that the OCaml is faster, more efficient algorithms were used, etc?
Hm, I thought q is synonym for querying CSV files <a href="https://harelba.github.io/q/" rel="nofollow">https://harelba.github.io/q/</a>
As an outsider I get very confused by the Reason / Reason Native / OCaml / Bucklescript / Rescript?! ecosystem. What does it mean for it to be written in Reason Native/OCaml?
I used to be a regular user of jq, but I was never parsing very large JSON. I now do what I used to do with jq in my browser's developer tools console. Map and filter are far more familiar than jq's syntax where I found myself referring to the documentation most of the time.<p>I'm sure other people have use cases where the browser wouldn't meet their needs, but for me, I find jq unnecessary.
The speed is not concern for me. I am wondering if there something better than `jq` in terms of syntax. Whenever I want to get something more that just prettify json output in the console or simply get value by specific field name I have a problem, for me it is just difficult to remember jq syntax without looking into history. As well have in my notes links to examples like this one<p><a href="https://mosermichael.github.io/jq-illustrated/dir/content.html" rel="nofollow">https://mosermichael.github.io/jq-illustrated/dir/content.ht...</a>
In case anyone is interested in yet another alternative, I have this old, unpolished project: <a href="https://github.com/bauerca/jv" rel="nofollow">https://github.com/bauerca/jv</a><p>It is a JSON parser in C without heap allocations. The query language is piddly, but the tool can be useful for grabbing a single value from a very large JSON file. I don't have time for it, but someone could fork and make it a real deal.
If you're into Clojure, check out <a href="https://github.com/borkdude/jet" rel="nofollow">https://github.com/borkdude/jet</a>
Slightly out of context here, I find the entire stack of bsb, bsb-native, ocaml and esy pretty cool. However, I just dont find enough resources, good tutorials etc on Google search. Is there a good set of beginner tutorials anyone can point to ? Thanks in advance.
This is cool, but I’m not sure it’s fair to claim it’s “faster” yet when it doesn’t do 95% of what jq does—-particularly the command line options. If it’s still faster when you can match 80% of the functionality, then it might be a claim worth making.
I'd love to hear some speculation - from the author or otherwise - as to why a fresh OCaml implementation would so dramatically outperform a mature C implementation