lua-users home
lua-l archive

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

2009/9/28 Mike Zraly <>:
> On Mon, Sep 28, 2009 at 7:47 AM, <>
> wrote:
>> Date: Sun, 27 Sep 2009 13:45:26 -0400
>> From: Norman Ramsey <>
>> Subject: Re: Lua for large apps (was: Lua for GUI toolkit wrapping?)
>> To: Lua list <>
>> Message-ID: <>
>>  > Static typing and compile-time checks (including warnings to the max)
>> are
>>  > indispensable. The alternative for dynamically typed languages are
>>  > tests.
>> Actually another quite respectable alternative is program analysis.
>> I ran into Kostis Sagonas at the airport and it seems he has had some
>> very good results using something he calls 'success types' for Erlang
>> programs.  I would love to see similar technology applied to Lua.
>> A paper is at
>> Norman
> Actually, it might be an interesting idea to provide an interface to set
> (some) and get (all)
> information about a function object within the lua language itself.  One
> might use this to
> expose annotations like type assertions, comment strings, and perhaps even
> more low-level
> information like the function's name and source location and whether or not
> the function calls
> yield directly.

You can already associate any kind of information to a function by
using it as a weak key in a Lua table. However you need access to the
debug library to access built-in informations, or simply to allow a
function to get a reference to itself to use as a key in the weak
tables I mentioned.

> Couple with access to the calling function object, and transitively to the
> entire call stack,
> one might be able to do some interesting things at runtime.

Still with debug.getinfo you can get access to the whole stack.