3 ms·
LuaJIT. It's a cutting-edge JIT with remarkably understandable algorithms and source. Every single piece of it is well thought out. Even the asm interpreters ar
by PeCaN 11y ago
LuaJIT. It's a cutting-edge JIT with remarkably understandable algorithms and source. Every single piece of it is well thought out. Even the asm interpreters are pretty clean and explain why they work the way they do.
Mike Pall is a demigod.
- chadcmulligan 11y agothe lua vm to, the code is so small but works so well.
- jballanc 11y agoLuaJIT is, indeed, a genius masterwork, but it's also very intricate and complex. I'm not entirely sure anyone other than Mike Pall could understand it completely. On the other hand Lua (The Original™) is also a beautiful bit of programming, and much more approachable. If you've ever wondered what it means when people talk about "Stack-based VMs", reading through the Lua source is an excellent way to learn more.
- PeCaN 11y agoBut... Lua is a register-based VM since like Lua 5. Not disputing that Rio Lua is also an excellent work though. Lua 5.1 only has 38 opcodes total. A complete description of how the VM works fits on a page or so.
- jballanc 11y agoD'oh, my mistake. The VM is, indeed, register-based. The C API is stack-based. But yes, a very lovely bit of code all together.