Live data from Hacker News

A Faster Alternative to Jq

micahkepe.com

191–200 of 281 posts

Re: A Faster Alternative to Jq

#192

Earlier quoted context omitted.

At that point why don't we ask the AI directly to filter through our data? The AI query language is much more powerful.

Because the input might be sensitive. Because the input might be huge. Because there is a risk of getting hallucinations in the output. Isn't this obvious?

...and because it's going to burn a million times the energy of what jq would require.

Re: A Faster Alternative to Jq

#194
post #160
post #137

Jq's syntax is so arcane I can never remember it and always need to look up how to get a value from simple JSON.

That’s interesting! Can you say a little more? I find jq’s syntax and semantics to be simple and intuitive. It’s mostly dots, pipes, and brackets. It’s a lot like writing shell pipelines imo. And I tend to use it in the same way. Lots of one-time use invocations, so I spend more time writing jq filters than I spend reading them. I suspect my use cases are less complex than yours. Or maybe jq just fits the way I think…

Sound similar to how power shell works, and it’s not great. Plain text is better.

Re: A Faster Alternative to Jq

#195

Quick comment for the author. Just added this new tool to arkade, along with the existing jq/yq. No Arm64 for Darwin.. seriously? (Only x86_64 darwin.. it's a "choice") No Arm64 for Linux? For Rust tools it's trivial to add these. Do you think you can do that for the next release? https://github.com/micahkepe/jsongrep/releases/tag/v0.7.0

They've been added!

Re: A Faster Alternative to Jq

#197

Earlier quoted context omitted.

First, if a performance optimization is a reliability regression, it was done wrong. A bounds check is removed because something somewhere else is supposed to already guaratee it won't be violated, not just in a vacuum. If the guarantee stands, removing the extra check makes your program faster and there is no reliability regression whatsoever. And how does performance improve reliability? Well, a more performant ser…

"Removing an extra check", so there is a check, so the check is not removed?

It does not need to be an explicit check (i.e. a condition checking that your index is not out of bounds). You may structure your code in such a way that it becomes a mathematical impossibility to exceed the bounds. For a dumb trivial example, you have an array of 500 bytes and are accessing it with an 8-bit unsigned index - there's no explicit bounds check, but you can never exceed its bounds, because the index may only be 0-255.

Of course this is a very artificial and almost nonsensical example, but that is how you optimize bounds checks away - you just make it impossible for the bounds to be exceeded through means other than explicitly checking.

Re: A Faster Alternative to Jq

#198
post #41

First of all, congratulations! Nice tool! Second, some comments on the presentation: the horizontal violin graphs are nice, but all tools have the same colours, and so it's just hard to even spot where jsongrep is. I'd recommend grouping by tool and colour coding it. Besides, jq itself isn't in the graphs at all (but the title of the post made me think it would be!). Last, xLarge is a 190MiB file. I was surprised by…

Hey thank you! OP here, yes I was struggling to find large enough documents to run the benchmarks on, the range currently on the benchmark data is ~106 B - ~190MB, which I think covers the majority of quick task workloads, but would love to have large documents, if there's an public ones you can thinking of I'd like to know!

Re: A Faster Alternative to Jq

#199
post #160

Earlier quoted context omitted.

That’s interesting! Can you say a little more? I find jq’s syntax and semantics to be simple and intuitive. It’s mostly dots, pipes, and brackets. It’s a lot like writing shell pipelines imo. And I tend to use it in the same way. Lots of one-time use invocations, so I spend more time writing jq filters than I spend reading them. I suspect my use cases are less complex than yours. Or maybe jq just fits the way I think…

I'm not GP, I use jq all the time, but I each time I use it I feel like I'm still a beginner because I don't get where I want to go on the first several attempts. Great tool, but IMO it is more intuitive to JSON people that want a CLI tool than CLI people that want a JSON tool. In other words, I have my own preconceptions about how piping should work on the whole thing, not iterating, and it always trips me up. Here'…

I find it much harder to remember / use each time then awk

Re: A Faster Alternative to Jq

#200

Surprised to see that there's no official binaries for arm64 darwin. Meaning macOS users will have to run it through the Rosetta 2 translation layer.

OP here: Releases have been updated! Also someone was kind enough to package it in Homebrew already :) https://github.com/micahkepe/jsongrep/pull/22
Post reply on HN