|
Hi
Thanks for posting this, I would have liked to have tried Eclipse, but I am afraid to say your comment of Date: Tue, 15 Nov 2011 11:07:04 +0100 From: fleutot+lua@gmail.com To: lua-l@lists.lua.org Subject: Re: [ANN] Lua Development Tools available at Eclipse.org On Mon, Nov 14, 2011 at 10:24 PM, Stefan Reich <stefan.reich.maker.of.eye@googlemail.com> wrote: I'm still dreaming of a Lua IDE that is smart enough to see what types This is definitely on our roadmap. There are some real challenges, though: type inference is about propagating constraints across variables on which values they're allowed to contain. If your language and type system haven't been designed explicitly to facilitate this propagation (in practice, if your type system isn't based on Hindley & Milner's), you won't be able to guess much about variable, unless users put a lot of type annotations in their code. Moreover, the constraints system quickly becomes unmanageable when subsumption (implicit subtyping) involved. And we need some subtyping in Lua. For instance a type "anything" to type the 2nd arg of table.insert(): this "anything" is a supertype of every other, more precise type.
So we consider parsing an extended version of luadoc tags, to extract optional typing hints from them without breaking the language; this will allow users to specify the types handled by their APIs. Some things will most likely not be handled: for instance, "table.insert(table, [number, ] anything)" would require an extremely sophisticated type system to handle the optional 2nd arg (signature overloading is the 2nd nemesis of type inference systems, with subtyping). Once the type annotation system works properly, we'll be able to progressively add local inference rules, to guess parts of what the user hasn't annotated. We'll most likely do that in Lua/Metalua, so that proficient Lua developers will be able to tweak it without needing to know the intricacies of the Eclipse SDK.
|