lua-users home
lua-l archive

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

On 18 January 2015 at 16:28, Richard Hundt <> wrote:
>> I am experimenting with the idea of adding optional static typing to
>> Lua. The project is very young (only started beginning of the year) so
>> the ideas are all in flux.
> Interesting project. Does it differ from the semantics of [1] as
> implemented in [2]? I get that it'll be implemented in C as part of
> the core, so it's obviously different in that way, but just wondering
> why "the ideas are all in flux".
> [1]
> [2]

Well the objectives are very different I think. I am looking to
improve efficiency of certain operations. So the static typing is for
that purpose. Therefore the features I intend to support will be a
subset of above. For example, as of now I have no intention to provide
syntactic support for classes or interfaces. Also no concept of union

There may be other differences. For instance the function calls are
currently dynamic with no static checking of return type - but I
insert instructions to coerce return types to comply with typed
variables, and it is a runtime error if the coercion fails.