Live data from Hacker News

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

github.com

141–150 of 254 posts

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

#141
post #132

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

Well, as pointed out in the jaq docs there is jql. But I just looked at jql and I liked it even less. The pedantry about requiring all keys in selectors to be double quoted is, um, painful for a CLI tool.

Someone else above pointed out JJ which looks much easier to use.

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

#142
post #46

Earlier quoted context omitted.

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.

> Jaques is the French spelling of Jack/Jaak/Jak/Jaq. They're all pronounced the same

They're not, though. The French pronunciation of 'j', as in the word Jaques is /ʒ/. In English, 'j' at the beginning of the word 'Jack' is pronounced /dʒ/. And 'Jaak' makes me think of Dutch, where that 'j' is pronounced as /j/.

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

#143
post #99

Earlier quoted context omitted.

Nice find. I think I'll try it out. Although I was hoping for a real SQL type experience. I don't understand why no one just copies SQL so I can write a query like "SELECT * FROM $json WHERE x>1". Everyone seems to want to invent their own new esoteric symbolic query language as if everything they do is a game of code golf. I really wish everyone would move away from this old Unix mentality of extremely concise, yet…

While i agree about the general sentiment on preferring well defined and explicit standard as opposed to "cute" custom made languages. In this case i am not convince that SQL would be the best candidate for querying nested structures like JSON.Something like xpath maybe.

[deleted]

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

#144
post #99

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.

Nice find. I think I'll try it out. Although I was hoping for a real SQL type experience. I don't understand why no one just copies SQL so I can write a query like "SELECT * FROM $json WHERE x>1". Everyone seems to want to invent their own new esoteric symbolic query language as if everything they do is a game of code golf. I really wish everyone would move away from this old Unix mentality of extremely concise, yet…

DuckDB does just this, https://duckdb.org/docs/archive/0.9.2/guides/import/json_imp...

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

#145
> [[]] | implode crashes jq, and this was not fixed at the time of writing despite being known since five years.

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.

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

#146

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.

I do sympathise with that a bit, but for me at least it does not look like jql is the solution:

    '|={"b""d"=2, "c"}'
this appears to be something like jq's:

    'select(."b"."d" == 2 or ."c" != null)'
which.. is obviously longer, but I think I prefer it, it's clearer?

(actually it would be `.[] | select(...)`, but I'm not sure something like that isn't true of jql too without trying it, I don't know if the example's intended to be complete - and I don't think it affects my verdict)

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

#147
post #99

Earlier quoted context omitted.

Nice find. I think I'll try it out. Although I was hoping for a real SQL type experience. I don't understand why no one just copies SQL so I can write a query like "SELECT * FROM $json WHERE x>1". Everyone seems to want to invent their own new esoteric symbolic query language as if everything they do is a game of code golf. I really wish everyone would move away from this old Unix mentality of extremely concise, yet…

Be the change you want to see. I personally don't understand why people aren't willing to learn instead. It's not hard to sit down and pick up a new skill and it's good to step out of one's comfort zone. I personally hate Powershell syntax, brevity is the soul of wit and PS could learn a thing or two from bash and "the linux way". We seem obsessed with molding the machine to our individual preferences. Perhaps we sho…

>I personally don't understand why people aren't willing to learn instead.

Mostly because if you don't use it that often then it ends up forgotten again. I can smash out plenty of trivial regexes, but anything even slightly complicated means I'm learning backreferences again for the 6th time in a decade.

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

#148
post #132

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

ChatGPT or the warp chatbot is pretty good at jq syntax

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

#149
post #145

> [[]] | implode crashes jq, and this was not fixed at the time of writing despite being known since five years. 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 ti…

Yeap was fixed in 1.7 https://github.com/jqlang/jq/pull/2646

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

#150
post #133

Earlier quoted context omitted.

Be the change you want to see. I personally don't understand why people aren't willing to learn instead. It's not hard to sit down and pick up a new skill and it's good to step out of one's comfort zone. I personally hate Powershell syntax, brevity is the soul of wit and PS could learn a thing or two from bash and "the linux way". We seem obsessed with molding the machine to our individual preferences. Perhaps we sho…

While I appreciate the sentiment for bending your mind, rather than the spoon, the practical reality is that developer time is far costlier than compute time. It is easier to map compute structures and syntax to existing mental models than to formulate new mental models. The latter is effortful and time-consuming. So, given the tradeoffs, I could learn a new language, or leverage an existing language to get things do…

If the crux is that you want something that maps closer to your personal mental model than what's available, I guess the other option is to build the missing tool yourself. That's the other side of "be the change you want to see".

> So, given the tradeoffs, I could learn a new language, or leverage an existing language to get things done.

There is also the option to create a new language (jqsql or whatnot), optionally sharing it publically.

If you do this I think you'd find out why beyond very trivial stuff, sibling commenters have a point in that SQL isn't a good fit for nested data like JSON. Would still be a useful exercise!

Post reply on HN