@chrispsn the parser in this case is still a recursive-descent approach riddled with special-cases, but I'm working on simplifying it. The ASTs are much simpler, and I rationalize adverbs and all forms of application into verbs and dot-apply, respectively, at parse time. Special K has a more clearly delineated tokenize-parse process than oK, and the compiler is totally different from the oK interpreter; among other things I have to perform static type inference.
@JohnE very interesting! is it building an array of pixels for each frame? btw, i do similar things (type inference) in w, that compiles from k/apl syntax to wasm.
@ktye that's essentially how a fragment shader works, yes. The shader program is run in parallel for every pixel which is drawn. All the program knows, in each instance, is the x/y/z screen-space coordinates that the rendering pipeline has produced so far, and any other "uniforms" of metadata that are automatically fanned out to every fragment. The output of the program is an RGBA color value for that pixel.
it would be mostly trivial to make the special-k compiler emit vertex shaders, too (it's the same target language), but it would make the setup of the sandbox quite a bit more elaborate and you'd want a few features that are currently still nyi like the matrix types