lua-users home
lua-l archive

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


On Tue, Jul 10, 2012 at 8:05 AM, Paul K <paulclinger@yahoo.com> wrote:
> In terms of the actual implementation, it may be interesting to look
> at how to implement this as an optional component using static type
> inference and hints (possibly in comments to preserve compatibility).

There's always Roy with Lua as the compilation target ...

I agree with Paul, it would be very interesting to see a dialect of
Lua which can be statically verified. There will need to be
annotations, of course.

Some inspiration can come from the other great language from Brazil, Boo [1]:

def sqr(x as double):
    return x*x

Return type can be safely inferred, but arguments need type
annotations.  To make this generic, you need to be able to specify the
property  'behaves like a number' (either 'number' or implements the
necessary metatmethods).  Finding a sufficiently rich type notation to
capture Lua semantics would be the intellectually interesting part of
this.

steve d.

[1] an entertaining semi-Python that statically compiles to .NET/Mono assemblies