lua-users home
lua-l archive

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

Chris wrote:
> I find this subject exciting because Lua and Javascript feel like
> twins to me.  The syntax is different but the basic idea is very
> similar.  Except the base of Javascript developers is huge.  For a
> long time I have said that it would be incredibly hard or impossible
> to make a lean fast Javascript VM due to all the language cruft (I
> define "fast" as faster than Lua).  If someone manages to pull it off
> I will be impressed.

I've actually thought that it would be very interesting to build a
Javascript interpreter *on Lua* --- use pure Lua code to translate the
Javascript into Lua, compile, and run. The two languages are similar
enough semantically that the mapping is probably quite easy.

I've even had a quick go myself, but Javascript turns out to be a pig to
parse with traditional systems like Yacc --- semicolon insertion
algorithms, yuck. I'm not even sure it can be simply parsed using
recursive descent parsers. Either way, not fun.

If we can come up with a JS implementation based on Lua that's got
competitive performance and is also smaller than the alternatives, it
would probably prove something-or-other...


Just out of interest, TraceMonkey (thanks for the pointer) gets a score
of 6.6 in my benchmark which is dismal --- but as the score goes *up* to
17 if I turn the JIT *off*, I suspect I'm simply not driving it properly.

┌─── ───── ─────
│ "All power corrupts, but we need electricity." --- Diana Wynne Jones,
│ _Archer's Goon_

Attachment: signature.asc
Description: OpenPGP digital signature