Java 6 JNI wrapper importing newlisp

For the Compleat Fan
Locked
ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Java 6 JNI wrapper importing newlisp

Post by ralph.ronnquist »

It's almost xmas, so I thought I should point you at the Java wrapping for newlisp, using JNI that I just cleaned up. You'll need to compile it, probably after adapting the Makefile to your set up.

http://www.realthing.com.au/files/newli ... sp-jni.tgz

It's all nicely self-documenting code (hah!), and it provides what I thought of as the bare essentials for running newlisp under/in Java. I'm afraid the callback solution is different from the (emerging) "standard", mostly because I didn't feel like wading through all the type variants for boxing.

It is made on and for 32 bit linux (xubuntu 12.04) using newlisp 10.6.2 and openJDK 1.6.
It might port to other platforms.

enjoy.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Java 6 JNI wrapper importing newlisp

Post by Lutz »

Thanks Ralph, people have been asking for this. I have put a link on the http://www.newlisp.org/index.cgi?Code_Contributions page in the last group Foreign applications support and also added a README.txt with the text of your post.

ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Java 6 JNI wrapper importing newlisp

Post by ralph.ronnquist »

Great.

After the first upload, I've now also "polluted" the tgz with a simple Java GUI that offers a command loop a bit like a console -- as an example of use. An actual console is better of course, but I freshened up on some Java tidbits.

Thanks for your great work.

ralph.ronnquist
Posts: 228
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Java 6 JNI wrapper importing newlisp

Post by ralph.ronnquist »

I couldn't resist another minor revision: a slight change to the Java side to prohibit any attempt of re-entry into newlisp from a callback, and then the various changes required to let callbacks return strings (as otherwise the callbacks can't provide data to newlisp).
Dated 2014-11-10.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Java 6 JNI wrapper importing newlisp

Post by Lutz »

Thanks Ralph, updated again here: http://www.newlisp.org/index.cgi?Code_Contributions

Locked