[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luac does what precisely?
- From: Nagaev Boris <bnagaev@...>
- Date: Wed, 5 Oct 2016 10:52:41 +0100
On Wed, Oct 5, 2016 at 9:51 AM, Meer, Hans van der <H.vanderMeer@uva.nl> wrote:
> A question about luac. Do I understand correctly that luac precompiles the given lua file only and does not include the modules called in by a require statement inside? More precisely, that it does not generate something functioning as a 'fully linked standalone binary'?
> And if I am right in this, is it possible to generate such a 'standalone binary', allowing one to call one file with all necessary precompiled code inside?
>
> Hans van der Meer
>
Steps to produce a runnable static binary from Lua file:
1. Combine all Lua dependencies into one runnable Lua file:
https://github.com/starius/single-dir.lua
2. Convert it into C char string
https://github.com/starius/config/blob/master/.bin/file2cstring.lua
3. Write main() function which runs that C char string with Lua and
compile the file with C compiler linking with Lua library.
--
Best regards,
Boris Nagaev