Slashdot Mirror


Developer Creates An Experimental Perl 5 To Java Compiler (perl.org)

An anonymous reader writes: Saturday night saw the announcement of an experimental Perl 5 to Java compiler. "This is the first release," posted developer FlÃvio S. Glock -- after 100 weeks of development. "Note that you don't need to compile a Java file. Perlito5 now compiles the Perl code to JVM bytecode in memory and executes it." He describes the compiler as "a work-in-progress" that "provides an impressive coverage of Perl features, but it will not run most existing Perl programs due to platform differences."

94 comments

  1. Are they trying to parrot java with perl? by youn · · Score: 1

    no pun intended :p

    --
    Never antropomorphize computers, they do not like that :p
  2. Haven't they buried this yet? by __aaclcg7560 · · Score: 0, Flamebait

    Perl 5 must be godawful if you need to compile it to Java.

    1. Re:Haven't they buried this yet? by ShanghaiBill · · Score: 5, Informative

      Perl 5 must be godawful if you need to compile it to Java.

      It isn't compiled to Java. It is compiled to JVM bytecode. Perl compilers have been done before, so the only new thing here is the backend target ... and that he claims to support "eval" without an embedded interpreter. I don't see how that is possible, and he should get a Turing award if he actually accomplished that.

    2. Re: Haven't they buried this yet? by Anonymous Coward · · Score: 0

      Considering how long Perl 5 existed before this happened, I'm fairly sure you don't need to do anything of the sort.

    3. Re:Haven't they buried this yet? by ShanghaiBill · · Score: 0

      If he can compile and run the following perl program, I will be extremely impressed.


      #!/usr/bin/env perl
      eval(<>);

    4. Re:Haven't they buried this yet? by Anonymous Coward · · Score: 0

      $ java -jar perlito5.jar -I src5/lib -e ' eval(<>) '
      print 123;^D
      123

    5. Re: Haven't they buried this yet? by __aaclcg7560 · · Score: 2

      Considering how long Perl 5 existed before this happened, I'm fairly sure you don't need to do anything of the sort.

      I wasn't aware that Perl still existed until last year. I thought it disappeared in the aftermath of the dot com bust.

    6. Re:Haven't they buried this yet? by Anonymous Coward · · Score: 1

      you don't need an embeded interpreter.. you are already "interpreting it" to jvm

    7. Re: Haven't they buried this yet? by Anonymous Coward · · Score: 0

      Why are you so proud of your own ignorance, creimer?

    8. Re: Haven't they buried this yet? by angel'o'sphere · · Score: 1

      /. is written in perl ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    9. Re: Haven't they buried this yet? by __aaclcg7560 · · Score: 1

      Why are you so proud of your own ignorance, creimer?

      Perl is a language that I heard about, never used and don't know anyone who had used it.

    10. Re: Haven't they buried this yet? by Anonymous Coward · · Score: 1

      I have programmed but I wouldn't call myself a programmer. I don't deserve to use the title. I haven't earned the right, no have I the experience, to use that title.

      So, pardon my ignorance, but could you explain why, in layman's terms, anyone would want to do this?

    11. Re: Haven't they buried this yet? by __aaclcg7560 · · Score: 2

      /. is written in perl ...

      That would explain why /. haven't been updated in 20 years.

    12. Re: Haven't they buried this yet? by Anonymous Coward · · Score: 1

      I have programmed but I wouldn't call myself a programmer. I don't deserve to use the title. I haven't earned the right, no have I the experience, to use that title.

      So, pardon my ignorance, but could you explain why, in layman's terms, anyone would want to do this?

      For shits and giggles. Or to say that you can.

      Other than that....I can think of no serious reason to do this.

    13. Re:Haven't they buried this yet? by ShanghaiBill · · Score: 1

      you don't need an embeded interpreter.. you are already "interpreting it" to jvm

      Languages like Java and C can be compiled into a fixed stream of bytecode or machine instructions. Perl, like Lisp and Javascript, doesn't work that way. These languages can assemble snippets of their own source code at run time, and then interpret and run them on the fly. This is very common in Lisp, and runtime evaluation happens in most Lisp programs. In Javascript, runtime evaluation is considered to be bad style, and many bug detectors like "JSHint" will complain about it. Perl is in between. Most Perl programs don't do it, but it is fairly common, and most perl hackers will be familiar with it.

    14. Re: Haven't they buried this yet? by __aaclcg7560 · · Score: 1

      [...] the group of people you spend your time with is not slashdotters.

      Funny you should mention that... none of my coworkers have ever heard of Slashdot. Seems like Slashdot is a leftover relic of the dot com bust.

    15. Re: Haven't they buried this yet? by Anonymous Coward · · Score: 0

      I agree. I knew it since IRC times.
      No one in my department, except for maybe my boss, knows what IRC is. And no one (including my boss) has ever heard of slashdot.

    16. Re: Haven't they buried this yet? by MillionthMonkey · · Score: 1

      What I find disappointing is that it only converts Perl 5 to JVM bytecode. All the cool kids are using Perl 6!

    17. Re: Haven't they buried this yet? by Anonymous Coward · · Score: 0

      LOL, thanks!

    18. Re:Haven't they buried this yet? by Xest · · Score: 1

      The whole point in JIT compilation is that it compiles "Just In Time", that is, just in time to execute - to do something like eval you merely JIT the section of script you want to eval when you eval it.

      I'm a little out of date on Java, it's been a while, but alternatively if it supports something like .NET's DLR you simply generate expression trees for execution at runtime and execute those.

      Depending on semantics, you may wish to call these options "interpreters", and I've got some sympathy for that argument given that the boundary between interpreted and JIT'd languages has become ever more blurred - C#'s DLR, HHVM for PHP, and V8 for JavaScript all make the distinction ever less simple. But this really proves the point - the idea of implementing something like eval in a JIT'd language isn't new, because that's exactly what happens for existing classically interpreted languages like JavaScript that are now more commonly JIT compiled.

    19. Re: Haven't they buried this yet? by __aaclcg7560 · · Score: 1

      All the cool kids are using Perl 6!

      When is Perl 6 supposed to come out? ;)

    20. Re: Haven't they buried this yet? by peawormsworth · · Score: 1

      Perl is a language that I heard about, never used and don't know anyone who had used it.

      You should look up Mark Zuckerberg. You never heard of him I guess, but he's very social and has lots of friends. He runs a little site I like to call the facebook.

      Also, there is an old software project called "Slash". It was written in Perl, but probably ran on websites you never used or heard of.

    21. Re: Haven't they buried this yet? by __aaclcg7560 · · Score: 1

      You should look up Mark Zuckerberg.

      The greatest PHP programmer that ever lived. I just got finished reading "Chaos Monkeys: Obscene Fortune and Random Failure in Silicon Valley" by Antonio Garcia Martinez. The author sold his company and engineers to Twitter and joined Facebook in a three-way deal. He complained about using PHP for the frontend at Facebook. You would think a Harvard-educated programmer would use a better language for his webpages than PHP. I'm not going to knocked him for using PHP as it was part of the LAMP stack.

  3. Why? by Anonymous Coward · · Score: 0

    The goal would be: make code run a bit slower and become susceptible to whatever bugs/security flaws that the currently installed version of java has ???
    Is there some mysterious platform that I don't know about where installing perl is harder than installing java???
     

    1. Re:Why? by skids · · Score: 3, Interesting

      Probably merging projects in different laguages on the JVM. Also if you are sandboxed to just the JVM, running Perl5 without hitting metal is neat. I dunno for sure, but this could conceivably play a part in helping Perl6's Inline::Perl5 perform on rakudo-jvm.

  4. Perl to Java Bytecode? by KermodeBear · · Score: 5, Funny

    Well, that's one way to make Perl even more unreadable. :P

    --
    Love sees no species.
    1. Re:Perl to Java Bytecode? by Anonymous Coward · · Score: 0

      Right! My first thought is why? Adding obfuscation is one reason... Though, I think the Perl Journal is dead at this point.

      Perl is my hammer that makes quick nails out of my problems; no one else needs a dirty little script to put all my Rush .mp3s into one playlist or to solve a Click & Clack puzzle.

      Perl is one of the greatest "just fucking do it" languages ever made... all hail Larry! -T

    2. Re:Perl to Java Bytecode? by Anonymous Coward · · Score: 0

      Buzzzt, wrong. Java byte code is far and away more readable than most Perl scripts.

  5. Dev deserves nerdly kudos - however by 93+Escort+Wagon · · Score: 5, Interesting

    I'm not sure if there's a practical point to this. Perl is going to be at least as widely supported as Java, so it's not a question of availability. And the dev makes no claims regarding speed... actually the dev makes no claims whatsoever, other than "here it is" and "most perl scripts won't work". If speed were actually the goal, I don't think Java byte code would be the target.

    From the standpoint of being a cool nerd project, though - most definitely. This does seem like a throwback to the "news for nerds" catch phrase.

    --
    #DeleteChrome
    1. Re:Dev deserves nerdly kudos - however by angel'o'sphere · · Score: 3, Insightful

      Java Byte Code is JIT compiled.
      So chances are that it is much faster than the original perl byte code.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:Dev deserves nerdly kudos - however by Xest · · Score: 1

      I can speak for this type of application, I genuinely find these kind of projects useful, not for Java, but certainly for .NET.

      One of our products supports client scripting, and it used to just call out to native Lua, it was horrible doing this for many reasons, from performance due to unmanaged managed martialling, through to security issues in being difficult to sandbox.

      I replaced the scripting engine with one built ground up to resolve many of these issues, not least to make the damn thing more modular and testable. As a result of that I actually made the language part pluggable, so that we are now able to support multiple languages by just creating a simple language interface plugin, and whilst we do support native interpreters through this engine, we've now retired them all so that we only actually deliver managed languages running on the CLR now. The net result is that we're not simply bound to Lua, but we now support Lua, Python, C#, and a few others.

      The great thing is that performance is up, because we're not hit by the cost of manage/unmanaged martialling, and for languages that support it we allow for precomilation, so for example, precompiled C# scripts run between 40x - 80x faster than calling out to native Lua. But perhaps one of the biggest benefit, is that since we've retired support for native interpreters, and switched to only managed interpreters, we can now support sandboxing in an entirely consistent manner across all languages - that is, restrict what scripts can actually access and do. Our clients love the fact that they're not bound purely to Lua and can use things like Python now, and we're happier because the solution is more performant, and far more secure.

      So I get what you're saying, it's not obvious why all these language projects we see day in, day out are useful, but there are genuine uses - interop, scripting support and so forth can often take great advantage of these things. Creating managed implementations of languages on the JVM, on the CLR and so forth are great endeavors, and for anyone wishing to learn more about language implementation and so forth I would argue are far more productive avenues for self-learning for wider society, than creating yet another programming language that runs in it's own custom execution environment and that doesn't offer anything existing more widely supported languages already do better. I think it's worth making a distinction between projects like this - that expand the use cases for existing languages and technologies and so have wider benefits, and projects we often see pimped here where companies and individuals create a new language that they pretend is the next great thing, but basically never actually is. If nothing else, this project has real actual commercial use cases.

  6. Re: Sadist by slazzy · · Score: 0

    Masochistic I guess? Some people pay to get tied up and spanked too, sounds about the same to a programmer.

    --
    Website Just Down For Me? Find out
  7. oh goodie by ooloorie · · Score: 5, Funny

    The unpalatable compiling to the unspeakable.

    1. Re:oh goodie by thegarbz · · Score: 4, Funny

      And in most cases resulting in the unworkable.

  8. I heard his next project is: by JustNiz · · Score: 2

    Compiler for Bash Scripts to Visual Basic.

    1. Re:I heard his next project is: by glitch! · · Score: 2

      JCL to Javascript! "Run your IBM 360 card decks in your browser!"

      --
      A dingo ate my sig...
    2. Re:I heard his next project is: by JustNiz · · Score: 3, Insightful

      I bet there's a dusty old financial institution out there somewhere that would actually love that.

    3. Re: I heard his next project is: by Anonymous Coward · · Score: 0

      HAI

      Can haz LOLcode to C++ coming soon!

      KTHXBYE

    4. Re:I heard his next project is: by Hognoxious · · Score: 2

      You can get mainframe emulators (the best known is called Hercules) that will run JCL, if you're bonkers enough to want to.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  9. Stop by Anonymous Coward · · Score: 0
  10. There's more than one way to do it... by Anonymous Coward · · Score: 0

    But this is not one of them.

  11. Let's all bash Java! by Anonymous Coward · · Score: 1, Insightful

    Because it's the most used language! And does everything perfectly fine! And has tons of SDK support!

    1. Re:Let's all bash Java! by Anonymous Coward · · Score: 0

      Because it's the most used language!

      Yeah, that's because 10 lines of Python or 20 lines of C# requires 1000 lines of Java to express.

    2. Re:Let's all bash Java! by Anonymous Coward · · Score: 0

      Well, "does everything perfectly fine" is not what I would call it... In fact the problem is that people seem to want it to do everything and (as most languages) it *sort of* does ...

  12. Re:Sadist by king+neckbeard · · Score: 2

    Because you need 'enterprise' and 'synergy' to win at Corporate Buzzword Bingo.

    --
    This is my signature. There are many like it, but this one is mine.
  13. Re: /. java bashing by Anonymous Coward · · Score: 1

    It's honestly pretty pathetic. There are things to like in all the top languages. Java 8 with Spring/Hibernate is easy enough to use.

    But naturally, people hate what isn't super niche.

  14. Re: He does deserve kudos (you don't, lol)... apk by Anonymous Coward · · Score: 0

    You're the best, APK, at least for your persistence. I sincerely wish you all the blessings in life, although I admit sometimes I am concerned about your health.

    Stay well my friend!

  15. Re:Anal Masturbation: How To Make Intensely Pleasu by dougTheRug · · Score: 1

    potentially causing irreparable farm??? Editors, please!!

  16. It's been done before by alangmead · · Score: 4, Informative

    Larry Wall made Java Perl Lingo (JPL, named after Larry's previous employer) around the release of Perl 5. O'Reilly first tried to sell it as a commercial software in the Perl Resource Kit, but eventually made it open source http://www.oreilly.com/pub/pr/... in a "dumpware" sort of mode. It eventually became incompatible with newer Perl and Java releases and I want to say it was abandoned, but that is pretending people used it.

    1. Re:It's been done before by Anonymous Coward · · Score: 0

      ...I'm pretty sure Java did not exist in 1994...

  17. Re: /. java bashing by Anonymous Coward · · Score: 0

    The problem with Java isn't in the language itself. It's that to do anything useful you have to try to include incompatible versions of several libraries and then try to make the zoo somehow function

    Just as the trouble with Python is that, while awesome at success-path programming, writing a proper and fault-tolerant system is almost never done.

  18. What happened to Perl? by Anonymous Coward · · Score: 0

    Perl was all the rage in the late 90s. Then it was Ruby and now everything is Python.

  19. Re:/. java bashing by ooloorie · · Score: 1

    Don't bet on it. It's usually familiarity that breeds the greatest contempt.

  20. 1996 Called... by Waffle+Iron · · Score: 1, Funny

    ... it wants its two hottest languages back.

  21. Re:Sadist by Anonymous Coward · · Score: 1

    You're mistaken. He didn't write a Python to Java compiler. Seriously: Python is a language for anal retentive assholes by anal retentive assholes. It doesn't trust its own users and it attempts to solve the "bad code" problem by throwing a shit ton of documentation acting as a Code Nazi. You can just hear the authors of this shit saying, "Auchtung! You vill code dis vay!" Meanwhile, it forgets that shitty developers don't read that kind of documentation, does nothing to stop them from continuing to write functions that go on for pages, and as a result solves nothing.

  22. He does deserve kudos (you don't)... apk by Anonymous Coward · · Score: 0

    See subject: Any code written by 93 Escort Wagon that our /. peers compliment?

    Prove it.

    * You're ALL hot blowhard windbag AIR - all talk, no substance of your OWN!

    See you had to sockpuppet downmod 'hide' this https://developers.slashdot.org/comments.pl?sid=10609255&cid=54414583/ 2x already https://developers.slashdot.org/comments.pl?sid=10609255&cid=54414657/, lol... you do-nothing windbag whimp.

    APK

    P.S.=> I can easily APK Hosts File Engine 9.0++ SR-7 32/64-bit https://www.google.com/search?hl=en&source=hp&biw=&bih=&q=%22APK+Hosts+File+Engine%22+and+%22start64%22&btnG=Google+Search&gbv=1/ & I can PROVE it does well (vs. STIFFEST CRITICS I've ever seen in /.'ers) https://it.slashdot.org/comments.pl?sid=10606043&cid=54413665/ HOW ABOUT YOU?

    All payback for trolling you've done my way - Embarassed TALKER?? You ought to be - why??? YOU = ALL TALK, NO ACTION!

    1. Re: He does deserve kudos (you don't)... apk by Anonymous Coward · · Score: 0

      You stole your code and claim it is your own. We haven't seen you code. We've seen an application that you stole the code to make. You won't show us the code, because it is insecure malware. You won't show us the code, because you stole it.

      This is why not one other site lets you participate. This is why you're unable to link directly to your malware. You quote people out of context and make up whole quotes of others, to claim someone likes your program.

      You've only proven you're a lying malware author. If we can't see your code, it is malware by default. Now, dance for me, monkey. Dance.

      And no, I am not who you think I am. Idiot boy. Dance for my amusement. That's the real reason they let you continue. Just so you can amuse us... How's that make you feel? Loser.

  23. You fail it by ArchieBunker · · Score: 0

    You dummy, that domain expired years ago! Its for sale for the low low price of $2000.

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
  24. Re:He does deserve kudos (you don't, lol)... apk by Anonymous Coward · · Score: 0

    Rather see no code than an embarassing piece of shit like your hosts file program.

  25. Well, bash is better than csh by aberglas · · Score: 1

    more words more words more words

  26. MSDOS for Unix by aberglas · · Score: 1

    That is what the world really needs.

    1. Re: MSDOS for Unix by Anonymous Coward · · Score: 0

      We already have DOSBox and a bunch of other shit.

  27. Re: /. java bashing by Anonymous Coward · · Score: 0

    Yes, like PHP

  28. "Ne'er-do-well" 93 escort wagon /.ers disagree by Anonymous Coward · · Score: 0

    I'm going to continue using the Host File Engine. Your software is well written, functional. The Host File Engine performs exactly as promised by mmell

    his hosts program is actually pretty good by xenotransplant

    his hosts tool is actually useful for those cases in which one does indeed want to locally block stuff outright while consuming minimum system resources by alexgieg

    I've never tried to belittle (APK's) work, I've flat out said it's good by BronsCon

    APK is kinda right. I've tried his hosts file generating software. It works by bmo

    I like your host file system by Karmashock

    I find your hosts file admirable by vel-ex-tech

    * My code's liked + recommended & hosted by Malwarebytes' hpHosts!

    APK

    P.S.=> See subject & EAT YOUR WORDS - you did better? YOU haven't done SHIT except bs by UNIDENTIFIABLE anonymous posts "93 Escort wagon" you FAKE NAME for your FAKE LIFE fuck (must be outta "downmod points" from your sockpuppet accounts)... apk

  29. Re: WHO WE ARE by Anonymous Coward · · Score: 0

    You know what amuses me? Both NAMBLA and GNAA deserve, and get, more respect than APK. Even app guy is respected more than APK.

    For what it is worth, every other site has kicked APK out. But, we still let him stick around, even though he can't link to his malware anymore. NAMBLA > APK. Funny, isn't it?

  30. Make it stop by JustAnotherOldGuy · · Score: 0

    "Saturday night saw the announcement of an experimental Perl 5 to Java compiler."

    Now you can go from incomprehensible shit to unmanageable drek with just a click! Yippee!

    --
    Just cruising through this digital world at 33 1/3 rpm...
  31. I wrote it: Proof's malwarebytes by Anonymous Coward · · Score: 0

    See subject: Mr. Steven Burn of Malwarebytes audited my code for safety & it's mine "HyperAlloy combat chassis" bulletproof & bug-free grade!

    Malware? Google's VirusTotal shows it's Safe https://www.virustotal.com/en/file/e01211ca36aa02e923f20adee0a3c4f5d5187dc65bdf1c997b3da3c2b0745425/analysis/1433430542/

    No other site? Malwarebytes' hpHosts both HOSTS & RECOMMENDS my work (per the above) & Start64 is the 64-bit software site showcasing it too!

    I don't openSORES my code due to Google mistakes (see EFast). I'm not as dumb as Google!

    * Blowing you away w/ facts easily continually every time's amusing via quotes of /. peers https://developers.slashdot.org/comments.pl?sid=10609255&cid=54416019/

    APK

    P.S.=> I'm certain you're just "ne'er-do-well" troll 93 Escort Wagon posting UNIDENTIFIABLE anonymous! A FAKE NAME for your FAKE LIFE isn't working out for you - you stooped even LOWER, lmao!... apk

    1. Re: I wrote it: Proof's malwarebytes by Anonymous Coward · · Score: 0

      Nope, that's still not the right person. And, if I can't see your code, the default position to hold is that you hid it for malicious reasons. Add to that you're a spammer, it's safe to assume it is harmful. That makes it malware.

      Dance more. You will do what you're told to do.

    2. Re: I wrote it: Proof's malwarebytes by Anonymous Coward · · Score: 0

      You projecting Apk makes you dance. Everybody on slashdot knows apk's code was audited by malwarebytes who host and recommend his program. Google owned Virustotal also shows his program is safe also. Apk stated many times he cannot show his code since he does not want a malicious copy to surface as happened to Google with EFast Chrome being an example of misused open source code.

  32. UTF-8 error. by cheesybagel · · Score: 1

    "FlÃvio"? His name is Flávio.

    2017. And people still have websites which can't process UTF-8 properly. Jesus.

  33. SoylentNews supports UTF-8 by xororand · · Score: 1

    SoylentNews is forked off Slash and supports UTF-8.
    The downside is that SoylentNews doesn't include 5000 external JavaScript resources as a modern site should.

    1. Re:SoylentNews supports UTF-8 by Anonymous Coward · · Score: 0

      This reminds me of when I ate my penis with a spork.

  34. Re:Sadist by Anonymous Coward · · Score: 0

    > Python is a language for anal retentive assholes by anal retentive assholes.

    Wow, you should try programming in Scala or Haskell or something truly restrictive. Python is the wild west by comparison. I mean, sure.. it doesn't accept pure line noise as valid code the way perl does, but if that's what you think of as anal retentive, I shudder to think what you think of as loose.

  35. perl and java in a tree... by fuzzywig · · Score: 1

    And now you have two problems...

  36. Re:Why Java... Noooo! by Anonymous Coward · · Score: 0

    Came here to make the same comment!

    So many think that Perl isn't as good as the "new" stuff since it's been around for a while. New is not always better and old is not necessarily a bad thing. There is something to be said for mature and stable over jumping on every new bandwagon that comes along. Java may seem like the "new and improved" choice but it really is garbage, especially compared to Perl.
    --
    Steve (AC because I haven't bothered to register in all these years)

  37. Solution in search of a problem by ebvwfbw · · Score: 2

    While it may work and all... why? Why translate Perl that will run, runs well, doesn't have any of the problems of Java... why move it into java?
    Someone after a rube goldberg award?

  38. Java to Perl? by LesserWeevil · · Score: 1

    Personally, I'd find a Java-to-Perl converter more useful. Lots of good dev environments for Java, not so much for Perl.