HNHacker News
TopNewBestAskShowJobs

errnil

79 karma · joined October 2, 2021

submissionscomments
errnil··on Show HN: gq – like jq or zq, but you use Go
Actually `gq` does not require a locally installed Go compiler. It interprets the supplied Go using Yaegi.
errnil··on Show HN: gq – like jq or zq, but you use Go
:) Thank you! It was fun to write.
errnil··on Show HN: gq – like jq or zq, but you use Go
No doubt this tool is lacking. However I will say that for me the most important quality in my `jq`-like is not conciseness. My main frustration is that I always forget the small details of how `jq`'s language works and spend 10 minutes googling. E.g doing operations within arrays of objects, using select, and so on. Maybe I'm just dumb, but I'm fond of tools that accommodate my dumbness!
errnil··on Show HN: gq – like jq or zq, but you use Go
Precisely. The first pass generated a temp file and compiled/ran it, but that lead to annoying pauses when trying to run simple scripts (probably 500ms latency? Maybe a tad more?). Yaegi cut that latency dramatically. I think you’re right that this may make it slower for larger scripts or for sufficiently large inputs, however the biggest bottleneck for me with jq isn’t performance but learning it’s language repeatedly.