lua-users home
lua-l archive

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


On Tue, Jul 20, 2010 at 13:16, Matthew Wild <mwild1@gmail.com> wrote:
> 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 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.

Well, if I get it right, dependency on Java kicks in only if you want
to change the interpreter itself. For more mundane tasks you just have
to work with JSNI from JS-side...

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

Cool!

> 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.

Note that there are implementations of Lua standard library in Lua.
You may use one to speedup development.

> 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.

>From what I hear, Yueliang is often used to bootstrap alternative Lua
implementations.

> I find all of this much fun :)

Sounds like it! I wish I had time to do some real alternative Lua
implementation myself (lua-alchemy being only port of Lua C code). :-)

Anyway, please keep us informed on ljs project progress. I'm looking
forward to try it with my Lua code :-)

Alexander.