mine is similar to k6 parser from effbiae.com/parserclub. also john's parser combinators for tokenization. but just as k, w cannot return multiple values (token + size), so i store the current input position at the global memory address 8.
some subtle differences with the random numbers. O stores the resulting grayscale (255x255) max 255, which can be shown as pgm with header "P2\n256 256\n255\n"
ngn/k (my port) runs at 0.76s ktye (tcc version) runs at about 4s
@ktye your lambda basically transforms an old O into a new O. it's simpler as: 256{[O]..}/(m#0),w#255, and you can remove the 256 if you want an endless loop
@chrispsn I was reasonably pleased with the size of speciak-K's recursive-descent parser. the tokenizer still has an ugly hack for minus disambiguation and depends on fairly rich regular expressions. There are many ways to make tokenization simpler, but less compact in JS.
my printing is very slow (for large vectors). currently i use $x which produces a list of strings then join. that needs to create a lot of small buckets and is probably a bad idea.