Could you release a fork of jq whose make does all this fanciness? I use jq A LOT so would love a turnkey solution to make it faster.
HN user
code-faster
I'm all about developer productivity. If you want to be more productive, subscribe to my newsletter https://codefaster.substack.com
@canardivore on twitter
The reason why these articles appear every 5 years is because many engineers pride themselves on how they solve problems. And then when they see people solving those problems without putting in the hard work that they had to put in, it really bothers them.
This is a timeless post. We'll see it today. We'll see it in five years. We'll see it in 10 years.
He was great, he deserves, in death, no dishonor
I love pieces like this. They're great programmer sociology if such a field existed.
Will AI change this? If AI can assess who is good for us, then we can get somewhere
All you're doing is creating a new spec that's not JSON. JSON has no comments. Your spec does. Your parsers handle both specs.
https://xkcd.com/927/ applies
I had to double take back to HN that this wasn't some super custom website pulling my name out of cookies.
CSV is great because excel can import it, but it can't import USV, so at that point, why use USV when you can use JSON?
Let's do both. There's two crimes:
1 - Giving away info without consent
2 - The crime of abusing police resources.
Seems like the corporations are criminally negligent for leaking customer info. What if the best way to stop swatting was to go after them?
Also note that this approach generalizes to other text-based formats. If you have 10 gigabyte of CSV, you can use Miller for processing. For binary formats, you could use fq if you can find a workable record separator.
You can also generalize it without learning a new minilanguage by using https://github.com/tyleradams/json-toolkit which converts csv/binary/whatever to/from json
https://github.com/tyleradams/json-toolkit
Convert json <-> xml, csv, yaml, logfmt
So to support all formats, you write a binary <-> json converter.
Having used m4 in practice, it's easier to get the job done with a custom python script.
I really like this tool, but I'm not sure what it gets me more than jq (and https://github.com/tyleradams/json-toolkit to convert non-json to json).
What can angle grinder do better than jq?
I have a couple of open source CLI tools to do this: - https://github.com/tyleradams/json-toolkit/blob/master/csv-t... - https://github.com/tyleradams/json-toolkit/blob/master/json-...
Can't we setup a school Today that does R&D in open source tech and apply for research grants?
Oh that's cool, thanks for the tip
unix is also User Interface Independent, but unlike emacs, it's actually used on a wide variety of interfaces: Mainframes, microcontrollers, web servers, phones (touch screen) and PCs.
Hi, I'm the author, I would love to know more about proper typing training, I've never heard of such a thing beyond touch typing. Do you have any suggested online resources or books for where I could start?
Thank you. As someone starting a newsletter, it can be frustrating to get a few views for high quality content. Meanwhile its my basic tutorial that got to the front page of HN.
Obviously thats a different league, but I bet the temptation to get a "high score" feels the same. This post is a good reminder not to worry so much about the score, so thanks again
Hard: Tech
Harder: People
Impossibly hard: Help people get faster at building tech
And yet it's all I want to do.
Is there anything in my tutorial that I can help clarify for you?
Nice! I've found xml transforms is one of the best applications of jq (yes, jq, not xq).
In a future post, I'll cover how to use jq not just for json and xml but any data format.
You can use any language with json support, which is most languages.
In python, you can have a jq like experience with
def f(data):
# put code here
data = json.load(sys.stdin)
output = f(data)
print(json.dumps(output))It is a weird way to write it, I never use this notation for myself.
When teaching though, I'd rather make the it more visually explicit that jq commands are a sequence of filters. With the former notation, a | explicitly tells the reader that it's the end of one filter and the start of a new one, the latter is more implicit.
I would also be fascinated to hear how you're using it.
Thanks for flagging that, they've been fixed and retested, thank you jbotz!
my json toolkit has been a huge boon for me, it complements jq very well: https://github.com/tyleradams/json-toolkit
There's tools for converting between json and other data formats like xml as well as misc tools like json-diff which diffs json files and formats the output as json.
Ah, they're meant to be xml fragments, not full xml documents.
In my limited experience I haven't seen people use the <array> container and the xml parser still works, although it is a good idea.