Live data from Hacker News

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

github.com

211–220 of 254 posts

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

#211
post #209

The fact that jq takes almost a second to run on a Pi is crazy[0]. And the tool is written in C. [0] https://github.com/jqlang/jq/issues/1411

It was fixed in 2019 though? I don't understand your point.

https://github.com/jqlang/jq/issues/1380

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

#212
post #208

I love the idea of jq but i use it infrequently enough that I have to search the manual for how to use their syntax to get what I want. Sadly 99% of what I do with jq is “| jq .”

I have the same problem. Then, unrelated, I started building a configuration language, and it turned out it's quite nice for querying json [1]. Here is an example use case that I couldn't solve in jq but I could in RCL: https://fosstodon.org/@ruuda/111120049523534027

[1]: https://docs.ruuda.nl/rcl/rcl_query/

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

#213
post #208

I love the idea of jq but i use it infrequently enough that I have to search the manual for how to use their syntax to get what I want. Sadly 99% of what I do with jq is “| jq .”

I had the same problem, keeping me from really exploiting the power of jq. But for this and similar cases I am really glad about copilot being available to help. I just tell it what I need, together with a reduced sample of the source-json, and it generates a correct jq-script for me. For more complex requirements I usually iterate a bit with Copilot because it is easier and more reliable to guide it to the solution gradually than to word everything out correctly in the question in the first go. Also I myself often get new and better ideas during the iterations than I had in the beginning. Probably works the same with ChatGPT and others.

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

#214

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…

In my case, my memory doesn't work that way. I have learnt jq several times but I don't use it frequently enough to retain the knowledge. A better tool for me would be something that uses JS syntax but with some syntactic sugar and a great man page.

I have that same problem, the advanced features I use too little to remember. Then I started working on a configuration language that should have a non-surprising syntax (json superset, mostly inspired by Python, Rust, Nix). And it turns out, this works well as a query language for querying json documents. https://github.com/ruuda/rcl Here is an example use case: https://fosstodon.org/@ruuda/111120049523534027

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

#216
post #190

Congratulations! We're almost back to the basic functionality we used to have with XSLT.

You could use an elaborate filter with jq (see https://stackoverflow.com/a/73040814/452614 ) to transform JSON to XML and then use an XQuery implementation to process the document. It would be quite powerful, especially if the implementation supports XML Schema. I have not tested it. Or https://github.com/AtomGraph/JSON2XML which is based on https://www.w3.org/TR/xslt-30/#json-to-xml-mapping It even looks like we cou…

In fact XQuery alone is enough, e.g. with Saxon HE 12.3.

    (: file json2xml.xq :)
    declare default element namespace "http://www.w3.org/2005/xpath-functions";
    declare option saxon:output "method=text";
    declare variable $file as xs:string external;
    json-to-xml(unparsed-text($file))/

    java -cp ~/Java/SaxonHE12-3J/saxon-he-12.3.jar net.sf.saxon.Query -q:json2xml.xq file='/path/to/file.json'

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

#217

Earlier quoted context omitted.

You're implying I subconsciously view them the same and pronounce them the same. But I don't. Maybe your dialect of English is different than mine, but I am not you. And it was there for a while because I use Hacker News on my phone and don't check it all the time. My original sentence repeated the same word twice as a typo. It was this: > I was confused reading people say that Jacques is pronounced the same as Jacqu…

The implication I'm positing is "if you mix up words without notice, they are conceptually interchangeable". You can't disprove it by stating that words you didn't mix up without notice aren't interchangeable.

Or it means I simply made a a mistake.

> mix up without notice aren't interchangeable.

Sometimes I have accidentally written "chick" when I wrote "chic" due to autocorrect, just not during this conversation.

Regardless, I guess I can't make you believe me when I say what sounds natural to me. Ignore what I say if you really want. The fact that you insist that I say the two names interchangeably does not make it so.

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

#219

Earlier quoted context omitted.

It sounds like [a] to me, not [æ]. The a in the name Jacques is pronounced as in the word father . The a in the name Jack is pronounced as in cat.

As someone who has heard the name "Jack" pronounced by Americans many, many, many times in their life... that Jaques video sounds entirely in-range of the variety of pronunciations I hear for Jack.

[deleted]

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

#220

> nan > nan is false, while nan You learn something new everyday. Does anyone have any idea why this might be happening? Seems like more than just a bug..

I use jq on a daily basis. This is new to me thanks for remarking it
Post reply on HN