Ruby 2.0 joint Ruby/Perl/Python backend?

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.

On 1/18/07, surf [email protected] wrote:

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

surf wrote:

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. :slight_smile:


M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC§
http://borasky-research.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.

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.

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 :wink:

Ben

micathom wrote:

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.

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

On 1/18/07, M. Edward (Ed) Borasky [email protected] wrote:

surf wrote:

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.

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. :slight_smile:

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 B. (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.

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.

At 10:15 PM +0900 1/18/07, surf wrote:

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 M.
http://www.cfcl.com/rdm/resume [email protected]
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Technical editing and writing, programming, and web development

On 1/18/07, Rich M. [email protected] wrote:

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/

actually, cardinal is dead, cardinal2 is the project you want

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs