lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Sep 18, 2014 at 7:02 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> I don't think srlua is great hackery...
>         http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#srlua

I agree, it simply exploits the fact that you may append readable data
to the end of your executable, and read it later (works fine on both
Windows and POSIX systems, i.e. not requiring any specific 'resource'
compiler).

Of course, that data must be a single Lua script.  luabuild [1]
reduces a Lua program to a standalone executable like so:
   - uses Jay Carlson's soar to pack the program into a single
'archive'. soar can use either static or dynamic analysis, either
looking for requires in bytecode or tracking requires dynamically when
the program is run.  It makes an archive, and finds what C extensions
were used
 - that list is used to compile a custom statically-linked Lua 5.2 stub
- which is glued to the archive with srlua.

luabuild is a 'micro' distribution, it just has the usual suspects,
like lfs, socket, lpeg, sql, posix, winapi, etc.  A general solution
would probably require the backing of a full distribution like LuaDist
and I believe something like this is on that project's roadmap.

steve d.
[1] https://github.com/stevedonovan/luabuild