bytecode inspector library for Lua 5.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bytecode inspector library for Lua 5.1

Luiz Henrique de Figueiredo
I've written a library that allows you to look inside Lua functions from Lua:
        http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lbci.tar.gz

If there is any interest, I can add more functionality, such as setting
other kinds of values (as an example, it does allow you to set the
values of constants. That's just for fun; I'm not sure it's really
useful -- it is certainly not polite...)

With this library, it is now possible to write a complete luac in Lua,
because the inspector allows you to implement the listing that is
now output by "luac -l".

If you have any other bright ideas on how to use this library seriously,
please let me know.

Enjoy.
--lhf
Reply | Threaded
Open this post in threaded view
|

Re: bytecode inspector library for Lua 5.1

Eduardo Ochs
Hi Lhf!

> I've written a library that allows you to look inside Lua functions from Lua:
>         http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lbci.tar.gz

Excellent! That fills an important gap in the language... thanks!
Let me guess: the next step is a interface in Lua for the functions in
lparse.c, am I right? :-)

  Cheers!!!
  Edrx
    [hidden email]
    http://angg.twu.net/
Reply | Threaded
Open this post in threaded view
|

Re: bytecode inspector library for Lua 5.1

Luiz Henrique de Figueiredo
> Excellent! That fills an important gap in the language... thanks!

I trust you mean a gap in the tools not in the language...

> Let me guess: the next step is a interface in Lua for the functions in
> lparse.c, am I right? :-)

I have no plans for this, sorry. I do have plans for the token filter I
talked about at the Workshop, which may be useful for some of the tasks
you'd like to have access to the parser... Not much free time, though.
(The bytecode inspector was just something I had already and needed very
little polishing before it could be published. Not so with the token
filters yet.)

And I still have to release a new version of the Posix library...

Thanks for the encouragement.
--lhf