lua-users home
lua-l archive

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


On Mon, May 24, 2010 at 4:16 AM, Patrick
<spell_gooder_now@spellingbeewinnars.org> wrote:
> code like this seems problematic to me in C:
> SomeTable= {Lua = "fun", a = 1, b = 2, c = 1 + 2}

A C-like language could do this with static type inference and
'anonymous' structs.

But, as said, if LuaJIT is an option then speed isn't really the
compelling reason for compilation it used to be.

The other argument for statically typed compiled code is
'discoverability', being able to reason about code automatically and
detect silly errors at compile time.  But then you need lots of static
type annotations, unless you have a _really_ smart environment which
can use type inference.

For instance, in Boo:

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

The compiler can deduce the return value to be 'double' but it really
doesn't have a hope to deduce the type of the argument, unless there
is some implicit template magic going.

steve d.