PyLucene without GCJ released
September 24th, 2007 at 11:57 am (7 months, 3 weeks ago) by Andi Vajda under Chandler Desktop Development, PyLuceneWith the GPL’ing of Java and Lucene’s pending move to using Java 1.5,
I decided to give PyLucene without gcj a try.
One of the best features of gcj is its C++ interface. Its ability to expose Java classes as C++ makes it very easy to invoke Java from C++. This feature is unique and sorely missed when moving off of gcj.
The Java Native Invocation Interface makes it possible to invoke Java
classes from C++ but is rather crufty and verbose to use by hand.
I started by implementing a C++ code generator that generates C++ wrapper
classes that hide all the JNI invocation cruft from the C++ programmer.
These wrapper classes in effect offer a very similar C++ interface to what
is offered by gcj’s CNI.
While I was implementing this it became apparent that the C++ wrappers for
giving access to Java classes from Python could be generated at the same
time.
Eventually, I ended up writing a new C++ code generator, that I called jcc.
JCC is able to generate C++ wrappers for accessing Java classes from Python
and C++.
This code generator is now used to generate a new flavor of PyLucene, called
PyLucene with JCC. JCC has no built-in knowledge about Lucene and could be
used to generate wrappers for any Java library that uses similar coding
styles and techniques than the ones used by the Java Lucene developers.
JCC could in fact become a project of its own. At the moment, it is part of the
PyLucene with JCC source tree.
The PyLucene source tree got split into two forks, a gcj fork containing the
original PyLucene and a new jcc fork containing the new sources, consisting
mainly of unit tests, samples and the sources to jcc since all of
PyLucene, except for extension code, is now generated by jcc.
For more details, please refer to the new README files:

