Closed pbtoast closed 5 years ago
Still to do:
Figure out a strategy for storing the following in registers:
Finish implementing opcodes: OP_SELF, OP_LEN, OP_CONCAT, OP_FORLOOP, OP_FORPREP, OP_TFORLOOP, OP_TFORCALL, OP_SETLIST, OP_CLOSURE, OP_VARARG, OP_EXTRAARG
Debug and plug leaks.
This project is taking on enough of its own life that I think it might be best in a separate repo as an add-on to polymec.
It would be neat if we could define various functions in Lua and have them compiled to (relatively) high-performance components.
LLVM is the compiler construction kit that all the kids use these days, but libjit seems to be simpler and possibly faster at compiling code. Libjit uses the LGPL license, so we'd have to load it as a shared library, which would be a performance hit, but it'd still probably outperform native Lua functions by a fairly wide margin. Especially if we provide a multi-eval interface in addition to the usual single-eval one for functions. In any case, it's easy to test the performance once it's working!
Approach:
For details on how Lua's bytecodes work: