Using super
I've stayed away from really learning jq, awk, or sed for my whole career: in part because all of the tools, as great as they are, are sort of idiosyncratic and on their own islands. It feels kind of bad to pour a lot of energy into learning a new syntax that doesn't really translate to anything else. Plus, a lot of the Linux standard tooling is really made for tab-delimited inputs, stuff more like CSVs than like JSON.
But munging JSON is just inevitable: every job requires it, and I'd like to have a workflow that's faster than writing little Node.js scripts every time.
So today I gave super a shot. It was previously zq, and the company's called Brim Data - lots of names to juggle. I had a bunch of JSON that looked like
[
{
"name": "ALGOLIA_API_KEY",
"service": "Algolia",
"description": "API key used to authenticate requests to Algolia’s search service.",
"link": "https://www.algolia.com/doc/guides/security/api-keys/",
"category": "DevTools"
},
{
"name": "AMAZON_AWS_ACCESS_KEY_ID",
"service": "AWS",
"description": "Alternative environment variable name for the AWS access key ID.",
"link": "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html",
"category": "Cloud"
}
]And I wanted it to look like
[
"ALGOLIA_API_KEY",
"AMAZON_AWS_ACCESS_KEY_ID",
]A pretty run-of-the-mill data-munging task: in raw JavaScript this would look like list.map(key => key.name). In super, it ended up looking like
pbpaste | super -j -c 'unnest this | this.name | collect(this)' -Overall, it was a positive experience using super, with some ups and downs:
- The documentation is great where it exists, but I couldn't find any documentation for
unnest, which seems to me like a very core function of the language. - I really like that super can handle a lot of input & output formats. I don't know how sold I am on the SUP format that they've invented, but I'm generally interested in a more powerful JSON-like data format.
- The whole thing is made by a seed-funded startup building an analytics database, so there's a decent change that it changes a lot or the company funding goes away. Maybe it could outlive its company's demise - there are a few real stories of that recently, like biome going on to dominate TypeScript tooling after Rome Tools, its original startup funder, collapsed.
My feeling about the thing is: if it has a ton of great examples, then it has all the juice it needs to be usable in place of jq and win a place in a lot of developers hearts.