Java 6 JNI wrapper importing newlisp

Started by rrq, November 07, 2014, 01:41:23 AM

Previous topic - Next topic

rrq

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">//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.

Lutz

#1
Thanks Ralph, people have been asking for this. I have put a link on the http://www.newlisp.org/index.cgi?Code_Contributions">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.

rrq

#2
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.

rrq

#3
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

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