[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua for tiny embedded system (was: Sanity check)
- From: Mike Pall <mikelu-0507@...>
- Date: Sun, 17 Jul 2005 23:10:10 +0200
Hi,
Vijay Aswadhati wrote:
> Andre had a great idea of considering the generation of native code
> instead of attempting to squeeze in the interpreter - a non-trivial
> task by any measure.
Granted, it's quite feasible to translate Lua bytecode to native
code (ummm ... more on this later this month). But it's not helpful
in your case, because you are not aiming for speed. You really only
want to save space.
You could remove the bytecode interpreter core loop (which weighs
in at 3.8 K), but you still need the glue code and everything else.
E.g. OP_SETTABLE is really a call to luaV_settable() which in turn
drags in the whole hash table stuff and much more. And hardcoding the
hash lookup for (say) strings is good for speed, but won't save
you any space at all. You really need the generic case as a fallback
(full type inference is difficult in a dynamic language).
> Picking a different platform pretty much implies that LRT's change
> its charter.
Sure, redefine the problem until you arrive at a solution.
This is a completely legit approach (esp. since you defined
the problem yourself).
> All of the above material is good information to have on the Wiki.
> So that I can assemble a similar tabulation as yours and share it
> with the group, could you please tell me the file names that
> contributed to each line item.
Ok, see below. The basenames are before the colon on each line.
Use the (object-format-dependent) 'size' utility from gnu binutils
to get the true code size from the corresponding '.o' files
(the 'dec' column, divided by 1024).
* Essential Lua core:
lvm: bytecode interpreter plus glue code
ldo lstate: stacks, frames, states (coroutine)
lfunc ltm lobject: functions, metamethods, misc. object support
lstring: shared immutable strings
ltable: hash tables
lgc lmem: GC, memory management
lapi: C API glue
ldebug lopcodes: C debug API glue, bytecode verifier, opcode names
lundump lzio: bytecode loader, bytestream support (zio)
* Compiler:
llex lparser lcode ldump: lexer, parser, code generation, bytecode dumper
* Lua core libraries:
lauxlib linit: lauxlib, linit
lbaselib: base library
lmathlib: math library
liolib: IO library
loslib: OS library
lstrlib: string library (including regex)
ltablib: table library
loadlib: package/module library (loadlib)
ldblib: debug library
* Standalone applications:
lua: command line interface (lua)
luac print: command line compiler (luac)
Bye,
Mike