lua-users home
lua-l archive

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


On Wed, Sep 3, 2008 at 5:02 PM, David Given <dg@cowlark.com> wrote:
> 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.

Yes, I had the same idea a while ago.  My idea was to use LPeg to
parse straight to Lua bytecode.  LPeg makes creating parsers so easy
that I can't see using anything else.  I was thinking that by
compiling directly to bytecode it would be easy to add new opcodes to
the Lua VM if there were any Javascript specific issues that needed a
performance boost.

I got discouraged when reading the ECMAScript specification because
there is just so much stuff in it and it's really quite ugly.  :)

CR