[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Integrating Lua with Java
- From: "Frederico Santos" <fsantos@...>
- Date: Mon, 21 Oct 2002 00:10:21 +0100
I'll download he compatibility API and give luajava another try.
I would be very interested in any bugfixes/workarounds you migth have
I was going to use Lua 4 anyway (convicing people to use an unknown language
is hard enough without telling them it's an alpha version)
[mailto:email@example.com]On Behalf Of Christian Vogler
Sent: domingo, 20 de Outubro de 2002 23:36
To: Multiple recipients of list
Subject: Re: Integrating Lua with Java
On Sun, Oct 20, 2002 at 12:09:20PM +0100, Frederico Santos wrote:
> I'm looking for a way to use Lua to extend a Java application.
> I downloaded luajava but it is for Lua 3.1 and the Lua API has changed a
> since then.
> I could try to develop something myself but if someone has already done
> something like this and was willing to share it that would be appreciated
as it happens, I am currently mucking with luajava in conjunction with
Lua 4. It works -- *almost* -- fine with the lua3 compatibility API
that you can download from the LuaWiki at http://www.lua-users.org
However, there are two caveats that I have found so far:
1. For some reason, the "gc" tag method is not called properly if an
object is collected as a result of an unlocked lua_ref. This really
screws up the handling of Java objects from Lua. I suspect a bug in
Lua 4 itself, but have not gotten around to verifying that yet.
2. If you use the reflection or RMI API, proxy objects apparently can
share the same reference ID, but be of a different type. This upsets
the proxy mechanism in luajava.
I have fixes/workarounds for both of these problems, so if there is
any interest, let me know, and I can make them available. This is all
still very bleeding-edge, since I fixed these problems just today.
I don't know if a similar approach would work with Lua 5.