[Biojava-l] Java to Perl

Andy Yates ayates at ebi.ac.uk
Mon Oct 15 08:15:33 UTC 2007


Unfortunately to my knowledge there is no Perl/Java scripting interface. 
Apparently for some reason Perl is not trendy enough to warrant a port 
(which is a pity).

In response to Vineith's original question such a tool really wouldn't 
work. Good Perl code is very different to good Java code. If you did get 
something that would work you'd probably end up with quite verbose & 
in-efficent Perl code (not to mention the problems that would arise with 
Perl objects having no access modifiers, using inside-out objects, 
converting 3rd party libraries etc).

Two options do spring to mind if you need code available in both languages:

* Make one of the pieces of code a "black box" where you read results 
from STDOUT (works well enough calling a Java program from Perl).

* Write the commmon code in C

Out of these two options if you want the code replicated in a 1-1 
fashion then C is your only option. Otherwise the first idea is the 
easiest to work with.

As David did mention there are other scripting engines available 
(Jython, Groovy, JRuby & Rhino all spring to mind) which might satisfy 
your scripting needs whilst remaining in a Java environment (Groovy hits 
that nice sweet spot for a Java inspired scripting language).

Andy

P.S. This really isn't a Biojava question ...

David Barbosa Feitosa wrote:
> Vineith
> 
> I do not know, but if you need to execute Pearl code inside Java code, in
> Java 6, codename Mustang, is possible to execute script code inside the Java
> Virtual Machine.
> 
> The default scripting engine is Rhino, for JavaScript, but as it is a
> specification, if exists an Pearl engine, you can plug it into the JVM and
> execute your Pearl code.
> 
> Mode infoa bout the available engines and how to install one:
> 
> https://scripting.dev.java.net/
> 
> Maybe it can help you,
> 
> David.
> 
> 2007/10/14, vineith kaul <vineith at gmail.com>:
>> Is there some tool by which we can convert a complete Java Code to  a
>> Perl code ?
>>
>> --
>> Vineith Kaul
>> Masters Student Bioinformatics
>> The Parker H. Petit Institute for Bioengineering and Bioscience (IBB)
>> Georgia Tech, Atlanta
>> _______________________________________________
>> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biojava-l
>>
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l



More information about the Biojava-l mailing list