[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua v4 vs. Lua v5
- From: Zed Shaw <zedshaw@...>
- Date: Wed, 18 Jun 2003 08:51:17 -0700
On Wed, Jun 18, 2003 at 09:20:44AM -0300, Luiz Henrique de Figueiredo wrote:
> Nice. Lua could use an assembler. I have the beginning of one somewhere
> and I think someone else had written one. But it was for Lua 4.0.
>
Actually, the assembler I'm using is Luas by luagnome@free.fr but I'm
not sure if the version I'm using is publicly available (it is for
Lua5). I've simply started documenting it's usage and the LuaVM for my
own knowledge.
> The problem with working with the Lua VM instructions directly is that
> the Lua VM is only a tool to implement Lua, not a product on its own.
> It can change radically from one release to another (as it did in Lua 5.0),
> even if the language changes little or nothing.
>
Noted. The advantage of having the source though is that I can "borrow"
it. :-)
> It's supposed to be pretty simple: everything is now ordinary Lua stuff.
> Perhaps we need an emulation of the tag scheme on top of metatables. If
> nothing else, to show how things work now.
>
Emulation of the tags would help for supporting old code, but I'd rather
use the new mechanism. I just can't find where the new mechanism is
documented.
> >4. Many of the functions in the standard library have changed so that
> >they are in namespaces (like io.open and such). This is good for new
> >stuff, but it royally screws things up for existing code.
>
> Try etc/compat.lua.
>
Thanks! Wow, that would have been nice to know.
> >6. There's apparently a foreign function call interface built in, but
> >I can't find docs on this.
>
> What do you mean?
>
I could have sworn that something similar to Lua-ffi (found on
http://lua-users.org/wiki/LuaAddonsArchive) would be built into Lua5.
Maybe I'm crazy?
> The code generator does some optimizations, specially in conditionals,
> but it does not remove dead code, for instance. Here is an example:
I'll see if I can drag up my notes on this and reproduce some examples.
Other people have asked for more detail, so I'll try to back it up with
evidence.
Thanks for the info.
Zed