[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Without a FileSystem?
- From: Pierre Chapuis <catwell@...>
- Date: Tue, 10 Apr 2018 10:50:38 +0200
On Tue, Apr 10, 2018, at 07:18, Sean Conner wrote:
> > I'd use one of the various amalgamation scripts, put the resulting
> > single big script into a char array, and load it from there. But a
> > searcher that loads from a tar would be cool (and probably also useful
> > for others) as well.
>
> I've did a "proof-of-concept" for this, but with ZIP files [1][2]. For
> modules written in Lua, they can be loaded directly from the file; but for
> C-based modules, they have to be written to disk first before loading.
I use something like that at work as well. Sadly it's proprietary and
I don't have permission to share it.
It's not very complicated though. The tar code uses the library from
LuaRocks ([1]). For C modules, I agree they have to be written to disk.
In practice we don't do that, we compile and link them statically with
the executable.
[1] https://github.com/luarocks/luarocks/blob/master/src/luarocks/tools/tar.lua
--
Pierre Chapuis