Developer Creates An Experimental Perl 5 To Java Compiler (perl.org) 94
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."
Are they trying to parrot java with perl? (Score:2)
no pun intended :p
Re:Haven't they buried this yet? (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.
Re: (Score:1)
If he can compile and run the following perl program, I will be extremely impressed.
#!/usr/bin/env perl
eval(<>);
Re: (Score:1)
you don't need an embeded interpreter.. you are already "interpreting it" to jvm
Re: Haven't they buried this yet? (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?
Re: (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.
Re: (Score:2)
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. Mos
Re: (Score:2)
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 argume
Re: (Score:3)
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.
Re: (Score:2)
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.
Re: (Score:2)
[...] 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.
Re: (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.
Re: (Score:2)
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" [amzn.to] 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.
Re: (Score:2)
/. is written in perl ...
Re: (Score:3)
/. is written in perl ...
That would explain why /. haven't been updated in 20 years.
Re: (Score:2)
Re: (Score:2)
All the cool kids are using Perl 6!
When is Perl 6 supposed to come out? ;)
Re: (Score:1)
Re:Why? (Score:4, 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.
Perl to Java Bytecode? (Score:5, Funny)
Well, that's one way to make Perl even more unreadable. :P
Re: Sadist (Score:1)
Re: (Score:3)
Re: (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 f
Dev deserves nerdly kudos - however (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.
Re:Dev deserves nerdly kudos - however (Score:4, Insightful)
Java Byte Code is JIT compiled.
So chances are that it is much faster than the original perl byte code.
Re: (Score:2)
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
oh goodie (Score:5, Funny)
The unpalatable compiling to the unspeakable.
Re:oh goodie (Score:5, Funny)
And in most cases resulting in the unworkable.
I heard his next project is: (Score:3)
Compiler for Bash Scripts to Visual Basic.
Re: (Score:3)
JCL to Javascript! "Run your IBM 360 card decks in your browser!"
Re:I heard his next project is: (Score:4, Insightful)
I bet there's a dusty old financial institution out there somewhere that would actually love that.
Re: (Score:3)
You can get mainframe emulators (the best known is called Hercules) that will run JCL, if you're bonkers enough to want to.
Let's all bash Java! (Score:1, Insightful)
Because it's the most used language! And does everything perfectly fine! And has tons of SDK support!
Well, bash is better than csh (Score:2)
more words more words more words
Re: /. java bashing (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.
Re: (Score:2)
Don't bet on it. It's usually familiarity that breeds the greatest contempt.
It's been done before (Score:4, Informative)
1996 Called... (Score:2, Funny)
... it wants its two hottest languages back.
You fail it (Score:1)
You dummy, that domain expired years ago! Its for sale for the low low price of $2000.
MSDOS for Unix (Score:2)
That is what the world really needs.
Make it stop (Score:1)
"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!
UTF-8 error. (Score:2)
"FlÃvio"? His name is Flávio.
2017. And people still have websites which can't process UTF-8 properly. Jesus.
SoylentNews supports UTF-8 (Score:2)
SoylentNews [soylentnews.org] 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.
perl and java in a tree... (Score:2)
Solution in search of a problem (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?
Java to Perl? (Score:1)