After I get the object file with
Code: Select all
luajit -b some_library.lua some_library.o
Are there any good guides on the workflow with luajit that anyone can recommend? Stuff seems to be scattered all around.
Code: Select all
luajit -b some_library.lua some_library.o
Code: Select all
luajit -b A/some.lua B/some.lua
Code: Select all
require("some")
Code: Select all
love A
Code: Select all
love B
from http://luajit.org/running.htmlThe output file type is auto-detected from the extension of the output file name:
c — C source file, exported bytecode data.
h — C header file, static bytecode data.
obj or o — Object file, exported bytecode data (OS- and architecture-specific).
raw or any other extension — Raw bytecode file (portable).
Named without .lua, OK.raw or any other extension — Raw bytecode file (portable).
.o is basically a "partial executable" (OS dependent, native) that you can link to when compiling another file to include the lua module so it can be require'd if I understand the docs correctly.padicao2010 wrote:Not compile to a lua file, but compile to Raw bytecode file and can be used as a lua file.
Named without .lua, OK.raw or any other extension — Raw bytecode file (portable).
.c : A c source file, can be open with text editor. The bytecode is shown as a char *. Maybe used in C.
.h : Almost the same as .c, but used as a c header file.
.o, .obj : No clue. I can't run it with luajit.
The advantages of using bytecode compare to source file:
1. no string parse
2. protect source code to a certain extent
Users browsing this forum: Google [Bot] and 8 guests