by vvoruganti on 5/2/24, 5:38 PM with 23 comments
by vvanders on 5/3/24, 4:27 AM
Tons of awesome technical details in the post and I've always felt that Lua's co-routines are incredibly undervalued. We used to run Lua in all sorts of crazy places and it really punches above its weight.
The above quote + zoom out at the end also makes some really good observations. Some of the most powerful systems I've worked on picked a couple core technologies that were complementary with good interop rather than a one-size fits all. Will be interesting to see where Piccolo goes.
by 10000truths on 5/3/24, 1:35 AM
The issue is that there exist ways to make a single bytecode instruction take an unbounded amount of time to execute. For example, Lua's "string.find()" is implemented in native code. The interpreter only sees a single OP_CALL opcode, so it will count it as 1 instruction executed. But the actual execution time of the native implementation of string.find() is dependent on its inputs, which are not only variable length strings, but can be maliciously crafted to run in exponential time. Here's an example, shamelessly stolen from Mike Pall himself:
string.find(string.rep("a", 50), string.rep("a?", 50)..string.rep("a", 50))
The only way to solve this is to track execution time within the native code as well (i.e. make them fuel-aware), and ensure that they abort immediately if they exhaust the fuel.by wis on 5/2/24, 7:53 PM
Piccolo looks amazing, I got a perfect use case for it, and I'm excited for when I get the chance to use it, thank you for working on it.
by rnmmrnm on 5/2/24, 6:32 PM
Is this library offering a lua implementation more well-designed for this use-case? I got all this code to unload the coroutine stack to store and and reload it before continuing it later. Does having C bindings to this library makes sense?
by camgunz on 5/3/24, 8:49 AM
by klaussilveira on 5/2/24, 7:50 PM
by qudat on 5/2/24, 6:37 PM
by jxyxfinite on 5/2/24, 7:58 PM
by alberth on 5/3/24, 12:45 AM
Please don’t use monospaced fonts for long-form text.
It’s extremely different to read because your eye struggles to see the “shape” of each word, when everything is equally spaced apart.