From ecab831ebfca1b08e93bf8dd3c1a7e3b43cf5c97 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 14 Jun 2011 01:58:19 +0200 Subject: [PATCH] Add more docs for bytecode load/save feature. --- doc/extensions.html | 17 +++++++++++++++++ doc/running.html | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/doc/extensions.html b/doc/extensions.html index 7d12299c..b0e11644 100644 --- a/doc/extensions.html +++ b/doc/extensions.html @@ -166,6 +166,23 @@ positive infinity results in "inf" and negative infinity results in "-inf".

+

string.dump(f [,strip]) generates portable bytecode

+

+An extra argument has been added to string.dump(). If set to +true, 'stripped' bytecode without debug information is +generated. This speeds up later bytecode loading and reduces memory +usage. See also the +-b command line option. +

+

+The generated bytecode is portable and can be loaded on any architecture +that LuaJIT supports, independent of word size or endianess. However the +bytecode compatibility versions must match. Bytecode stays compatible +for dot releases (x.y.0 → x.y.1), but may change with major or +minor releases (2.0 → 2.1) or between any beta release. Foreign +bytecode (e.g. from Lua 5.1) is incompatible and cannot be loaded. +

+

Enhanced PRNG for math.random()

LuaJIT uses a Tausworthe PRNG with period 2^223 to implement diff --git a/doc/running.html b/doc/running.html index ecf6bba4..118dab7b 100644 --- a/doc/running.html +++ b/doc/running.html @@ -133,6 +133,13 @@ luajit -bl test.lua # List to stdout luajit -bl test.lua test.txt # List to test.txt luajit -ble "print('hello world') end" # List cmdline script +

+Note: A file in bytecode format is auto-detected and can be loaded like +any Lua source file. E.g. directly from the command line or with +loadfile(), dofile() etc. See also +string.dump() for information +on bytecode portability and compatibility. +

-j cmd[=arg[,arg...]]