Live data from Hacker News

Jaq – A jq clone focused on correctness, speed, and simplicity

github.com

61–70 of 254 posts

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#61
post #28

Earlier quoted context omitted.

That's my whole point. The tools for navigating, transforming, streaming, parsing, etc. XML are genuinely terrific, like nothing else, and it's demoralizing to see younger devs throw it all away because they prefer not to have to learn anything with more than trivial complexity.

I'm not sure if there is any open source XSLT tool as complete as jq is for JSON. There is xsltproc but IIRC it does not support streaming scenarios (jq has some support for streaming processing) Though, personally, I prefer JSON. Probably due to superior tools (thanks to its popularity) and less-bloated syntax (it is somewhat easier for me to read raw JSON file than raw XML file).

I think XPath would be the XML analog to jq.

It would be cool to be able to use XPath to query JSON. Of course you'd need to come up with a good mapping between JSON nodes and XML nodes.

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#62
post #60

Earlier quoted context omitted.

Jaques is the French spelling of Jack/Jaak/Jak/Jaq. They're all pronounced the same, modulo irrelevant differences in vowel sounds.

- Is the text French? - No. QED.

- Is the word French?

- Yes.

QED.

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#63
post #28

Earlier quoted context omitted.

That's my whole point. The tools for navigating, transforming, streaming, parsing, etc. XML are genuinely terrific, like nothing else, and it's demoralizing to see younger devs throw it all away because they prefer not to have to learn anything with more than trivial complexity.

I'm not sure if there is any open source XSLT tool as complete as jq is for JSON. There is xsltproc but IIRC it does not support streaming scenarios (jq has some support for streaming processing) Though, personally, I prefer JSON. Probably due to superior tools (thanks to its popularity) and less-bloated syntax (it is somewhat easier for me to read raw JSON file than raw XML file).

If XML tools aren't open enough for certain needs, then sure, I get it. But it's tragic to see highly-engineered, pro solutions just die out because younger devs don't like the learning challenge or because business owners are cheapskates.

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#64
post #15

Earlier quoted context omitted.

$ hyperfine -w 100 -m 1000 -L bin jq,jaq "echo '[1,2,3]' | {bin} '.[1]'" Summary echo '[1,2,3]' | jaq '.[1]' ran 1.57 ± 0.15 times faster than echo '[1,2,3]' | jq '.[1]' Bring on the competition!

As the benchmarks show, jaq is pretty significantly faster than jq. I've commented before that I expect Rust to be a language that is generally faster than even C or C++ in a way that's hard to capture in small benchmarks, because the borrow checker permits code to be written safely that does less copying that other languages have to do for safety. Given the nature of what jq/jaq does, I wouldn't be surprised that th…

I'm pretty sure you could do this using hardware performance counters, but I never actually tried, so I might be wrong

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#65

Earlier quoted context omitted.

Barely. Not enough to be a hinderance to mutual understanding.

To me, the proper pronunciation of Jacques sounds more like "Jock", so it does seem to be more than barely significant.

Does this https://www.bing.com/videos/riverview/relatedvideo?q=Jacques... really sound like Jock to you? There is a significant sharp "æ" sound, the same as in Jack/dʒæk

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#66
post #3

While jq is a very powerful tool, I've also been using DuckDB a lot lately. SQL is a much more natural language if the data is somewhat tabular.

I like textql [0] better for this use case, as it's simpler in my mind.

[0] https://github.com/dinedal/textql

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#67
post #7

This language must be the spiritual successor of Perl

I inherited some piece of code that made use of an extremely long and complicated jq script.

I simply gave up understanding the whole thing, and restored the balance in the universe by rewriting it in Perl.

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#68
post #6

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. `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.

It is a little early to say, but I have been learning how nushell deals with structured data and it seems like it is very usable for simple cases to produce readable one-liners, and if you need to bring out the big guns the shell is also a full fledged scripting language. Don't know about how efficient it is though.

It needs to justify moving to a completely different shell, but the way you deal with data in general does not restrict itself to manipulating json, but also the output of many commands, so you kinda have one unified piping interface for all these structured data manipulations, which I think is neat.

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#69
post #22

[flagged]

How would you pronounce `jaq` other than `Jaques`[1]? It seems to be the default pronunciation. [1] https://www.bing.com/videos/riverview/relatedvideo?q=Jacques...

"Yak", just like "javascript" is pronounced "yavascript"[1], and "JIF" peanut butter is pronounced "yif". Universally pronouncing "j" as "y" maximizes confused amusement.

[1] https://www.destroyallsoftware.com/talks/the-birth-and-death...

Re: Jaq – A jq clone focused on correctness, speed, and simplicity

#70
post #7

This language must be the spiritual successor of Perl

I inherited some piece of code that made use of an extremely long and complicated jq script. I simply gave up understanding the whole thing, and restored the balance in the universe by rewriting it in Perl.

Now you just need to rewrite Perl in Rust and compile that to WebAssembly. And the circle of HN is complete.
Post reply on HN