Live data from Hacker News

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

github.com

201–210 of 254 posts

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

#201

I think the best alternative for JQ is datawave, but it is not open source. https://dataweave.mulesoft.com/

The latest blog post is about open sourcing it from last September. So the process of open sourcing dataweave takes at least 15 months.

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

#202

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.

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

In the prescriptivists fantasyland, yes.

In the real world, the descriptivist realizes an individual's pronunciation of the concept labelled Jac/Jack/Jacques/Jacq/Jak/etc. depends much more on the their personal context and stylistic choice than the spelling used.

I've heard many folks (American and otherwise) pronounce "Jack" many times in my life, and the range of utterances very comfortably includes Pépin's own "Jacques".

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

#203
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…

Have you looked at [duckdb's JSON support](https://duckdb.org/docs/extensions/json.html)? It's pretty transparent and you can do exactly what you say: `select * from 'file.json' where x > 1` will work with "simple" json files like {"x": 1, "y": 2} and [{"x": 1, "y":2}, {"x":2, "y":3}]

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

#204

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 just find the JQ style syntax uber hard to grokk

You're not alone. ChatGPT (3.5) is terrible at it also, for anything non-trivial.

I'm not sure if that's because of the nature of the jq syntax, but I do wonder.

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

#205
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…

Why was it halted?

I think the original devs just got burnt out for a while https://github.com/jqlang/jq/issues/2305#issuecomment-157263...

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

#206
My first impression is it has fancy error messages but no halt_error/0

  $ ./jaq-v1.2.0-x86_64-unknown-linux-gnu -sf aoc22-13.jq input.txt
  Error: undefined filter
      ╭─[:30:18]
      │
   30 │ ╭─▶          "bad input" | halt_error
   31 │ ├─▶        end;
      │ │
      │ ╰───────────────── undefined filter
  ────╯
and (after commenting out halt_error) slower than both jq and gojq

  $ 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
aoc22-13.jq is here https://pastebin.com/raw/YiUjEu2n and input.txt is here https://pastebin.com/raw/X0FSyTNf

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

#207
post #111

Earlier quoted context omitted.

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.

I agree, it wouldn't be the best to handle all json edge cases, but it would be a super easy way to quickly get data from a big chunk of simple json and you could just use subqueries or query chaining for nested results. For anyone who hasn't used powershell, this is the difference I'm talking about. I would not be able to write either of these without looking up the syntax. But knowing very little about powershell,…

On the other hand, I find the bash one clear and concise. That PowerShell example is so verbose, it'd drive me crazy to do any sort of complex manipulation this way! To each their own, I guess.

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

#210

https://github.com/01mf02/jaq/blob/main/Cargo.lock That's a lot of dependencies..

How does that usually play out in the Rust ecosystem? Lots of dependencies tell me there's a huge risk of the dependencies becoming inherently incompatible with each other over time, making maintenance a major task. How will this compile in say, 2 years?
Post reply on HN