Ruby 2.0 joint Ruby/Perl/Python backend ?

S

surf

At the back of the Nutshell book it mentions a possibilty of a joint
backend of Ruby/Perl/Python.

Anyone ever heard much on that ? The really cool thing about that
would be that might be that if you could get access to all the Perl
stuff on CPAN and call it through Ruby then you could leverage that,
otherwise Ruby developers would have to reinvent the wheel on that
stuff and there is a ton of stuff available.
 
P

pat eyler

At the back of the Nutshell book it mentions a possibilty of a joint
backend of Ruby/Perl/Python.

Anyone ever heard much on that ? The really cool thing about that
would be that might be that if you could get access to all the Perl
stuff on CPAN and call it through Ruby then you could leverage that,
otherwise Ruby developers would have to reinvent the wheel on that
stuff and there is a ton of stuff available.

That's the lure of Cardinal (Ruby on Parrot):
http://cardinal2.rubyforge.org

It's not very far along at this point, bu you can read about an interview
with the lead hacker here:
http://on-ruby.blogspot.com/2006/09/ruby-hacker-interview-kevin-tew.html
 
M

M. Edward (Ed) Borasky

surf said:
At the back of the Nutshell book it mentions a possibilty of a joint
backend of Ruby/Perl/Python.

Anyone ever heard much on that ? The really cool thing about that
would be that might be that if you could get access to all the Perl
stuff on CPAN and call it through Ruby then you could leverage that,
otherwise Ruby developers would have to reinvent the wheel on that
stuff and there is a ton of stuff available.
s/Perl/Java/ and you have Java, JRuby and Jython running on the Java
Virtual Machine. With all due respect to the Parrot and Cardinal
projects, the JVM has many engineer-decades of industrial strength
software development under its belt and is now Open Source -- GPL, even!
If you *must* have Perl, it seems to me the path of least resistance
would be to build a JPerl. I don't know for a fact that there isn't such
a project. :)
 
M

micathom

s/Perl/Java/ and you have Java, JRuby and Jython running on the Java
Virtual Machine.

I think there is a difference between having an interpreter running in
the jvm running ruby code or ruby source code being translated/compiled
to bytecode running in a vm (maybe using a JIT compiler) -- and the jvm
is AFAIK rather java centric.
 
C

Charles Oliver Nutter

micathom said:
I think there is a difference between having an interpreter running in
the jvm running ruby code or ruby source code being translated/compiled
to bytecode running in a vm (maybe using a JIT compiler) -- and the jvm
is AFAIK rather java centric.

Jython already compiles to bytecode. I've been working on JRuby's
compiler, and it's going very well. There's not really anything about
the JVM that would prevent these languages from getting compiled to
bytecode, and there are plans to expand/improve the JVM to make it
easier to do so.

As an example, here's a fib(34) benchmark running under Ruby 1.8.5 and
in JRuby trunk with my prototype JIT compiler enabled:

(the "compiled" line is logging from JRuby's JIT)

~/NetBeansProjects/jruby$ ruby test/bench/bench_fib_recursive.rb
12.740000 1.790000 14.530000 ( 14.531119)
12.800000 1.750000 14.550000 ( 14.557708)
~/NetBeansProjects/jruby$ jruby test/bench/bench_fib_recursive.rb
compiled: Object.fib_ruby
8.178000 0.000000 8.178000 ( 8.178000)
7.199000 0.000000 7.199000 ( 7.199000)

- Charlie
 
B

Ben Bleything

On Fri, Jan 19, 2007, micathom wrote:

to bytecode running in a vm (maybe using a JIT compiler) -- and the jvm
is AFAIK rather java centric.

I don't think this is true... it's just (relatively) primitive. My
university's architecture and assembly class used the JVM as the example
machine ;)

Ben
 
M

micathom

Jython already compiles to bytecode. I've been working on JRuby's
compiler, and it's going very well. There's not really anything about
the JVM that would prevent these languages from getting compiled to
bytecode, and there are plans to expand/improve the JVM to make it
easier to do so.

Well, I vaguely remember some papers explaining why the CLR is better
suited than the JVM as a generic VM and why some tricks are simply
impossible (or unlikely) with the JVM. But please don't ask me about
details, and you will probably know papers coming to exactly the
opposite conclusion. Anyway, my personal impression was that most
jsomething compilers/interpreters often were frustratingly slow and
IMHO never quite kept up with their creator's promises. But I have to
admit that this information is not, well, up to date and I'm very glad
to hear that it maybe isn't true (any longer?) and will improve. Thanks
for the info.
 
G

Giles Bowkett

Speaking as a former Perl hacker, even a one-time "Perl Guru" -- not
really, but they called me that at one particular company -- I have to
tell you, reinventing the wheel is only bad when the existing wheel is
circular. There may be one or two square wheels on CPAN, and if so,
reinventing them would probably be okay. I mean you could make the
case that Rails is nothing but a square ring of square wheels
reinvented recursively to be circular (although the metaphor breaks
down pretty painfully).
s/Perl/Java/ and you have Java, JRuby and Jython running on the Java
Virtual Machine. With all due respect to the Parrot and Cardinal
projects, the JVM has many engineer-decades of industrial strength
software development under its belt and is now Open Source -- GPL, even!
If you *must* have Perl, it seems to me the path of least resistance
would be to build a JPerl. I don't know for a fact that there isn't such
a project. :)

I think this is a very good point. (Which is probably it took over the
entire thread.) The Parrot and Cardinal projects **sound** cool, but
I've always been skeptical of both -- honestly, I'm not sure why, but
I definitely have doubts -- while JRuby and Jython happened naturally,
and instead of being just around the corner for a decade or so, they
happened quickly, especially JRuby.

There's actually a very neat interview on InfoQ with Tim Bray (I
think? the Atom guy) about why Sun is interested in things like JRuby,
and the answer is, if Ruby runs on a JVM ten years from now, making
JVMs and hardware that runs them well is still a business.

That being said, I heard Jython might actually be dead in the water.
Total rumor, though, I don't really know. I was up very late last
night and I'm still in a groggy morning mode, so if the post seems
grumpy and/or ill-informed, sorry about that.
 
R

Rich Morin

At the back of the Nutshell book it mentions a possibilty of a joint
backend of Ruby/Perl/Python.

Anyone ever heard much on that ? The really cool thing about that
would be that might be that if you could get access to all the Perl
stuff on CPAN and call it through Ruby then you could leverage that,
otherwise Ruby developers would have to reinvent the wheel on that
stuff and there is a ton of stuff available.

The Perl 6 back end is called Parrot (a Monty Python reference, FWIW).
An attempt is being made to create front ends for Python, Ruby, etc.
The Ruby front end is called Cardinal. See:

http://rubyforge.org/projects/cardinal/

Note that there are also efforts under way to run Ruby on top of the
Java Virtual Machine (JRuby) and .NET (e.g., NETRuby, Ruby.NET).

-r
--
http://www.cfcl.com/rdm Rich Morin
http://www.cfcl.com/rdm/resume (e-mail address removed)
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Technical editing and writing, programming, and web development
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top