[BioLib-dev] GSoC: Mapping JAVA libraries to Perl/Ruby/Python using Biolib+SWIG+JNI

Luiz Irber luiz.irber at gmail.com
Wed Mar 31 21:25:34 UTC 2010


On Wed, Mar 31, 2010 at 3:13 PM, Pjotr Prins <pjotr.public14 at thebird.nl> wrote:
> Cool. Is there a language you would prefer to map to - Perl, Python,
> Ruby? A clear choice will allow us to get the relevant Bio* project
> interested in some functionality from JAVA.
I would go for Python, because it's the one I know better.

> It is worth trying. Jace will (probably) generate a simple C++
> interface, and it may be just the thing to do. If you make a plan I
> would start with spending time on assessing the combination with Jace.
>
> SWIG is very good a parsing C/C++ code. If Jace creates clean C++ code
> it may work well.
>
> In the next phase see if you can take Jace out of the equation.
> Especially if it does not deliver all the goods.
I think it's a good goal for a first phase. And, to test it, we can
generate Java bindings via SWIG for the Jace C++ generated bindings in
Java, to see if it works =D

> It should be fairly easy to parse a standard JAVA class and convert it
> to something C-like that SWIG can accept. There should be other ways.
I was reading the docs on SWIG internals, and they have a basic object
system called DOH. We can map Java types and objects to them at first,
and see how it goes.

> Another strategy, after studying the way SWIG is implemented for JAVA -
> and other languages - you may be able to manipulate the JNI and query
> JAVA interactively for bindings (using reflection). After that write
> out the C headers for SWIG to parse.
>
> Another option to try would be using a grammar - and parse JAVA input
> files - there is a very good one written in JAVA named ANTLR
> http://www.antlr.org/. There are probably examples for parsing JAVA
> with ANTLR.
Pretty good options too. I was thinking on going the parser way, and
use the already existing SWIG structure, but we can try ANTLR too.

> I think the essence of this GSoC project is to study the different
> strategies, play around, and do a proof-of-concept finding the most
> elegant way of mapping Python (or Perl or R) against JAVA. So it is a
> project of pursuing different options and finding a route that will
> work for a lot of people. If you find an elegant way fame awaits you
> ;).
Yes, I think a complete solution would take more time than GSoC
provide, but a good proof-of-concept is definitely doable. Gonna start
to write the GSoC application.

> It is important in your plan to create deliverables - in the sense of
> working pieces of code and tests. These will tell you (and us) how
> well a strategy is panning out.
>
> Challenging enough?
Challenging and exciting =D

Luiz Irber

>
> Pj.
>



More information about the BioLib-dev mailing list