Ruby 2.0 joint Ruby/Perl/Python backend ?

Discussion in 'Ruby' started by surf, Jan 18, 2007.

  1. surf

    surf Guest

    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.
    surf, Jan 18, 2007
    #1
    1. Advertising

  2. surf

    pat eyler Guest

    On 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.
    >


    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

    >
    >



    --
    thanks,
    -pate
    -------------------------
    http://on-ruby.blogspot.com
    pat eyler, Jan 18, 2007
    #2
    1. Advertising

  3. 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. :)

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

    If God had meant for carrots to be eaten cooked, He would have given rabbits fire.
    M. Edward (Ed) Borasky, Jan 18, 2007
    #3
  4. surf

    micathom Guest

    > 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.
    micathom, Jan 18, 2007
    #4
  5. 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
    Charles Oliver Nutter, Jan 18, 2007
    #5
  6. On Fri, Jan 19, 2007, micathom wrote:

    <snip>

    > 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
    Ben Bleything, Jan 18, 2007
    #6
  7. surf

    micathom Guest

    > 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.
    micathom, Jan 18, 2007
    #7
  8. On 1/18/07, M. Edward (Ed) Borasky <> 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. :)


    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.

    --
    Giles Bowkett
    http://www.gilesgoatboy.org
    http://gilesbowkett.blogspot.com
    http://gilesgoatboy.blogspot.com
    Giles Bowkett, Jan 18, 2007
    #8
  9. surf

    Rich Morin Guest

    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 Morin
    http://www.cfcl.com/rdm/resume
    http://www.cfcl.com/rdm/weblog +1 650-873-7841

    Technical editing and writing, programming, and web development
    Rich Morin, Jan 18, 2007
    #9
  10. surf

    pat eyler Guest

    On 1/18/07, Rich Morin <> wrote:
    > 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/


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

    >
    > 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
    > http://www.cfcl.com/rdm/weblog +1 650-873-7841
    >
    > Technical editing and writing, programming, and web development
    >
    >



    --
    thanks,
    -pate
    -------------------------
    http://on-ruby.blogspot.com
    pat eyler, Jan 18, 2007
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page