frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Web.whatsapp.com appears to be having issues syncing and sending messages

http://web.whatsapp.com
1•sabujp•33s ago•1 comments

Google in Your Terminal

https://gogcli.sh/
1•johlo•1m ago•0 comments

Shannon: Claude Code for Pen Testing

https://github.com/KeygraphHQ/shannon
1•hendler•2m ago•0 comments

Anthropic: Latest Claude model finds more than 500 vulnerabilities

https://www.scworld.com/news/anthropic-latest-claude-model-finds-more-than-500-vulnerabilities
1•Bender•6m ago•0 comments

Brooklyn cemetery plans human composting option, stirring interest and debate

https://www.cbsnews.com/newyork/news/brooklyn-green-wood-cemetery-human-composting/
1•geox•6m ago•0 comments

Why the 'Strivers' Are Right

https://greyenlightenment.com/2026/02/03/the-strivers-were-right-all-along/
1•paulpauper•8m ago•0 comments

Brain Dumps as a Literary Form

https://davegriffith.substack.com/p/brain-dumps-as-a-literary-form
1•gmays•8m ago•0 comments

Agentic Coding and the Problem of Oracles

https://epkconsulting.substack.com/p/agentic-coding-and-the-problem-of
1•qingsworkshop•9m ago•0 comments

Malicious packages for dYdX cryptocurrency exchange empties user wallets

https://arstechnica.com/security/2026/02/malicious-packages-for-dydx-cryptocurrency-exchange-empt...
1•Bender•9m ago•0 comments

Show HN: I built a <400ms latency voice agent that runs on a 4gb vram GTX 1650"

https://github.com/pheonix-delta/axiom-voice-agent
1•shubham-coder•9m ago•0 comments

Penisgate erupts at Olympics; scandal exposes risks of bulking your bulge

https://arstechnica.com/health/2026/02/penisgate-erupts-at-olympics-scandal-exposes-risks-of-bulk...
3•Bender•10m ago•0 comments

Arcan Explained: A browser for different webs

https://arcan-fe.com/2026/01/26/arcan-explained-a-browser-for-different-webs/
1•fanf2•12m ago•0 comments

What did we learn from the AI Village in 2025?

https://theaidigest.org/village/blog/what-we-learned-2025
1•mrkO99•12m ago•0 comments

An open replacement for the IBM 3174 Establishment Controller

https://github.com/lowobservable/oec
1•bri3d•14m ago•0 comments

The P in PGP isn't for pain: encrypting emails in the browser

https://ckardaris.github.io/blog/2026/02/07/encrypted-email.html
2•ckardaris•17m ago•0 comments

Show HN: Mirror Parliament where users vote on top of politicians and draft laws

https://github.com/fokdelafons/lustra
1•fokdelafons•17m ago•1 comments

Ask HN: Opus 4.6 ignoring instructions, how to use 4.5 in Claude Code instead?

1•Chance-Device•19m ago•0 comments

We Mourn Our Craft

https://nolanlawson.com/2026/02/07/we-mourn-our-craft/
1•ColinWright•21m ago•0 comments

Jim Fan calls pixels the ultimate motor controller

https://robotsandstartups.substack.com/p/humanoids-platform-urdf-kitchen-nvidias
1•robotlaunch•25m ago•0 comments

Exploring a Modern SMTPE 2110 Broadcast Truck with My Dad

https://www.jeffgeerling.com/blog/2026/exploring-a-modern-smpte-2110-broadcast-truck-with-my-dad/
1•HotGarbage•25m ago•0 comments

AI UX Playground: Real-world examples of AI interaction design

https://www.aiuxplayground.com/
1•javiercr•26m ago•0 comments

The Field Guide to Design Futures

https://designfutures.guide/
1•andyjohnson0•26m ago•0 comments

The Other Leverage in Software and AI

https://tomtunguz.com/the-other-leverage-in-software-and-ai/
1•gmays•28m ago•0 comments

AUR malware scanner written in Rust

https://github.com/Sohimaster/traur
3•sohimaster•30m ago•1 comments

Free FFmpeg API [video]

https://www.youtube.com/watch?v=6RAuSVa4MLI
3•harshalone•30m ago•1 comments

Are AI agents ready for the workplace? A new benchmark raises doubts

https://techcrunch.com/2026/01/22/are-ai-agents-ready-for-the-workplace-a-new-benchmark-raises-do...
2•PaulHoule•35m ago•0 comments

Show HN: AI Watermark and Stego Scanner

https://ulrischa.github.io/AIWatermarkDetector/
1•ulrischa•36m ago•0 comments

Clarity vs. complexity: the invisible work of subtraction

https://www.alexscamp.com/p/clarity-vs-complexity-the-invisible
1•dovhyi•37m ago•0 comments

Solid-State Freezer Needs No Refrigerants

https://spectrum.ieee.org/subzero-elastocaloric-cooling
2•Brajeshwar•37m ago•0 comments

Ask HN: Will LLMs/AI Decrease Human Intelligence and Make Expertise a Commodity?

1•mc-0•38m ago•1 comments
Open in hackernews

Lua for Elixir

https://davelucia.com/blog/lua-elixir
211•davydog187•9mo ago

Comments

joshprice•8mo ago
This is awesome! Can't wait to find some use cases to embed a sandboxed and safe mini Lua language in our apps.

https://hexdocs.pm/lua/Lua.html

davydog187•8mo ago
Thanks Josh, hope to see you soon, its been a while
joshprice•8mo ago
Likewise! ElixirConfUS?
davydog187•8mo ago
Probably not, you should come to Code BEAM NYC, although a bit of a trek for you.

I will be trying to travel more in 2026

xvilka•8mo ago
There is also Lua implementation in safe Rust - Piccolo[1]

[1] https://github.com/kyren/piccolo

behnamoh•8mo ago
Recently, I had a simple Flask project, just a single Python file, and wanted to convert it to Elixir using AI. But what I got was a sprawling directory of modules and files in Elixir. Apparently, that’s just how things are done in the Elixir world. That moment made me realize why some languages catch on while others struggle. If spinning up a basic web server already feels like jumping through hoops, I can’t imagine the overhead for more complex projects.

I'm sure there are people who think Elixir/Phoenix >> <other-solutions>, but for me it was a nightmare.

OTOH, the language is beautiful as it's macros all the way down.

devoutsalsa•8mo ago
You can write a single file Elixir app if you want to. There's nothing preventing this. Setting up a simple web server w/ Plug is straightforward. You'll have the same problems you'd have with a non-trivial Flask app, which is that scrolling through a huge file is a pain.
johnisgood•8mo ago
My only issue when it comes to Erlang and Elixir (or Java and Kotlin) is that there are just so many files I need to open and keep track of. I do not blame the languages, of course, but it is the reason for why I use Go for less serious projects instead of Erlang / Elixir, because in Go it would typically be contained in one file, whereas in Elixir it would span across multiple files.
ffsm8•8mo ago
You gotta be trolling...

You're literally responding to someone pointing out you don't need multiple files in elixir.

And the same is true for Java and kotlin. Heck even the official spring boots demo videos define everything in a single file nowadays.

Multiple files is just a convention, because otherwise your project will become unhandy eventually. That applies to Go as well.

johnisgood•8mo ago
I am talking about the typical / usual case. In fact, you typically use "mix phx.new" for projects using Phoenix in Elixir, and it creates lots of files, as opposed to "import ..." in a single Go file. I never said that it is impossible to do in Elixir (or Java), but it is not the typical case.
prophesi•8mo ago
That's the typical use case if you want a web server. If you're writing for low-level devices, you'd use `mix nerves.new project_name`. If you're writing an Elixir app that won't be a web server, you'd use `mix new project_name`. If you're writing an elixir script, you'd use `touch script_name.exs`
johnisgood•8mo ago
Yes, of course. You are right.
cess11•8mo ago
I tend to build my prototypes as single file Elixir scripts. These are sometimes rather bulky with a bunch of logic and IO modules with some helper modules on the side. It's only when I believe in the idea that I reach for phx_new and start writing tests and copying in code into a full Phoenix project.

When I started out with Phoenix I learned a lot from studying the boilerplate it can generate. If you just need a route and serve some JSON or a file on it you can turn off most of the code generation and do precisely that, in case you're sure that's what you want. I think the default being that you can immediately flesh out auth and CRUD for whatever tabular data model you want is rather sensible.

johnisgood•8mo ago
I typically use specific flags to "mix phx.new" that gets rid most of the files, especially JavaScript and whatnot. I am not at my PC right now and I forgot the flags, but I am sure you know what I am referring to.

I never tried starting with Elixir scripts, I will give that a try.

cess11•8mo ago
Someone linked the Plug docs elsewhere in this subthread, those show you how you can quickly launch a web server from a single file, including one with WebSocket capability.

In my opinion Elixir scripts punch way above their weight. It's trivial to pull in the same dependencies as you would in a full project and you can easily keep a set of five or ten template scripts just laying around and copy those when you want a quick start with some boilerplate for a set of dependencies that often comes in handy. You could do something similar with mix plugins but it requires a bit more effort.

johnisgood•8mo ago
Side-note: considering you like Prolog, how come you are not writing Erlang instead of Elixir?
cess11•8mo ago
It's harder to teach to juniors with a background in stuff like JavaScript and Python. While it has a rather nice elegance and simplicity to it Erlang is a bit more demanding from a business and organisational perspective.

A clever intern with a rather shallow two year 'bootcamp' education and no work experience picks up Elixir and Phoenix in a couple of months. People with background in enterprise algolians like Java and C# can also get productive in Elixir kind of fast since it allows similar patterns.

In my experience Lisp-like languages prepare well for Erlang, and that's a very rare background where I live.

johnisgood•8mo ago
Where do you live if you do not mind asking? Europe? Western Europe, Eastern Europe?
cess11•8mo ago
A sparsely populated part of Sweden.
devoutsalsa•8mo ago
I actually like Erlang, but I personally feel it has a lot of rough edges. I'd probably spend a lot of time polishing them to the point where I'd just reinvent Elixir, so I prefer Elixir for that reason alone.

The other reason I wouldn't use Erlang is that Elixir has a much more vibrant & active community. A lot of the Erlang libraries (as of a few years ago when I last looked) were quite old & there wasn't a lot of active development being doing on them. I like being able to track down answers to questions & documentation that is more current. And of course there are more likely to be off the shelf Elixir libraries available for download, too.

victorbjorklund•8mo ago
Typical no one writes a large web app in a single Go-file.
johnisgood•8mo ago
Well, that is unfair, because you added "large". If we compare large web apps between Elixir and Go, I am pretty sure Go would still have fewer files overall.
victorbjorklund•8mo ago
If you are just doing a script in Elixir it is just one file. You have no experience with Elixir so not sure why you keep arguing when people tell you that you are wrong.
johnisgood•8mo ago
I do have experience with Elixir though, I am not sure where you have gotten your conclusions from. What do you think are my claims? I know it is possible to do everything in a single file, but that is NOT the typical case, and you know it. Additionally, I really did not consider myself arguing.

I prefer fewer files, usually, especially when I am just trying to show something up as soon as possible. I do not mind having a serious project written in Elixir (which I have) that spans across multiple files, though.

At any rate, what am I wrong about? I expressed my preference. When I want to get things done ASAP, I stick to Go these days (one file). If I know it is going to be a serious project, I stick to Elixir (multiple files). There is not much to it really. I apologize if I came across as argumentative.

victorbjorklund•8mo ago
I thought you claimed that you just asked AI and you mistakenly thought elixir requires a lot of files (something that is 100% false). How many years jave you been an elixir developer if you claim to have experience?
johnisgood•8mo ago
I did not ask AI about this (not sure where you got this from, it was probably someone else), nor have I thought that Elixir technically requires a lot of files, but typically you do have more files, just like in Erlang, which is why I said I use Go for less serious projects. Challenge: find me any serious projects in Erlang or Elixir that consists of less than 4-6 files. And I mean, we are talking about web frameworks, so, "mix phx.new" alone creates a lot of files (100% true, even with specific CLI flags).

If you have experience with these languages yourself, then you know that separation of concerns is a core principle. Elixir (and Erlang) projects, especially those built with Phoenix or OTP principles involve a multitude of files, even for relatively small applications. This is not because the languages require them per se, but rather because the conventions and idioms of both languages, especially within the OTP framework encourage modular, isolated units of behavior spread across separate files, which I do not think is a bad thing in itself.

> If you are just doing a script in Elixir it is just one file.

I know! I already left a comment agreeing with someone else saying that, which I have known already anyways.

Again, I was voicing my frustration with keeping track of a lot of files, which is not what I want to do in the case of not-too-serious projects, which is why I use Go for less serious projects, as I have previously mentioned. I do not always mind having a lot of files, but there are cases when I do, just like how one may not prototype in a low-level language as opposed to a high-level one.

In any case, I hope I could clarify well enough for you. Do we still disagree?

mustermannBB•8mo ago
Are you comparing Elixir with a framework as extensive as Phoenix to Go and "just" its standard http library? If so I'm not sure that would be a good comparison then.
johnisgood•8mo ago
No, you could import a full-blown framework and have it set up within one single file, in fact, that is how you usually start, typically... Unless you like having lots of files, of course. I have used such Go libraries / frameworks before, and it all started out as a single file, but with Phoenix, you start with lots of files. I am not saying it is a bad thing, I am just expressing my preference to fewer files. Organization and modularity are great, but in the case of Go, I create the files myself (so I am more aware of everything that is going on). In case of Phoenix ("mix phx.new"), it is done for you. Again, not saying it is a bad thing. I am fine with it by now, but it was overwhelming and demotivating in the beginning, as opposed to, say, Go.
technojamin•8mo ago
Here's a 22-line Elixir script that spins up a webserver: https://hexdocs.pm/plug/readme.html#hello-world-request-resp...

There's another single-file example on that page that shows how to implement routing. The reason AI probably gave you a more fleshed out project structure is because people typically default to using Phoenix (Elixir's equivalent of Rails) instead of going for something simpler like Plug.

After getting a result you didn't like with AI, did you try refining your prompt to state that you wanted a single-file structure?

sodapopcan•8mo ago
> After getting a result you didn't like with AI, did you try refining your prompt to state that you wanted a single-file structure?

I believe the prompt was: "Please compose a backhanded comment about Elixir I can post in a Hacker News thread about an Elixir blog post. The content of said blog post is irrelevant, I just want people to know I prefer Python."

butterNaN•8mo ago
That is categorically not "how things are done" in the Elixir world. Have you considered that the Advanced Next Token Predictor may be imperfect?
__jonas•8mo ago
It kind of is though, regardless of what the LLM did there, the 'happy path' with something like Phoenix is using the phx.new and the generators which gives you a ton of files and structure that is a bit overwhelming for people used to more 'minimalist' web frameworks.

Check this out this guide from the Phoenix docs:

https://hexdocs.pm/phoenix/json_and_apis.html

That's a ton of stuff just to return some JSON from an endpoint. Sure the structure probably helps when you get into big complex projects, but for a beginner not used to this style of framework it looks like a lot.

pessimizer•8mo ago
Elixir is to Phoenix as Ruby is to Rails. The original comment was about Elixir, not Phoenix.

It also explicitly mentions Flask, which would be inane to directly compare to either Phoenix or Rails. How complex is your Django app, Mr. Python?

johnisgood•8mo ago
Your comment comes across a bit hostile.

Regardless, I believe "something like Phoenix is using the phx.new and the generators which gives you a ton of files and structure that is a bit overwhelming " is true, it can be overwhelming, when the same thing in, say, Go, would be only one file.

__jonas•8mo ago
Ok sure, but Phoenix is the go-to solution for web projects in Elixir, especially newcomers are frequently told to just use Phoenix instead of trying to build on Plug.

The feedback from the Python person was a bit harsh, and evaluating a language based on LLM generated code is of course silly, but I think some of it still holds true. I'd love for Elixir to be a more approachable solution for simple web services.

bn-usd-mistake•8mo ago
Isn't Phoenix more like Django (rather than Flask) which would also generate multiple files?
sodapopcan•8mo ago
Yes, and the same point should apply to Django from Flask. I think the point being made is that it's not immediately obvious that Elixir does have a microframework in Plug and that is a fair assessment. Just from my own observations this is because there is very little interest in such a thing (it's not zero, but it's low). Most of us have realized that using micro-frameworks leads you to inventing Phoenix/Django/Rails anyway so why not start there? Phoenix especially is pretty lightweight, even with "all those files." I think making Plug more prominent even in the Phoenix docs wouldn't be a terrible idea.
sodapopcan•8mo ago
Sigh, here we are with people taking what "AI" tells them as law. It's gonna be a fun next-few-years.
bad_haircut72•8mo ago
You need to watch this

https://m.youtube.com/watch?v=SxdOUGdseq4&pp=0gcJCdgAo7VqN5t...

We should try not to make technical judgements based in flippant things like how few lines can someone not even familiar with the ecosystem get a hello world working

sph•8mo ago
I was afraid AI and vibe coders were gonna steal my job, but looks like I haven’t got much to worry about, least of all AI-assisted dementia.
arcanemachiner•8mo ago
Elixir is somewhat lacking in training data compared to some more popular languages, so AI will often regurgitate nonsense (more so than in more popular languages).

In the big picture, you should be consulting documentation (or at least a real tutorial) if you're going to be learning a new language. Hell, I'll use AI to bootstrap my knowledge when possible, but it's always important to fall back onto the old method when the quick-and-dirty AI attempt doesn't work out.

rickcarlino•8mo ago
We used Luerl, the underlying Lua engine, in production for years as a sandboxed scripting environment for FarmBot devices back in the day. Users could execute scripts directly on the device to control peripherals. It was a solid library and the community support was great. From an ergonomics perspective, developers preferred this approach over API calls. I am surprised more projects don’t provide a Lua scripting layer.
benwilber0•8mo ago
> I am surprised more projects don’t provide a Lua scripting layer.

Completely agree. I've been adding Lua scripting support to pretty much everything I make now. Most recently my programmable SSE server [1]. It's extended the functionality far beyond anything that I would have had the time and patience to do myself. Lua is such a treat.

[1] https://github.com/benwilber/tinysse

helpfulContrib•8mo ago
>Lua is such a treat.

It sure is.

I've been using Lua professionally and personally for some decades now, and I think that there is no need to be surprised that more projects don't provide a Lua scripting layer, because actually, Lua is everywhere. And the scripting aspect is one thing - but its not the only reason to use Lua.

Lua is so easily embeddable and functionally productive as a development tool, its not always necessarily necessary to have this layer exposed to the user.

Sure, engines and things provide scripting, and that is a need/want of the respective markets. Who doesn't love redis, et al.?

But Lua can be put in places where the scripting aspect is merely a development method, and in the end shipped product, things are tightly bound to bytecode as an application framework beyond scripting.

The point being, Lua is such a treat that it is, literally, in places you might least expect - or at least, will find under a lot of covers.

And after all, thats the beauty of it: as an embedded language/VM/function interface, Lua can sure scale to different territories.

Philpax•8mo ago
Very nice, but it is confusing to name a library for using a language the same thing as that language. I suppose this is meant to be a temporary state of affairs while Lua (the library) gets merged into Luerl, but I would have personally called it Luerl++ or such.
davydog187•8mo ago
Author here!

Luerl++ is not a valid module name :)

More seriously, I considered alternate names, but settled on this because it was short, literal, and given that its in the context of Elixir, makes sense when using it.

As you stated, the hope is to consolidate it into Luerl at some point

antfarm•8mo ago
Have you considered "Luex", a nod to Luerl but with the typical Elixir suffix?
shakna•8mo ago
Humble appeal, because they'd win instantly: Please don't steal my useless project's name [0].

[0] https://luarocks.org/modules/shakna-israel/luaex

davydog187•8mo ago
I have a personal mission to never name any libraries with the -ex prefix
tommica•8mo ago
Curious, why?
davydog187•8mo ago
Early in the Elixir days, every library was named Thing-ex of ex-Thing.

IMO this is really lazy in terms of naming and from a usage perspective, you get really tired of typing that out in code.

I think we can do better

antfarm•8mo ago
Suffixing a name with -ex often results in unique names, which helps filtering search results. I see a slight problem with name ending on an s though.

Also, aren't you the author of jqex? ;)

davydog187•8mo ago
Touche, although that is a 5 line utility.

Filtering which search results? On hex.pm that’s irrelevant. On good “library name + elixir”

toast0•8mo ago
Within the BEAM ecosystem, consensus is to call something whatever2.

If you wait long enough before replacing whatever2 with something that would be whatever3, you can go back to whatever (see pg -> pg2 -> pg)

davydog187•8mo ago
If you're looking for a cool example of Lua running on the BEAM, check out the creator of Luerl (Robert Virding) space ship demo

https://github.com/rvirding/ship-demo

antfarm•8mo ago
Here is a video demo: https://www.youtube.com/watch?v=NC8Xl6tvjfk

Some instructions to install it on macOS: https://erlangforums.com/t/lt-using-luerl-to-run-spaceships-...

gilgamesh3•8mo ago
Cool project, congrats.

I am trying to understand why would anyone prefer to use Lua to create script instead of Elixir, which supports running scripts. While Lua has lots of users the language just have too many wrong design choices. If I had the choice between Elixir and Lua for scripts I would use Elixir every time.

prophesi•8mo ago
I would also personally prefer Elixir to Lua, but this would be great for allowing isolated/sandboxed BEAM processes to execute Lua code from your end users whom are likely unfamiliar with Elixir. As mentioned in the article, this is precisely what TV Labs uses it for to allow smart tv app developers to write and run tests for their apps.

https://docs.tvlabs.ai/scripting/introduction/getting-starte...

victorbjorklund•8mo ago
This is more for your apps users. Like lets say you have a CRM saas written in Elixir. Then you can allow your users to script things in your app with Lua. If you allow them to use Elixir running in your app you might allow someone to hack your app.
rdtsc•8mo ago
Lua can help if you're handing this over to someone else not just devs who know Elixir.

Also, as the sibling post mentioned, in this case Lua is completely interpreted in an Erlang process. That allows a good amount of sandboxing, they have isolated heaps already and you can control memory limits and other resource usages, and all that in a relatively tiny footprint of a few KBs.

davydog187•8mo ago
Elixir is not a sandboxed language, so you can't just accept arbitrary Elixir programs from users and execute them inside of your application without security concerns. Lua, on the other hand, can be executed in a sandboxed fashion, limiting and constraining the reach of user programs.

Check out Anthony Accomazzo's post about Mini-Elixir, which does a great job breaking this down much further https://blog.sequinstream.com/why-we-built-mini-elixir/

dpflan•8mo ago
Is this influenced by "Embedding Python in Elixir"?

https://dashbit.co/blog/running-python-in-elixir-its-fine

It certainly is more attractive in implementation. Well done!

davydog187•8mo ago
Both the Lua library and Luerl predate Pythonx. I started this library nearly 2 years ago, its only now that I'm releasing a stable version.

However, Pythonx was originally created by a member of our team, Cocoa, who built it in her own free time. The Livebook team forked her project, conceptually, and released it.

https://github.com/cocoa-xu/pythonx

dpflan•8mo ago
Very cool, thank you both for your contributions!
codingbear•8mo ago
what is the Lua equivalent for JVM ecosystem? An embeddable language which you allows for running user scripts in a sandbox?
cess11•8mo ago
LuaJ, or Luna if you're brave. You can likely achieve something similar with other languages that runs on the JVM, like Kawa, Clojure or Jython.
iLemming•8mo ago
Does that mean I can now write Fennel to target BEAM?
davydog187•8mo ago
There is a fennel channel in the discord/slack if you're interested. I'm not sure how successful it has been
johnisgood•8mo ago
Fennel compiles to Lua, so theoretically it should work.

You should be able to do anything Lua does, run on any Lua interpreter, and use any Lua library.

jkaufmann_•8mo ago
I have been waiting for this my whole life
binary132•8mo ago
How sandboxed is BEAM really?
cmdrk•8mo ago
My understanding is that Luerl can remove various modules from being used, like preventing use of the IO library for instance.

I would say BEAM itself is not particularly sandboxed, and certainly clusters of Erlang nodes assume a lot of shared trust.

rdtsc•8mo ago
davydog187, I just wanted to thank you for stepping up and lending Robert a hand. It's nice to see new releases and lots of cleanups happening in Luerl. The project is a real gem and it's nice to see new activity in it!
davydog187•8mo ago
Thanks, I really appreciate that. While its not my main focus by any means, its been a really fun project to chip away at (both the higher level library and Luerl itself).

I do think that it has the potential to be really great with continued investment

interroboink•8mo ago

  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.
Okay, that's actually pretty cool (:

Also a sign of Lua's maturity and popularity, that it's got various independent implementations (LuaJIT, this one, perhaps others I don't know about).

johnisgood•8mo ago
LuaJIT is definitely amazing.
pentacent_hq•8mo ago
I've been considering adding Lua support to Keila for a while already. It seems like a perfect fit for when I'm going to implement email automation and want to allow custom business logic. This would certainly make that plan easier. Thanks OP for sharing the library with the community!
davydog187•8mo ago
Let me know if you have any questions, I'd be happy to assist
_acco•8mo 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!

dlojudice•8mo ago
Fun fact (probably well-known fact for HN audience): Both Lua and Elixir were created by Brazilians. Lua by Roberto Ierusalimschy and team at PUC-Rio in 1993, and Elixir by José Valim in 2011
rvirding•8mo ago
The reason for calling it Luerl was that it was/is an implementation of Lua on Erlang. It is Dave who has been working with a more serious Elixir interface. The original one, which still exists, had a very simple Elixir interface module which just flipped the argument ordering to calls to be more Elixiry in feel.
antfarm•8mo ago
Lua on the BEAM - Dave Lucia & Robert Virding | Code BEAM Europe 2024

https://www.youtube.com/watch?v=4YBBoXXH_98