What does HackerNews think of goawk?
A POSIX-compliant AWK interpreter written in Go, with CSV support
Language:
Go
#33
in
Go
Thanks! ICYMI: GoAWK [1] - A POSIX-compliant AWK interpreter written in Go, with CSV support.
You should include qsv (https://github.com/jqnatividad/qsv) and goawk (https://github.com/benhoyt/goawk) into the CSV section! Goawk got a csv/tsv mode and qsv is loaded with features being developed.
There's also GoAWK, which supports CSV natively ("-i csv"): https://github.com/benhoyt/goawk
The author maintains an AWK implementation:
I'm not sure if it was via my personal website or just my GitHub profile, but I got my current job at Canonical due to the CTO there reaching out about my GoAWK project (https://github.com/benhoyt/goawk). I get regular recruitment emails because I have my CV/resume online: most of them are very low-effort, but 1 in 20 or something are interesting emails where the recruiter has actually looked at my website and will tailor it personally. I also just enjoy technical writing, and get joy out of sharing it on HN. So it's "worth it" for me.
There is also goAWK[0], a re-implementation of AWK in Go.
Namespaces (GNU Awk 5.0+) make Awk pretty well suited for larger projects (as demonstrated by aho), but it never quite took off; this article (by the author of GoAwk[1]) is a nice look at the relevance of Awk in 2020: https://lwn.net/Articles/820829/
Wow, this update is awesome: my GoAWK interpreter (https://github.com/benhoyt/goawk) runs a simple CPU-bound AWK program 38% faster when compiled with Go 1.17 (compared to 1.16).
$ time goawk_go1.16 'BEGIN { for (i=0; i<100000000; i++) s += i; print(s) }'
4999999950000000
real 0m10.158s ...
$ time goawk_go1.17 'BEGIN { for (i=0; i<100000000; i++) s += i; print(s) }'
4999999950000000
real 0m6.268s ...
I wonder why it's so much better than their advertised 5% perf improvement? Here's a quick CPU profile: https://i.imgur.com/csJyOYq.png ... I don't get too much out of it at a glance, just seems like everything's a bunch faster.Indeed -- such a beautiful and concise book. After the first one or two chapters you know all of the AWK language, and then the rest of the book is making the knowledge practical with interesting examples (that's my memory of the book, anyway).
I was on a Go spree when I read this book, and after the first few chapters, I thought, "it'd be fun to write a version of AWK in Go". I ended up with https://github.com/benhoyt/goawk
And OP, thanks for posting. I'm the author of the LWN article. Nice to see it re-posted here some six months later. :-)