davydog187

davydog187

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

https://github.com/tv-labs/lua

Showing Posts 1 to 7

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 OP

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 OP

[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

davydog187

davydog187 OP

[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

davydog187

davydog187 OP

Lua v1.0.0 and now v1.0.2 have been released!

It is a full rewrite of Lua from the ground up, implementing a full lexer/parser, compiler, and virtual machine, all in pure Elixir.

I have also built a companion website with a language tour and playground for you to test it out! There will be a blog post with more details about how it was built and used in the coming weeks.

aaronrussell

aaronrussell

I have a soft spot for Lua. This is great :clap:t2:

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews