← Back to context

Comment by _acco

15 hours ago

This is so cool. A key benefit is that it's not embedding the C Lua runtime and compiler, but rather implements Lua in the host language (Elixir/Erlang).

When sandboxing user code in another runtime, you need to serialize the data to and from that runtime. That comes with a performance penalty.

So, for example, if you sandbox code in WASM, you need to pick a transport data format, like JSON. You need to serialize Elixir data structures into JSON, send it to WASM, and then deserialize the result. For a high-performance data pipeline, this adds up!

But if your sandbox is in the host language, no serialization/de-serialization is required. You can execute the sandboxed language in microseconds.

I wrote more about this here: https://blog.sequinstream.com/why-we-built-mini-elixir/

Wish this library existed just a couple months ago!