Reminds me a lot of the ideas behind Semantic Dictionary Encoding (1994):
Thank you for this. This looks a lot like a vague idea that I’ve had, have seen some related discussion on, and have been interested in exploring myself as part of my work on Dawn. This seems like a considerably better basis for a portable runtime (and, potentially, OS) than WebAssembly, and I look forward to experimenting with the concept.
You’re welcome. A couple more links regarding this technology:
this paper is great. I really like the idea of finding just the right runtime data formats and algorithms to be able to move most of the computation to a pregeneration step.
section 3 does seem pretty specific to the details of their (awesome) hack to repurpose clang+LLVM+tail calls+GHC calling convention to do their codegen for them. I wish they had described their stencils more abstractly, as if they had implemented the entire toolchain from scratch, and then left the description of how they got clang to spit out the binaries they wanted to a later section/appendix.
Interesting. This seems similar to LuaJIT’s DynAsm or the DynAsm Rust crate, which is used in the Wasmer runtime, except instead of incrementally pushing machine code onto a stack/Vec, it’s pushing blocks of code and then fixing them up? I’m amazed the performance difference is that large. I’ll have to keep reading…
A big difference is that they rely on the compiler to generate optimal code instead of having programmers write assembly. This is probably a big perf difference.
Yes, the large library of compiler-generated templates adequately explains superior runtime performance, but I’m amazed that the compile-time performance is that much better than Wasmer Single Pass.