[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luac does what precisely?
- From: Russell Haley <russ.haley@...>
- Date: Wed, 05 Oct 2016 08:41:15 -0700
Ha! Brilliant sir!
Russ
Sent from my BlackBerry 10 smartphone on the Virgin Mobile network.
Original Message
From: Nagaev Boris
Sent: Wednesday, October 5, 2016 2:53 AM
To: Lua mailing list
Reply To: Lua mailing list
Subject: Re: luac does what precisely?
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