echo '{"name": "world"}' | fx 'x => x.name' 'x => `Hello, ${x}!`'
Is immediately grokkable compared to jq's syntax.I love jq, I think it's extremely powerful, but I have to load up the documentation in a side window every time I have use it.
echo '{"name": "world"}' | jq '"Hello \(.name)"' fx '_.groupBy("commit.author.name")' '_.mapValues(size)'
'_.toPairs' '_.sortBy(1)' '_.reverse' '_.take(10)' '_.fromPairs'
To do if in jq, it will take me much more time and extensive documentation reading.I'm looking forward to your jq version. I love jq and use it all the time, but for anything of that complexity, I'd probably just use Python.
group_by(.commit.author.name) | map({key: first.commit.author.name, value: length}) | sort_by(.value) | reverse[:10] | from_entriesYou can argue that's the case for any language, but it's the fundamental reason DSLs rarely capture the mainstream for on-the-fly utilities. Leveraging existing knowledge of a more heavily used syntax really helps here. Look at awk for example - it's been around forever, and despite its power and ubiquity in OS installs, you'll still see sed in many many more bash scripts because it's leaning on widely used familiar syntax rather than a DSL.
That said - the fx example has "x => Hello, ${x}!" where I would expect "x => `Hello, ${x}!`", so that does indicate to me that fx has its own gotchas lurking - this example could just be contrived to look intuitive.
I always found the `jq` syntax required many round-trips to the mail and more trial and error to get the syntax right.
I always found the `jqc
But is jq interactive?