3 ms·
Looks like much of the effort is working around basic Go language limitations. Coding the virtual machine interpreter in Go seems like a mistake. Compiling str
by ncmncm 5y ago
Looks like much of the effort is working around basic Go language limitations. Coding the virtual machine interpreter in Go seems like a mistake.
Compiling straight to Go, and then compiling that the normal way, seems like it would do better, and be simpler. Assuming you really wanted to keep it all in Go.
- benhoyt 5y agoGo isn't the most efficient language for these sorts of things, but it's also not bad (and Go itself is not really the bottleneck for real-world AWK scripts). That said, GoAWK is useful mainly when you want to use AWK scripts in a Go program (the Benthos stream processor does this: https://www.benthos.dev/docs/components/processors/awk/ https://www.benthos.dev/docs/components/processors/awk/). I also did a project recently, creatively called AWKGo, that compiles (a subset of) AWK scripts to Go source code: https://benhoyt.com/writings/awkgo/ https://benhoyt.com/writings/awkgo/