Live data from Hacker News

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

github.com

171–180 of 254 posts

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

#171
post #156

How have you been using jq? It is more adhoc for exploring JSON files during development/data analysis or in programs that run in production?

My most common usage is pretty-printing the output of curl, or getting a list of things from endpoint service/A and then calling service/endpoint B/ to do things for each entry in the list.

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

#172
post #169

Earlier quoted context omitted.

Yeah, I've always liked the idea of jq but personally I find it easier to open a REPL in the language I'm most familiar with (which happens to be JS, which does make a difference) and just paste in the JSON and work with it there It may be more verbose, but I never have to google anything, which makes a bigger difference in my experience

https://github.com/wader/fq has a REPL and can read JSON. Tip is to use "paste | from_json | repl" in a REPl to paste JSON into a sub-REPL, you can also use ` ` with fq which is a raw string literal

The important part wasn't having a REPL, it was using a language I already know off the top of my head

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

#173
post #4

Earlier quoted context omitted.

As an outsider, getting your code merged into a popular open source project involves a political process of convincing the maintainers that your fix should be addressed, and then convincing them they should merge your code. Writing a fork involves sitting down at your laptop and coding it out.

Plus of course everything needs rewritten in rust /s.

not going to disagree

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

#176
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?

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

#178

> nan > nan is false, while nan If this wrong behavior from jq, or some artifact consistent with how the floating point spec is defined, surprising, but faithful to IEEE 754 nonetheless?

IIRC, any comparison using a nan must fail (return false) according to the IEEE spec.

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

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

    do more like the power shell way
I just checked the GitHub page [1] for Microsoft PowerShell. It looks written in C# and available on Win32/MacOS/Linux, where DotNet is now supported. Do you use PowerShell only on Win32 or other platforms also?

    Everyone seems to want to invent their own new esoteric symbolic query language
Can you give an example of something that PS can do that is built-in for text processing, instead of a proprietary symbolic query language?

[1] https://github.com/PowerShell/PowerShell

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

#180

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.

What is "JS syntax"? And can you write a frontend for jq that converts "JS syntax" to jq syntax?

And is the jq man page poor? I'm sure they will accept patches for it.

Post reply on HN