← Back to context

Comment by slmjkdbtl

3 years ago

I love Lua but tbh I accept JS as the default scripting language, simply because it's ubiquitous, most runtimes are faster than or on par with Lua, and not harder to embed than Lua with stuff like quickjs. Also I don't think from language design perspective there's fundamental difference beyond syntax, metatable is pretty similar to prototype chain, JS has much more stuff you can argue it's bloated compare to Lua but you don't really pay for what you don't use.

Does Lua have the ability to launch very low cost sandboxed instances?

With Deno I know I can quickly spawn lots of isolated instances at very low overhead.

If I really want to push it far, there's tools for loading frozen snapshots that have lots of code loaded.

I've never seen similar from Lua & I'm not sure it exists. Seems like a huge advantage.

  • Creating a new lua context is pretty cheap, but I don't know how it compares to Deno / v8. It should be much lighter weight, but not sure if Deno / v8 does some special thing to speed up the use case you talked about.

    • The submission itself talks about creating & loading snapshots, which is sort of a Checkpoint Restore In Userspace (CRIU), allowing one to create a new context with a lot of existing libraries already loaded very very quickly.

  • >With Deno I know I can quickly spawn lots of isolated instances at very low overhead.

    Err..new to Deno - how does one do this ?