lua-users home
lua-l archive

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

On Mon, Nov 14, 2011 at 11:24 PM, Stefan Reich
<> wrote:
> I'm still dreaming of a Lua IDE that is smart enough to see what types
> my variables have and what methods the objects support. If the code is
> not extremely tricky - it should actually be possible.

I'm excited about this official Eclipse project. Jason Santos really
has not had any time for LuaEclipse, unfortunately.

Fabien has provided some patches to ldoc so that one can document
parameters with explicit types. (currently I'm toying with a '@tparam
string name' notation).  He does a lot of powerful static analysis
with Metalua, but full type inference is probably impossible without
run-time profiling.

Google Dart has the idea of 'optional type annotations'  built-in;
establishing a standard way to specify explicit types in the
documentation is another less intrusive way forward.  That can really
help an IDE provide a richer experience.

BTW, how these types are specified gets interesting. Built-in and
known object classes are straightforward (and the tool can hyperlink
these), but we need a convention for aggregate types:

{string,...}  -- an array of strings
{string,number}  -- a tuple
{X=number,Y=number,Z=number}  -- a 'record'
{[string]=Foo,...}  -- a 'map' with string keys and Foo values

steve d.