github benhoyt/goawk v1.11.0
Version 1.11.0

latest releases: v1.27.0, v1.26.0, v1.25.0...
2 years ago

This release changes the handling of the builtin functions length, substr, index, and match to use character indexes instead of byte indexes, as per the POSIX spec.

So this is a small backwards-incompatible change, but I think it's 1) warranted given GoAWK tries to conform to POSIX, and 2) won't break most scripts, even ones that use non-ASCII, unless they use constant indexes for substr on non-ASCII strings. To revert to the previous bytes-index behavior, set interp.Config.Bytes to true when using from Go, or use the new goawk -b option for the command-line version.

This does affect the performance of those builtins, as some operations that were O(1) are now O(N) in the length of the string. Still, v1.10.0 introduced other performance improvements, and it's pretty much a wash on the "real world" benchmarks overall.

See PR #83 and issue #35 for further discussion.

Don't miss a new goawk release

NewReleases is sending notifications on new releases.