lua-users home
lua-l archive

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


> I'm looking to learn javascript better too. What do you guys miss most from
> Lua when doing javascript programming?  Metatables? Consistency?

Didn't miss metatables much Object.defineProperty gives the most
important uses. Operator overloading is missing, but don't care that
much.

What I really miss:
* associative tables (using non string objects e.g. tables as keys)
* weak tables (does not stop the GC to delete the item)

As I recently work a lot serverside with "node.js" - which is IMHO an
absoletly great tool² - especially there it possibly could use
cooperative multitasking like Lua yields(). Recently due to my node.js
usage, I miss a developed shell environment for Javascript. Yes one
has it all within node.js, but when you develop a shell script its
non-blocking-callback-structure only hampers.

² While I always say "don't be ideological on programming languages -
the right tool for the right job. I quite have a strong dislike
against  PHP".

'this' is more confusing in Javascript. My code works, but I stilll
didn't really fully understand it and had to fix at one or two places
the this pointer. The string objects are quite akward, the difference
between the string object and actual the string value, e.g. the second
is usually interned on most JS implementations while the former must
not by specs.

This might be a controversial statement, but I recently also reflected
for me. Todays Javascript - Lua relationship reminds me a lot of the
1990ies C - Pascal relationship. The Pascal/Lua actually the more
sane, the nicer looking, better developed language with faster parser,
but restricted to a dedicated community. C/Javascript having the mass
power and big industries behind it.