Live data from Hacker News

Zq: An easier and faster alternative to jq

brimdata.io

231–237 of 237 posts

Re: Zq: An easier and faster alternative to jq

#231
post #207

Earlier quoted context omitted.

Do you know a way to copy the current selection in jless to the paste buffer? I find myself narrowing down a query for jq using jless but then having to manually remember the query to then jump to my terminal.

You can use `yq` to copy a jq-style path to currently focused node to your clipboard! (I’m the author of jless.) There are a couple other copy variants as well: https://jless.io/user-guide.html#copying

Oh fantastic thankyou! And thank you for jless!

I was running 0.7.1 rather than 0.8.0, so will upgrade now

Edit: Works great!

Re: Zq: An easier and faster alternative to jq

#232

Earlier quoted context omitted.

I suspect the JMESPath people would argue that if you want to do major transformations to the input, you should write a proper program, and that a CLI query tool should focus on, well, querying. I'm personally trying to move away from jq and towards jp, because - there's a standard defining it, not just an implementation, decreasing the odds of being stuck with an unmaintained tool - there are libraries supporting th…

> JMESPath is the AWS CLI query language, which is a convenient bonus And in ansible, too, FWIW, but yes it's my hand-to-hand combat with the language in both of those circumstances that has formed my opinion about it Regrettably, "kubectl get -o jsonpath" is _almost_ the same, but just different enough to trip me up :-(

Despite using Ansible for several different projects in the past few years, I had no idea there was a corner involving JMESPath. Thanks for the heads-up.

FWIW, my choice to move towards JMESPath is definitely a pragmatic one, not an aesthetic preference. I can't say JMESPath fills me with joy, and the syntax does not come naturally to me - it just solves the problem acceptably well and in a way that has some network effects.

I have plenty of respect for "I've used this tool in the wild and the experience was unpleasant."

Re: Zq: An easier and faster alternative to jq

#233
post #86

Earlier quoted context omitted.

What? That's crazy! Does Github block indexing?

https://github.com/robots.txt I don't see anything here about wiki specifically but maybe one of the rules hits wiki pages?

They've moved from robots.txt to blocking by headers.

Re: Zq: An easier and faster alternative to jq

#234
post #98

Hi, all. Author here. Thanks for all the great feedback. I've learned a lot from your comments and pointers. The Zed project is broader than "a jq alternative" and my bad for trying out this initial positioning. I do know there are a lot of people out there who find jq really confusing, but it's clear if you become an expert, my arguments don't hold water. We've had great feedback from many of our users who are reall…

I wrote about how to solve with SQL. https://noborus.github.io/blog/jqsql/

Re: Zq: An easier and faster alternative to jq

#236
post #20

These guys must really hate functional programming. I can see where jq might confuse someone new to it, but their replacement is irregular, stateful, still difficult, and I don't even see variable binding or anything. jq requires you to understand that `hello|world` will run world for each hello, passing the world out values to either the next piped expression, the wrapping value-collecting list, or printing them to…

I find the stateless streaming paradigm in jq very pleasing. Results can be emitted iteratively using generators, which are implemented as tail-recursive streams [0]. Combined with the `input` built-in filter, which yields the next item in the input stream, and jq can handle real-time I/O and function as a more general-purpose programming language. I built an interpreter for the Whitespace programming language in jq…

Wow, I've been on the lookout for larger jq programs from which to learn. I'm going to enjoy learning from wsjq, thank you!

Re: Zq: An easier and faster alternative to jq

#237
There's a lot of references here to jq being 'arcane'. For me, one of the challenges in improving my jq fu has been to find examples of larger programs, from which to learn.

One thing that seems to be perhaps a misconception amongst some is that jq invocations are short and only 'one-liners', and that a 'real script' (in a 'real language') would be better in many cases. I think this lack of larger program examples probably helps to perpetuate this misunderstanding too.

Anyway, I was inspired enough by the article in question to write up some of my own thoughts on jq and statelessness: https://qmacro.org/blog/posts/2022/05/02/some-thoughts-on-jq...

Post reply on HN