Re:Show HN: Tuc – When cut doesn’t cut it
by jnordwick on Thursday June 16, 2022 @12:40AM
(#31762494)
Why would you do a posix compat awk? I loved awk, but it needs to be updated adn refined into a better language instead of just recreating the old one.
Compatibility: so it can run all the existing AWK scripts without modification, and people can refer to existing AWK documentation when writing scripts, and they'll just work under GoAWK.
For a 45-year old language, it's actually surprisingly good. There are a few annoyances and clumsy things (getting substrings is a function call without nice str[start:end] syntax, regex matches are harder than they need to be, string concatenation syntax is weird, arrays aren't nestable (except in Gawk), and so on).
I've actually thought it'd be great to "fix" these things and make a nicer AWK language, but the problem is then no one would use it. :-)
For searching recursively through folders, I recommend ripgrep (rg), though it won't do number conversions and the like.
Self-promotion (but I think it's useful here) is my GoAWK project, which is a POSIX-compatible version of AWK, with the recent addition of proper CSV support: https://benhoyt.com/writings/goawk-csv/