Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to distribute Lua and libraries?

I'm looking at moving a program that currently embeds a Python interpreter to use Lua. With Python it's fairly easy to use modulefinder, compileall, and zipfile to make a nice tidy zip containing all the external libraries used.

Does Lua have the ability to bundle up its libraries like that, or is there some better best practice for distributing programs that embed Lua?

like image 627
SJML Avatar asked Jun 17 '10 21:06

SJML


1 Answers

As is typical with Lua, there's no one standard and a lot of people roll their own. There's an effort to standardize on a package-management system called Lua Rocks, but I'm not sure how much momentum is behind it or how mature it is. (In 2008 it was not quite ready for prime time, but things may have changed.)

I myself am very low tech: if I want to distribute something, I just turn my Lua sources into C files and link them in with the binary. Finding and converting all the modules could be a bit tedious for me, but quite the easiest thing for my users—they don't even need to know that Lua is involved. I've posted a copy of my lua2c script at Pastebin. I have the option of compiling but I generally don't compile because the results are not portable and because the Lua compiler is so fast anyway.

It would be nice to have something more automated. I think it would probably take several days to write and debug a good tool.

People on the Lua mailing list will surely know more.

like image 100
Norman Ramsey Avatar answered Oct 15 '22 22:10

Norman Ramsey