Friday, January 2, 2009

Lua: A Better JavaScript?

It seems I've been in "investigate every buzzword language on the planet" mood recently. Now I've done a quick glance at Lua. Seems to be a LOT like JavaScript, though different in many subtle ways. Some ways it's better is its sweet implementation (tiny size, tail recursion, "stackless", high performance), but it also seems to have easier namespacing and goodies like operator overloading. If only all the browsers would just integrate it, ... Or if they are as close as they seem, maybe a Lua to JS compiler would be straightforward? In any case, again, it doesn't seem a dramatically different language.

1 comment:

  1. By the way, a quick dictionary for convenience:

    * Lua says "table"; JS says "object".
    * Lua says "metatable"; JS says "prototype".
    * Lua says "self"; JS says "this".
    * Lua says "a:b()"; JS says "a.b()".
    * Lua says "function a.b.c() ... end"; JS says "a.b.c = function() {...}".