Get the latest tech news
Piccolo – A Stackless Lua Interpreter
- A Stackless Lua Interpreter 2024-05-01 - History of piccolo - A "Stackless" Interpreter Design - Benefits of Stackless - The "Big Lie" - Rust Coroutines, Lua Coroutines, and Snarfing - Zooming Out piccolo is an interpreter for the Lua language written in pure, mostly safe Rust with an eye towards safe sandboxing and resiliency. It uses gc-arena for its garbage collection system, and in fact gc-arena was originally created as part of piccolo.
I had to figure out a way to make the entire execution context of piccolo suspendable, just to be able to leave calls to Arena::mutate, so that garbage collection could take place at arbitrary points. This is mostly useful for technical purposes, for example if one Lua task is waiting on some event and cannot possibly currently make any progress, or if some callback must return to the outer Rust caller immediately to take effect. In the previous section I laid out a rough explanation of how to transform PUC-Rio Lua as it exists today and build a system similar to what piccolo forces by design.
Or read this on Hacker News