news.volyx.in

Building the fastest Lua interpreter automatically (sillycross.github.io)

571 points by hr0m · 1385 days ago · 109 comments on HN

Article summary

The article discusses a research project to automatically generate high-performance interpreters for dynamic languages, specifically Lua. The project, called LuaJIT Remake, uses a meta-compiler called Deegen to generate a Lua interpreter from a semantical description of the bytecode. The resulting interpreter outperforms LuaJIT's interpreter by 28% and the official Lua interpreter by 171% on average. The project aims to make writing high-performance virtual machines easier by automating the process.

Main themes

  • automatic interpreter generation
  • high-performance virtual machines
  • Lua and LuaJIT
  • compiler optimization
  • calling conventions
  • register usage
  • garbage collection
  • language implementation
  • Haskell and Lua bindings
  • dependency management

What commenters say

  • The article's performance comparisons are misleading because they only compare the interpreter, not the JIT compiler.
  • The use of inline caching is a significant optimization that contributes to the performance gain.
  • The project's approach is not entirely new, as there are prior art and existing tools that achieve similar goals.
  • The comparison between LuaJIT and the new interpreter may be affected by differences in garbage collection implementation.
  • The project's dependency on LLVM may be a limitation, and alternative approaches using other compilers or languages could be explored.
  • The article's discussion of calling conventions and register usage is interesting and relevant to the project's goals.
  • The performance gain is not solely due to the automatic generation of assembly code, but also due to other optimizations and improvements.
  • The project has implications for other languages and use cases, such as JavaScript and Haskell.
  • The use of a meta-compiler like Deegen can abstract away low-level details and make it easier to write high-performance interpreters.