Optimizing GoAWK with a bytecode compiler and virtual machine
Instead of interpreters, if one has less of a &quot;must be a full featured prog.lang&quot; mentality and a fast compiler like Go or Nim [1] (or is willing to wait, for slow optimizing compiles to apply against big data sets) then an end-to-end simpler design for &quot;one-liners&quot; (or similarly simple programs) is the whole program generator.  Maybe &quot;big IFs&quot;, but also maybe not.<p>To back up my simplicity claim, consider <i>rp</i> [2] -- like 60 non-comment&#x2F;import&#x2F;signature lines of code for the generator.  Generated programs are even smaller.  But, you can deploy gcc or clang or whatever against them and make fast libraries in the host language.<p>Why, if you are willing to write those little generation command options in C99 then you can compile the harness with <i>tcc</i> [3] in about 1 millisecond which is faster than most interpreter start-up times - byte code or otherwise - and can link against gcc -O3 (or whatever) helper libraries.<p>Anyway, I only write this because in my experience few people realize how much development cost they buy into when then insist on a full featured prog.lang, not to criticize Ben&#x27;s work.  You also make users learn quirks of a new language instead of the quirks of a &quot;harness&quot; which may be fewer|easier. (EDIT: Awk is fairly well established, of course.)<p>[1] <a href="https:&#x2F;&#x2F;forum.nim-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;forum.nim-lang.org&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;c-blake&#x2F;cligen&#x2F;blob&#x2F;master&#x2F;examples&#x2F;rp.nim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;c-blake&#x2F;cligen&#x2F;blob&#x2F;master&#x2F;examples&#x2F;rp.ni...</a><p>[3] <a href="https:&#x2F;&#x2F;repo.or.cz&#x2F;w&#x2F;tinycc.git" rel="nofollow">https:&#x2F;&#x2F;repo.or.cz&#x2F;w&#x2F;tinycc.git</a>