[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: luac - output into ONE bytecode file?
- From: Marius Kjeldahl <marius@...>
- Date: Tue, 17 Apr 2001 00:05:43 +0200
First of all, congrats to the designers and implementors of lua. I've
been looking for a language where I can write portable code for various
embedded platforms, and so far lua is by far the best language I have
found for this. Compared to what is being offered on most
handhelds/cellulars, lua looks like a "real" programming language, and
the table abstraction looks usable for 90% of what I need (and the
prerelease of the lua book showed me how to implement a simple queue in
a few lines of lua). With some luck, lua _might_ actually be able to get
the job done where Java has failed so far (handhelds).
Anyway, I'm targeting handhelds for one of my projects (removing the
parser, executing raw bytecodes), and having to use files is of course
difficult to do "cross-platform" on handhelds. While I stuff all my data
inside strings, I have not found an elegant way to output single
bytecode files. I'm using dofile("module1"), dofile("module2") etc in my
main file, and currently these are being compiled into their own
bytecode files which the main program will read and execute when run.
To avoid having multiple bytecode files (and thereby a distribution
problem) I guess I can stuff all the source into one source file
(replacing the dofile("module") stuff with the actual source for each
module) and compile this one file, but ideally there should be an easier
way to do this. Having an option to feed luac for instance that says
"stuff it ALL into one file" would help a lot.
Before I possibly embark on this project myself, I though I would ask in
case there is an easy way to do this today, or somebody else has already