lua-users home
lua-l archive

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


On Wed, Jun 14, 2006 at 08:34:26AM +0300, askok@dnainternet.net wrote:
> >>1. It is very convenient to precompile scripts once and 
> >>load them on
> >>  multiple platforms. The solution is a universal 
> >>bytecode loader,
> >>  not a cross-compiler. However, such a loader is bound 
> >>to be complex
> >>  and possibly hard to test and maintain, if it caters 
> >>for many platforms
> >>  (but that's the whole point).
> 
> 1. Hmm.. with the existance of both cross compiler, and 
> universal loader, it would be easy to make a regression 
> test suite that finds any bugs introduced automatically. 
> About one days work?

I think you missed the point. Writing is easy, running the test suite on
dozens of platforms you don't have access to is not so easy. Lua in
particular is used on machines other than the typical sparc/ppc/intel.

Also, The point of loading pre-compiled lua code is that the lua core
can be stripped to its simplest, and to save a little bit of time during
load.

If you don't want smallest and fastest, and instead want most portable
and most flexible, lua source is already that.

So, the two extremes are supported, and in between there is a whole
range, from simply byte-swapping on similar machines, to more
complicated manipulations. People with compelling reasons to be
somewhere between these two extremes will likely want to be in
a precise place, and might not want all the baggage of a universal
loader, they might just want byte swapping, for example, or just
FP representation independence. They have lots of hooks in the lua
core to enable building exactly what they want.

Also, its not clear to me that a universal loader would be smaller or
faster than the lua parser, and if it wasn't, I don't see what its point
would be for anybody. Maybe just that the byte-code would be smaller
than source?

Cheers,
Sam