[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Integrating Lua with Java
- From: Christian Vogler <cvogler@...>
- Date: Sun, 20 Oct 2002 18:35:48 -0400
Hi,
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 lot
> 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.
- Christian