3 ms·
AWKGo, an Awk-to-Go Compiler
- n8ta 5y agoNeat! How about go to awk next? (:
- benhoyt 5y agoHeh, that would be significantly harder. Probably doable, but it'd run quite slowly. Send me the link when you've written it! :-)
- awkthrowaway 5y agoGo and AWK-related anecdote: When I was at Google and learning Golang we had to go through readability review from people who know how to do idiomatic golang. One day I realised that my pretty trivial code was being reviewed by the "W" from AWK. Felt kinda starstruck. He had no review comments on my code :)
- benhoyt 5y agoNice! My star-struck story is I had lunch with Peter Weingberger (the W) at Google a couple of years back. Neat guy, smart and opinionated. He was working on VSCode's Go integration, if I remember correctly. Asked him what he would change about AWK if doing it again, he said probably the implicit string concatenation syntax by putting two expressions next to each other.
- Ciantic 5y agoWould it be possible to mimick dynamic types just be renaming subsequent references? E.g. foo = "test string" print(foo) foo = 5 print(foo) Would compile as: foo = "test string" print(foo) foo__1 = 5 print(foo__1) I don't know if the syntax is correct, but hope my point goes thru.
- tgv 5y agoAWK variables are global; only parameters are local. So there should be just one "foo" in the global scope in your example.