41 I understand some of that. Not that familiar with PHP, so that explains most of my confusion.
40 I only wrote lua today though
That is one of the reasons this new method is so much better. There are just a few variables you need to pass to it and it will work.
This can either be done by appending it to the script or by injecting it. Even passing the results back is now done inside that script though this can easily be overwritten (which I'm going to do on the php side, as that makes things easier and faster)
The result is that it is really easy to get it working inside WASM. Before this approach I had to find a way to get the needed values from JS over to C which passed it to lua and find a way to go the other way. (Mind you, I never wrote any C code, let alone C code that runs inside the browser)
Now, getting the results back is already implemented meaning I only need to pass some values from JS to Lua. Those values however have an easy and known structure, so at worst I can just have JS turn it in how you would write the data in Lua and add that to the beginning of the script. No need to pass it to C first or anything
(I also need a way to limit how long the script can run inside WASM. But first, get it working on the php side. Would be awesome if that also could be handled by lua itself though)