[Biojava-l] Java to Perl
Mark Fortner
phidias51 at gmail.com
Mon Oct 15 14:57:06 UTC 2007
The original post indicated that they wanted to go from java to perl. Doing
a quick Google search yielded a lot of hits for tools going from perl to
java. Just out curiosity, was there some reason you wanted to create perl
code from Java code?
There are a couple of projects which supposedly provide PERL-scripting
support inside Java to one extent or another. The first is called Sleep (
http://sleep.hick.org/) which is described as being a PERL-like plugin for
the Java 6 scripting engine. There's also a BSF plugin called BSF Perl (
http://bsfperl.sf.net) and another BSF plugin called PerlScript which is
part of ActiveState's ActivePerl distribution.
I don't have any first-hand experience with any of these, so please don't
construe anything I say as an endorsement of these technologies. Although
none of these solutions will convert PERL code into Java or vice-versa, they
may allow you to run Perl inside a VM.
Hope this helps,
Mark
On 10/15/07, Andy Yates <ayates at ebi.ac.uk> wrote:
>
> 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
> _______________________________________________
> 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