Is LuaJava a must for this? Or can I embed Lua into Java without it?
How can I embed Lua in Java?
I'm guessing that you'd prefer a pure-Java implementation of Lua (instead of LuaJava which uses native bits)? Or are you just looking for any alternative implementation? –
Before
A pure java implementation of LUA simply does not exist, and probably will never exist. It is a "C" project, and porting all that C to code java would be a huge undertaking, and I doubt the LUA authors see much benefit to that. –
Recondite
@Recondite actually most of the work is already done, about 10 years ago I ported the entire Lua 5.1.4 package to C# (and yes, it was a huge undertaking). A port from that to Java would, I imagine, be considerably easier. –
Anthrax
LuaJ is easy to embed in Java. I did have to change a few lines of their source to get it to work how I expected (it didn't require the IO library automatically).
I'm having a similar problem using Kahlua from IntelliJ. I am brand new to Lua and getting tripped up over an error, "attempted index of non-table" whenever I call "io.read()". I tried to require "io" but that doesn't work. Help? –
Numismatics
Does anyone compare the implementation of luaj and luajava? –
Fluorosis
Kahlua now located on github, but not updated since 2013. Mochalua appears to have never been migrated off of Google Code, and is now archived; there are 4 versions on github, but none have been touched since 2015 and all just have the original 7 commits from the Google Code version from 2008-12-08. –
Tarantula
There is http://www.keplerproject.org/luajava/manual.html, but essentially lua is more suitable for integration with C. There are a bunch of other scripting languages with good java integration around though. Consider groovy, jruby or jython for starters.
in this case I am stuck with lua otherwise I would go with jython being a python fan boy –
Organism
To embed Jython is trivial, if that helps :P –
Deflected
Lua is a C library, you can embed it in Java but you'll have to interface the java virtual machine and Lua with some C code.
The LuaJava authors have already done that work - you're better off using that than writing your own.
© 2022 - 2024 — McMap. All rights reserved.