lua-users home
lua-l archive

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

On Oct 8, 2015, at 12:20 PM, Tim Perkins <> wrote:

On Tue, Oct 6, 2015 at 10:15 AM Soni L. <> wrote:
As of Lua 5.3 you can add a #! line to a precompiled bytecode file and
it'll parse and run.

Seeing as how insane that is, can we get to embed bytecode in source
code? As in:

The byte code is an implementation detail, and possibly not compatible between versions. So no, you wouldn't want to write it as part of the source code anyway. It would be unmaintainable.

In fact I think the opposite is true. In the case where Lua is embedded (presumably as part of a compile+build cycle), embedding bytecode side-by-side with it is the one case where you CAN rely on the bytecode being in-sync with the Lua VM flavor. A clean build process (we do this ourselves) would re-build the bytecode using the same Lua VM (version, options and host platform) as the one being embedded (and yes, this can make cross-platform builds more complex).