lua-users home
lua-l archive

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


I dream of one day being able to do static type inference
on my Lua programs, thereby catching innumerable silly errors.
I worked on this problem one summer with Inna Zakharevich, and
it's not clear that we will ever get anywhere, but I would
dearly love it if Lua 5.2 contained some syntactic hooks
that could be used to write down type definitions and
to write down the types of some variables.  Since we have
no idea what we want, I'd simply ask for a syntax

  typedecl string-literal

which the current compiler would ignore.

I realize the same effect could be achieved at present by simple

  function typedecl() end

but (a) that would have a small run-time cost and (b) I'm really
asking the Lua team to pick a keyword and reserve it for future use.



Norman