Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Perl5 to Java compiler - first release

by fglock (Vicar)
on May 13, 2017 at 17:28 UTC ( #1190211=perlnews: print w/replies, xml ) Need Help??

Posted in blogs.perl.org.

The "perlito5.jar" file provides a perl-like command line:

    java -jar perlito5.jar -I src5/lib -e ' print "hello, World!\n" '

Replies are listed 'Best First'.
Re: Perl5 to Java compiler - first release
by Discipulus (Monsignor) on May 15, 2017 at 19:14 UTC
    thanks and ++fglock it seems a very big job what you have done.

    I read the brief blog post and lurked here and there into the github docs.

    I'm a just-perl coder, really: i do not even consider hardware where Perl cannot run.

    Can I ask, without any malicious intention, where and why and how i can profit translating my perl code into java?

    I'm very ignorant in many many IT fields, but if i force my brain to imagine where i may need java i just come out with phones (another field where i know nothing) and client side code in browsers.

    Might be i'm totally missing the point (it happens), but anyway can you be so kind to show some scenarios where this translation can be a profitable thing?

    my best wishes for your project



    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

      We have experimented with building an Android app in a hackathon last year.

      This was using Perl for the "Activity" and importing the native Java modules - blogs.perl.org and youtube presentation

      This would work best if we implemented a Perl module. Calling Android APIs directly was a bit messy.

      Note that you can also run the real "perl" on Android - perl dist and blogs.perl.org

      Another experiment was with an HBase table scan for some bigdata project.

      These projects all used pre-compiled Perl to Java. Precompiled Perl can be potentially faster than "perl" - specially if you use typed variables.

      The new thing in this release is that it can execute Perl directly, without precompilation - and it also executes BEGIN blocks and eval-string. Java applications can also "embed" Perl if there is a need for scripting.

      Also maybe some company that is migrating to Java can keep using Perl, instead of rewriting.

      tl;dr This is still new and I don't have a clear idea what it will be used for.

Re: Perl5 to Java compiler - first release
by LanX (Bishop) on May 13, 2017 at 17:37 UTC
    Hi Flavio

    Does perlito now support translating regexes?

    edit

    Btw: good job. :)

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      Regexes are parsed by this grammar - Perlito5::Grammar::Regex5.

      In this release, "java.util.regex" is the core regex engine. The Perlito runtime provides "/g", "/e", "/ee", pos(), (?#...) and other Perl-specific features.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://1190211]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-10-21 14:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (270 votes). Check out past polls.

    Notices?