lua-users home
lua-l archive

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


On 20 July 2010 09:18, Alexander Gladysh <agladysh@gmail.com> wrote:
> On Tue, Jul 20, 2010 at 11:19, Kristofer Karlsson
> <kristofer.karlsson@gmail.com> wrote:
>> On Tue, Jul 20, 2010 at 8:47 AM, Alexander Gladysh <agladysh@gmail.com>
>> wrote:
>>> <...> I'm interested in the
>>> honest compiler + VM implementation.<...>
>
>> I wonder if you could use GWT in some way to compile one of the Java
>> implementations of Lua into Javascript. That would be interesting to try at
>> least.
>
> Great idea!
>

A friend took this route (I think he used one of the other Java
implementations though). It works, but I got annoyed by the size and
complexity of the code produced by GWT - and also the compilation step
needed, and the dependency of all of it on Java.

So I started on my own venture to write a VM in Javascript by hand:
http://code.matthewwild.co.uk/ljs/

Although I haven't had a chance to work on it the past month or so,
it's still under quite heavy development. Much is implemented, except
some of the trivial opcodes, and my current focus is metatables, and
then implementing some of the standard library.

It's only a VM, which means that scripts either need to be compiled
offline, or someone needs to write a compiler in Lua or Javascript. In
fact (although I haven't looked at it yet) the former has already been
done as far as I know: http://yueliang.luaforge.net/ - so if one
wanted to compile scripts live in the browser, Yueliang could be
compiled offline and run in the VM in the browser to compile them.

I find all of this much fun :)

Matthew