lua-users home
lua-l archive

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


> On Nov 3, 2015, at 8:43 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 
> 2015-11-04 3:53 GMT+02:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>>> Isn't Lua bytecode platform-agnostic?
>> 
>> Not at all. It is very platform dependent.
> 
> At the top of a binary chunk appears information about the platform,
> e.g. endianness, sizes of various integer types and so on. Would it
> be possible to write a cross-recompiler exploiting Lua 5.3's string
> pack/unpack that would convert bytecode for the same Lua version
> from one architecture to another?
> 

+1. We have done that in-house, but I dislike creating something that uses knowledge of undocumented internals and that we will certainly have to update as new versions of Lua are released.

—Tim