开发者

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

I'm looking at moving a program that currently embed开发者_如何学JAVAs 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?


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.


If it is pure Lua, you might also consider using squish

It's a tool that packs all Lua source files into a single file, with options to gzip/minify it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜