lua-users home
lua-l archive

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


<snip> Lots of interesting stuff deleted.

On 7-Mar-07, at 8:24 PM, David Given wrote:

As an off-the-top-of-my-head example... Javascript and Lua are very similar, right? But Lua's far smaller and faster. Could you make a fast Javascript interpreter by translating it into Lua? This makes you suddenly very desirable
in both the Javascript and Actionscript worlds, and you can use that to
leverage Lua (since everyone hates Javascript, and your engine gives you Lua for free, and raw Lua will be faster than even your high-speed Javascript...). Suddenly, your enemies will be fighting *for* you, rather than against you.

Maybe. One of the things that makes Lua faster is its semantics,
though. You could implement Javascript semantics in Lua (such
as table-like access to locals, or closure frames that include
all variables, not just lexically-named ones) but I suspect
the result would be even slower than Javascript.

Still, it's possible: maybe you can make a "sometimes fast"
Javascript interpreter which doesn't penalize you for slow
features, if it could somehow intuit when you weren't using
them...