newLISP Fan Club

Forum => Anything else we might add? => Topic started by: rrq on November 07, 2014, 01:41:23 AM

Title: Java 6 JNI wrapper importing newlisp
Post by: rrq on November 07, 2014, 01:41:23 AM
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/newlisp/newlisp-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.
Title: Re: Java 6 JNI wrapper importing newlisp
Post by: Lutz on November 08, 2014, 07:14:13 AM
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.
Title: Re: Java 6 JNI wrapper importing newlisp
Post by: rrq on November 08, 2014, 02:42:07 PM
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.
Title: Re: Java 6 JNI wrapper importing newlisp
Post by: rrq on November 10, 2014, 09:35:19 PM
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.
Title: Re: Java 6 JNI wrapper importing newlisp
Post by: Lutz on November 11, 2014, 07:21:25 AM
Thanks Ralph, updated again here: http://www.newlisp.org/index.cgi?Code_Contributions