davydog187

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

  • ~LUA sigil for validating Lua code at compile-time
  • deflua macro 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, Lua will 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.

Blog post
Documentation

Most Liked

davydog187

davydog187

I have released version v0.2.0

[v0.2.0] - 2025-05-14

Changed

  • Any data returned from a deflua function, or a function set by Lua.set!/3 is now validated. If the data is not an identity value, or an encoded value, it will raise an exception. In the past, Lua and 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

davydog187

[v0.2.1] - 2025-05-14

Added

  • Lua.encode_list!/2 and Lua.decode_list!/2 for 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

christhekeele

This looks excellent, excited to play with it and keeping an eye out for future luerl updates!

sodapopcan

sodapopcan

Ha, congrats on the release! I did not realized I’d happened upon something that hadn’t been officially announced yet when asking this :grin:

davydog187

davydog187

[v0.3.0] - 2025-06-09

Added

  • Guards for encoded Lua values in deflua functions
    • is_table/1
    • is_userdata/1
    • is_lua_func/1
    • is_erl_func/1
    • is_mfa/1

Fixed

  • deflua function can now specify guards when using or not using state

Full Changelog - Comparing v0.2.1...v0.3.0 · tv-labs/lua · GitHub

Where Next?

Popular in Libraries Top

hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
zoltanszogyenyi
Hey everyone :wave: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-source U...
New
tompave
Hello there, I would like to share a feature toggles library (AKA feature flags) I’ve been working on. The main package is FunWithFlags...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
cjen07
parameterized pipe in elixir: |n> edit: negative index in |n> and mixed usage with |> are supported example: use ParamP...
New
danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. [demo] The distributed characteristics of Elixir and the low memory foo...
New
Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement