3 ms·
I recently dug into the docs of jq and was surprised to find that, contrary to my prior belief based on shallow experience with it, jq’s expression aren’t merel
by user3939382 4y ago
I recently dug into the docs of jq and was surprised to find that, contrary to my prior belief based on shallow experience with it, jq’s expression aren’t merely a path syntax but apparently a turing complete language. I was blown away.
I wish MySQL and AWS could have figured out a way to adopt it, or a subset of it, rather than each using different ones. Now I have varying levels of knowledge for 4-5 variations of JSON path semantics/standards, it’s annoying.
- WesolyKubeczek 4y agoThere has been a jq written in jq here on the front page.
- nequo 4y agoUser odnoletkov[1] has solved several years’ worth of Advent of Code in jq: https://github.com/odnoletkov/advent-of-code-jq https://github.com/odnoletkov/advent-of-code-jq [1] https://news.ycombinator.com/user?id=odnoletkov https://news.ycombinator.com/user?id=odnoletkov
- alecthomas 4y agoThat is simultaneously impressive and insane. Respect.
- justin_oaks 4y agoThe JSON expressions used by MySQL and the AWS command line tool (JMESpath) are extremely limited compared to jq. So not only do we end up learning multiple JSON path variations, but most of them are nearly useless for anything but the simplest use cases. I appreciate the intention of including JMESpath in awscli, but I quickly dropped it in favor of piping the JSON results to jq.
- mdaniel 4y agoI have a similar complaint but I'd guess there are (at least) two problems standing in the way of awscli getting jq language support: a python impl of the language with a license that awscli tolerates, and awscli being (in general) very conservative about changes. There are innumerable open issues about quality of life improvements that are "thank you for your input" and I'd expect that change to be similarly ignored
- thayne 4y agoNot to mention that JMESpath appears to be abandoned. There is a fork (https://github.com/jmespath-community/jmespath.spec https://github.com/jmespath-community/jmespath.spec), but it seems unlikely to be used by the aws cli (https://github.com/aws/aws-cli/issues/7396 https://github.com/aws/aws-cli/issues/7396). Although, for that matter jq is semi-abandoned itself.
- deleted 4y ago[deleted]
- dragonwriter 4y ago> I wish MySQL and AWS could have figured out a way to adopt it, or a subset of it, rather than each using different ones. For AWS CLI, you can just output unfiltered JSON and pipe the results through jq; the filtering is client-side anyway, so it’s not like you are losing anything doing external filtering vs. filtering within the AWS CLI.
- eru 4y agoIt's not just a Turing complete language, but a well designed one, too.