lua-users home
lua-l archive

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


Flyer:

On Sun, 19 Jun 2022 at 14:21, Flyer31 Test <flyer31@googlemail.com> wrote:
> It will run in the target directly from ASCII source code, or from a
> so called "Lua bytecode".

Lua always run from bytecode. It compiles source code on demand (
require and the lua and luac executables do it, as it includes the
"compiler" in the load functions ). AAMOF the 2nd sentence of the 2nd
paragraph of the manual reads "Lua is dynamically typed, runs by
interpreting bytecode with a register-based virtual machine, and has
automatic memory management with a generational garbage collection,
making it ideal for configuration, scripting, and rapid prototyping."

The thing is load*() can use bytecode chunks directly ( and require
uses load indirectly ). So you can run a lua program from either the
"ASCII" ( text may be better there ) source or the saved bytecode file
( and as native programs need a loader, be it called ld or included in
the OS , lua bytecode needs it too, AFAIK you cannot just put the
bytecode in memory and "jump" to it ).

Francisco Olarte.