quick and dirty pure lua webassembly interpreter
1local fileutil = {}
2
3function fileutil.readBytes(path)
4 local file = assert(io.open(path, "rb"))
5 local bytes = {}
6
7 repeat
8 local s = file:read(4096)
9 for c in (s or ""):gmatch(".") do
10 table.insert(bytes, c:byte())
11 end
12 until not s
13 file:close()
14 return bytes
15end
16
17return fileutil