(no title)
cosmos0072 | 11 months ago
There are more tricks available there, as for example unrolling the loop that calls the list of closures, and having a `nop` closure that is executed when there's nothing to run but execution is not yet at the end of the the unrolled loop.
ALLTaken|11 months ago
I'd love to see, if it's possible to create a libc-free, dependency-free executable without Nim (https://nim-lang.org/).
stevekemp|11 months ago
https://github.com/skx/simple-vm
Simpler than the full gomacro codebase, but perhaps helpful.
cosmos0072|11 months ago
Here is a pseudocode example, adapted from gomacro sources:
https://gist.github.com/cosmos72/f971c172e71d08030f92a1fc5fa...
This works best for "compiling" statically typed languages, and while much faster than an AST interpreter, the "tree of closures" above is still ~10 times slower that natively compiled code. And it's usually also slower than JIT-compiled code