[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Java implementation of Lua
- From: "Kristofer Karlsson" <kristofer.karlsson@...>
- Date: Thu, 17 Jan 2008 13:46:50 +0100
On Jan 17, 2008 1:26 PM, Fabien <email@example.com> wrote:
> On Jan 17, 2008 1:59 AM, Richard Warburton <firstname.lastname@example.org> wrote:
> > Kahlua, looks pretty cool, but I could really do with a Java
> implementation of a Lua Compiler as well - aka, have lua based config files
> for a simple Java app.
> You can load Metalua or Yueliang (lua compilers in lua) as precompiled Lua
> applications, both provide Lua->bytecode compilation implemented in Lua. I
> don't remember for Yueliang, but Metalua currently only produces bytecode in
> the default format (Lua 5.1, 32 bits little endian platforms, numbers
> represented as doubles). That's most likely what Kahlua expects but I
> haven't checked. If it doesn't suit you, adaptation isn't difficult.
> A more real issue is that kahlua seems to miss some APIs. From
> http://code.google.com/p/kahlua/wiki/lua_api, the missing APIs that might be
> an issue are:
> You'll probably need to reimplement these in Lua (Kahlua people would
> certainly be grateful), or hack the compiler to remove the dependencies. For
> Metalua, the heaviest part would be the lexer.
> About version choice: metalua 0.3 has the advantage of being in pure Lua,
> whereas the development version (http://repo.or.cz/w/metalua.git) is more
> stable and clean, but relies on some auxiliary C code. These dependencies
> can be removed however, especially if you're only interested in the pure Lua
> subset of the language (they're here to ensure watertightness across
> metalevels, something you don't care about).
> I'd be interested to see this work, so don't hesitate to ask for help!
> -- Fabien.
Since Kahlua is aimed for J2ME CLDC 1.1, it's indeed lacking quite a
lot, including most of the API functions, such as string, table,
debug, io, os, et.c.
It's also completely lacking of coroutines and compilation.
This is partly due to being tricky to implement (and some things are
even impossible on J2ME) and adding a lot of bloat (i.e. things that
in most cases would not be necessary for J2ME projects).
Apart from the debug library and coroutines, it shouldn't be too
tricky to implement these features yourself, if you are using J2SE,
and perhaps these could be included in kahlua as extra modules.
Development is quite slow at the moment, and I wouldn't at all mind
any extra contributions.
(By the way, Kahlua does indeed use bytecode from the default lua 5.1 compiler)