Live data from Hacker News

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

github.com

41–50 of 254 posts

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

#41
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.

Some time ago I tried Retool and it does have "Query JSON with SQL": https://docs.retool.com/queries/guides/sql/query-json (it is somewhat relevant because it was extremely convenient)

It is somewhat similar to Linq in C# although SQL there is more standardised so I like it more. Also, it would be fantastic to have in-language support for querying raw collections with SQL. Even better: to be able to transparently store collections in Sqlite.

It is always sad to see code which takes some data from db/whatever and then does simple processing using loops/stream api. SQL is much higher level and more concise language for these use cases than Java/Kotlin/Python/JavaScript

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

#42
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.

jq, and yq, are tools you spend an hour figuring out and then leave them in a CI pipeline for 3 years.

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

#43

Earlier quoted context omitted.

How does this relate to navigating structured documents? Even if you use XML, presumably you will want to programmatically navigate/query it at some point.

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.

Sure, but not everything uses XML. Lots of things use JSON, so even if you do not like it, presumably you will have to work with it at some point. So this is a tool that lets you do that. I do not think it is reasonable to expect that everyone uses XML, or should use XML, even if it is your favorite.

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

#44
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).

Saxon is where it's at.

When XSLT 3.0 tells a joke, it starts with "a JSON walks into a bar..."

https://github.com/Saxonica/Saxon-HE

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

#45

Earlier quoted context omitted.

How does this relate to navigating structured documents? Even if you use XML, presumably you will want to programmatically navigate/query it at some point.

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.

XMLs downfall was not providing built-in serialization/de-serialization. If XML had started with libraries like https://pydantic-xml.readthedocs.io/en/latest and people understood that this was the way to produce and consume XML -- that if you're using something like xpath or touching the raw tree with getChildElement and the like for more than one-off scripts something has gone wrong. And that xslt is at best an optimization and at worst staring into the abyss so don't start with it.

But now it doesn't matter because the backing format doesn't really matter and JSON was there at the right place right time.

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

#46
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...

Jack, Jaak, Jackyoo. Jay-Aye-Cue...

Also not the point; Jaques is more difficult to guess the correct pronunciation of than Jaq. That's the point.

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

#47
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.

ChatGPT excels at producing `jq` incantations; I can actually use `jq` now…

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

#48

Earlier quoted context omitted.

How does this relate to navigating structured documents? Even if you use XML, presumably you will want to programmatically navigate/query it at some point.

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.

As modern xquery and xslt support JSON, maybe there's scope for an x* tool like jq that makes working with JSON pleasant?

I've not used xquery enough to know if it can be succinct enough to be used as jq's language can.

For sure the Saxon cli could be made a lot more user friendly if it followed normal conventions.

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

#49
post #46

Earlier quoted context omitted.

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

Jack, Jaak, Jackyoo. Jay-Aye-Cue... Also not the point; Jaques is more difficult to guess the correct pronunciation of than Jaq. That's the point.

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

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

#50
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 https://github.com/yamafaktory/jql from the readme of this project and it's what I've been looking for for a long time, thank you!

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.

Post reply on HN