lua-users home
lua-l archive

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

> The only thing I miss is a flag to lua(c) to perform a bit of lexical
> analysis, mainly to detect mistyped variable names in error handling
> code (in non error handling code you immediately see the problem, since
> you are going to test your code, but generating all errors is hard).

This is what its about. Most modern scripting language perform very
poorly in the area of static analysis. I would like to see a
compromise between static and dynamic typing, like being able to
determine "contracts" for variables like "+ operator applicable", "has
property X", etc. This things can be done at runtime with contract
checking at function entry, but it cannot be done statically. Neither
with Lua, Javascript, Perl, Python, Ruby etc. Add to this a weakness
of compiletime optimizations. The GWTs motto is "don't do at runtime
what you can do at compile time", and unless you base on Java what
they did, it just isn't possible to take this motto to hearth with any
contemporary Script languages.

Personally I liked it when I changed in a hugh project a parameter of
a function and the compiler said me, you got 85 places that are now
troublesome, while with scriptlanguages I have to search very
carefully by hand and have to debug all this places.

Anyway, this does not explain any priorities of usuage in the
scripting languages, since all of them suffer from this weakness in
the same way. I can fully understand Google who tries with Go and Dart
to bring back some of this lost possibilities we had in C++ and Java
but in a modern comfortable language.