davydog187
Lua - an ergonomic interface to Luerl, aiming to be the best way to use Luerl from Elixir
I wanted to announce the stable release of a project started at TV Labs, called Lua.
Features
~LUAsigil for validating Lua code at compile-timedefluamacro for exposing Elixir functions to Lua- Improved error messages and sandboxing
- Deep setting/getting variables and state
- Excellent documentation and guides for working with Luerl
Lua the Elixir library vs Lua the language {: .info}
When referring to this library,
Luawill be stylized as a link.References to Lua the language will be in plaintext and not linked.
From the blog post
The first stable release of the Elixir library, Lua v0.1.0, has been released to hex.pm!
Lua is a library that allows you to execute arbitrary, sandboxed Lua programs directly on the BEAM VM. This is not embedding the C Lua runtime and compiler, but rather a complete implementation of Lua 5.3. This feat is made possible by the underlying Luerl library, which implements a Lua parser, compiler, and runtime, all in Erlang.
The Lua Elixir library extends the capabilities of the Luerl library, improving error messages and providing robust documentation.
Most Liked
davydog187
I have released version v0.2.0
[v0.2.0] - 2025-05-14
Changed
- Any data returned from a
defluafunction, or a function set byLua.set!/3is now validated. If the data is not an identity value, or an encoded value, it will raise an exception. In the past,Luaand Luerl would happily accept bad values, causing downstream problems in the program. This led to unexpected behavior, where depending on if the data passed was decoded or not, the program would succeed or fail
Full Changelog: Comparing v0.1.1...v0.2.0 · tv-labs/lua · GitHub
Release tag: Release v0.2.0 · tv-labs/lua · GitHub
Hex: lua | Hex
davydog187
[v0.2.1] - 2025-05-14
Added
Lua.encode_list!/2andLua.decode_list!/2for encoding and decoding function arguments and return values
Fixed
- Ensure that list return values are properly encoded
Full Changelog: Comparing v0.2.0...v0.2.1 · tv-labs/lua · GitHub
christhekeele
This looks excellent, excited to play with it and keeping an eye out for future luerl updates!
sodapopcan
davydog187
[v0.3.0] - 2025-06-09
Added
- Guards for encoded Lua values in
defluafunctionsis_table/1is_userdata/1is_lua_func/1is_erl_func/1is_mfa/1
Fixed
defluafunction can now specify guards when using or not using state
Full Changelog - Comparing v0.2.1...v0.3.0 · tv-labs/lua · GitHub







