4 ms·
Interesting! I recently did something similar based on my GoAWK interpreter (an AWK interpreter written in Go): I wrote a compiler that tries to statically infe
by benhoyt 5y ago
Interesting! I recently did something similar based on my GoAWK interpreter (an AWK interpreter written in Go): I wrote a compiler that tries to statically infer types and compile a subset of AWK to Go source: https://benhoyt.com/writings/awkgo/ https://benhoyt.com/writings/awkgo/ My conclusion:
> Is it useful? Not really. If you want performance, just use Mawk! And if you want your text processing script in a more maintainable language than AWK, you’d probably just write it in something like Go from the start. You’re pretty certain to end up with more idiomatic Go that way, and it’ll probably be more efficient as well.
> Still, if you have some AWK scripts lying around that you want to convert to “real programs”, AWKGo might not be a bad place to start: you could compile a script to Go to get the structure, then clean it up and maintain the cleaned-up version.