Live data from Hacker News

FX: An interactive alternative to jq to process JSON

github.com

61–65 of 65 posts

Re: FX: An interactive alternative to jq to process JSON

#61
post #60
post #29

Earlier quoted context omitted.

> For example how would you take key k1 from a list of dicts [{k1: v1, k2: v2}, {k1: v3}]? Do you mean something like: .[].k1 Give it a try. https://jqplay.org/ jq does have a learning curve, but just like any query language, including SQL, first you need to learn the basics of the query language in order to get things to work. In this case: * you know that .[] iterates over objects, so you use it to unpack the root…

> jq does have a learning curve, but just like any query language, including SQL, first you need to learn the basics of the query language in order to get things to work. SQL is based on solid mathematical theory, relational algebra. I personally learned that (and tuple relational calculus) in college before learning SQL, which made it easier. It helps making it coherant. Is there something like this for jq? Often wh…

> Is there something like this for jq?

It's a filter. You can name-drop math stuff and even mention monads and the like, but it's just predicates, maps, a reductions.

Also, I'm not aware of a single person who ever looked at relational algebra beyond the introductory lessons of a relational databases 101 course, and even then that stuff was mostly in the way.

Re: FX: An interactive alternative to jq to process JSON

#62
post #61
post #60

Earlier quoted context omitted.

> jq does have a learning curve, but just like any query language, including SQL, first you need to learn the basics of the query language in order to get things to work. SQL is based on solid mathematical theory, relational algebra. I personally learned that (and tuple relational calculus) in college before learning SQL, which made it easier. It helps making it coherant. Is there something like this for jq? Often wh…

> Is there something like this for jq? It's a filter. You can name-drop math stuff and even mention monads and the like, but it's just predicates, maps, a reductions. Also, I'm not aware of a single person who ever looked at relational algebra beyond the introductory lessons of a relational databases 101 course, and even then that stuff was mostly in the way.

Your are the one name-dropping three mathematical concepts though? I'm not sure I understand your reasoning here. I'm talking about the basis for jq in general, not just your example. And if your message is representative of how the people that created jq think, I guess the answer is no and jq falls into the "no solid theory behind it" category.

I don't think my message was implying that jq is a worse (or better) tool for it. I was just explaining that for some people, tools with a theory behind are easier to learn and understand than tools without.

Re: FX: An interactive alternative to jq to process JSON

#63
post #58

Earlier quoted context omitted.

On my machine jq depends on oniguruma. Both node and onigurama should be easy to install from your distro package manager.

It's because Homebrew (if you're on macOS) decided not to compile it statically.

I'm on manjaro.

Re: FX: An interactive alternative to jq to process JSON

#65
post #49
post #5

Earlier quoted context omitted.

Just tried out both of these for a large endpoint. - FX "expand/collapse" functionality seems way better for exploring APIs whose shape you don't know - jid is maybe marginally better for APIs where you have instant recall of the exact shape and need to rapidly query it Overall, I like FX better because it provides feedback on your query faster. I am grateful to the author(s) for creating it and I'll be using it inst…

FYI, fx has a jid-like mode that can be started by pressing the dot key. See this post[1] for more information. [1] https://medium.com/@antonmedv/discover-how-to-use-fx-effecti...

Thank you! I had discovered it when I was playing around with it but forgot to mention that.
Post reply on HN