Re:Show HN: Awk-JVM – A toy JVM in Awk
by tyingq on Tuesday June 23, 2020 @04:26PM
(#23619768)
Not the main point, and this is a very cool dancing bear. But, on this point:
"since none of the awks can read binary, you first need to pipe the classfile through hexdump"
Gawk works fine with binary files for me. Using FIELDWIDTHS for fixed length records or the readfile() extension to slurp in a whole file works fine. The readline() function can also be paired with FIELDWIDTHS to read a fixed number of bytes. Newline separated records with nulls in them also read as expected. I'm curious what problems the author saw with binary and gawk.
Re:Show HN: Awk-JVM – A toy JVM in Awk
by rethab on Wednesday June 24, 2020 @03:44AM
(#23625224)
I actually simply didn't know it was possible based on some googling. But thanks for hint. Someone also opened an issue on github giving me a hint on how to replace hexdump[0]. I'll definitely give this a try :)
"since none of the awks can read binary, you first need to pipe the classfile through hexdump"
Gawk works fine with binary files for me. Using FIELDWIDTHS for fixed length records or the readfile() extension to slurp in a whole file works fine. The readline() function can also be paired with FIELDWIDTHS to read a fixed number of bytes. Newline separated records with nulls in them also read as expected. I'm curious what problems the author saw with binary and gawk.