lua-users home
lua-l archive

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


Hi, I wanted to share a Lua-related experiment I've written.

https://github.com/mherkender/lua2js-experiment

Basically, it converts a single Lua script into a _javascript_ equivalent.

It works by parsing normal Lua code and wrapping pretty much every Lua operation around a function to maintain compatibility, and using _javascript_ constructs wherever possible, the result being a pretty fast _javascript_ version of a Lua script. It seems like there's only a handful of Lua features that seem to be completely incompatible with this style of translation.

Still, this is better used as a proof-of-concept rather than a legitimate tool. I didn't plan much in advance so it's only clear to me now that it should've been written in _javascript_ instead of Python, which makes this something of a dead end. Since it works for what I've been using it for, and I'm having trouble finding an equivalent to ply for _javascript_, I decided to put it up online for now in case anyone would like to check it out.

-Max