lua-users home
lua-l archive

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


On Thu, Oct 2, 2008 at 3:06 PM, Chetan Singh <chetan_dhillon@yahoo.com> wrote:
> Hi fabio, Thanks fo pointing me to MiniJoe. I will take a look. Yes I was looking for JavaScript -> Lua assuming that that Lua VM would be faster than any other JavaScript engine that is avaialbe for J2ME devices.

There is also something called mojax that embeds a JavaScript
interpreter, too (http://mfwiki.mfoundry.com/display/mojax/Main+Page).

> Regarding your comment on running JacaScript in Kahlua, once it is compiled into Lua (off-device lets say on a server), it would run as fast as Lua code on J2ME. Right?

That was my point, it wouldn't. :-) JavaScript is not Lua, so you need
extra code around each operation to implement the correct semantics.
This code has to be in Lua (either source or bytecode), so it's bound
to be slower than a dedicated JavaScript interpreter written in the
native language of the platform (J2ME, in this case). Assuming both
interpreters have similar architecture, of course; compiling
JavaScript to Lua bytecode and running on Kahlua may be faster than an
interpreting JavaScript from source, for example.

> I am not very much familar with either language so don;t know how much work is involved in translating JS to Lua. That is why I am looking for a tool/complier.

It's quite a bit of work, but relatively straightforward compiler
work. But it really is a job for someone who know every in and out of
JavaScript.

> thanks much for you help
> CHetan
>

--
Fabio Mascarenhas