lua-users home
lua-l archive

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

On 11/6/07, steve donovan <> wrote:
I'm coming to agree with Fabien that any meta-extension should be used
to add _new_ things to Lua, not confuse the issue with curly braces ;)

The proposal of the day: type annotations for function 'prototypes':
function F(String s, Number t)

The actual code that the compiler sees is this:

function F(s,t)

One of the tutorials in metalua manual proposes pretty much this. I've just realized that it somehow "disappeared" from the manual, but an older version is here:, and up-to-date sources are here:

Since global code manipulation is more practical in metalua, it allows more stuff: it also checks returned types, it checks every re-assignment to a typed variable, and the type grammar is quite rich.

I'm also occasionally working on static type inference for (some dialect of) Lua, but it's a much more more complex and theoretical issue. However, I'll finish metalua 0.4 before going seriously back to this, and anyway, it'll be more interesting for lambda-loving theoreticians than hackers.