Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming

The State of Ruby VMs — Ruby Renaissance 89

igrigorik writes "In the short span of just a couple of years, the Ruby VM space has evolved to more than just a handful of choices: MRI, JRuby, IronRuby, MacRuby, Rubinius, MagLev, REE and BlueRuby. Four of these VMs will hit 1.0 status in the upcoming year and will open up entirely new possibilities for the language — Mac apps via MacRuby, Ruby in the browser via Silverlight, object persistence via Smalltalk VM, and so forth. This article takes a detailed look at the past year, the progress of each project, and where the community is heading. It's an exciting time to be a Rubyist."
This discussion has been archived. No new comments can be posted.

The State of Ruby VMs — Ruby Renaissance

Comments Filter:
  • Ruby Javascript (Score:3, Insightful)

    by Djupblue ( 780563 ) on Sunday November 22, 2009 @12:06PM (#30193908)

    It would be so nice to be able to use Ruby instead of Javascript.
    It is so much easier to write clean code in Ruby and since I use a lot of Ruby on Rails it would be great to be able to use the same code in the backend and in the browser. Go Ruby! :)

    • Re: (Score:2, Informative)

      by korney ( 1469497 )
      That's unlikely to happen. RJS with Rails is a nice alternative though.
    • by DrXym ( 126579 )
      Google web toolkit allows devs to write in Java which is translated into JS. I'm sure something similar is feasible for Ruby too.
    • There's nothing stopping you from writing a Ruby DOM interface, and modifying your favorite browser to understand [script type="text/ruby"] tags on websites. It's all designed to be language-neutral, I have no idea why there's never been an effort to create more language options. (Well, IE had ActiveX, but that was never picked-up for obvious reasons.)

      • Nothing, except getting the browser makers to distribute it for you, especially Microsoft, at the expense of the technology(ActiveX) they developed to do just that, plus increase their stranglehold on desktops.

        Why would they let you do what they failed to do?

    • Re: (Score:2, Interesting)

      by mythz ( 857024 )

      Sounds like the start of a Ruby fanboi crowd right here on /.

      Javascript is a powerful functional protyped-based language that is just as powerful as any other dynamic language. Libraries like jQuery show just how powerful and expressive the language can be while applications like google maps, gmail, etc show how capable the language is.

      It gets most of its negative sentiment from devs who don't understand it fully to appreciate its strengths. I would suggest using the resources on http://www.crockford.com/ja [crockford.com]

    • It is so much easier to write clean code in Ruby

      How come? What do you mean by clean?

      I know Javascript a lot better than I know Ruby, but I've got at least some mild experience with the latter, and so far, I don't see any particular feature of the language that suggests to me that Ruby's on a higher plane. Perhaps you could point out some?

      it would be great to be able to use the same code in the backend and in the browser.

      It would, which is one reason why it's exciting to see Javascript gaining traction on t

    • It would be so nice to be able to use Ruby instead of Javascript

      The article had a couple links to Gestalt [visitmix.com], which does just that (for both Ruby and Python), for browsers that have Silverlight or Moonlight installed.

    • I have long said that Webbrowsers should be scripting language independent. They should be (like) plug-ins. With the same API exposed into it.

      JS is actually pretty great, if you know how to use it. Which most that complain about it don’s. Or how many of those actually do functional programming in it, or really understand prototype-based object orientation?

      I am for adding Python, Ruby, Haskell, OCaml, Erlang, but NOT C/C++, Perl or Lua. Maybe Java. Big maybe. ^^
      Then again, I am a friend of well-designe

      • by toriver ( 11308 )

        I have long said that Webbrowsers should be scripting language independent. They should be (like) plug-ins. With the same API exposed into it.

        Yeah! And we could call it... Windows Scripting Host! And third-party languages like ActivePython would work like a charm in the browsers! At least as long as it is Internet Explorer...

  • Did the ancient Greeks and Romans have Ruby VMs that are just now bursting back onto the cultural scene?
  • Ruby at a sight (Score:2, Interesting)

    by oldhack ( 1037484 )

    I've gotten to use Python in the last couple of years - it's concise, expressive, whole lot less verbose (compared to Java, C) but bit problematic when trying for tighter design with bigger scopes.

    What are the pluses/minuses of Ruby compared to Python? Has it dumped all its Perlism now? (I looked at Ruby briefly years back).

    • Re: (Score:1, Insightful)

      by Anonymous Coward

      You didn't apparently look deeply. Ruby didn't resemble perl then, and it doesn't now. Ruby is far more powerful and expressive than Python.

      Ruby did borrow some things from Perl, but it borrowed far more from Smalltalk.

    • Re:Ruby at a sight (Score:4, Informative)

      by Fred_A ( 10934 ) <fred@NOspam.fredshome.org> on Sunday November 22, 2009 @12:29PM (#30194110) Homepage

      What are the pluses/minuses of Ruby compared to Python?

      Short version : Same Same but different.

    • Re:Ruby at a sight (Score:5, Informative)

      by RAMMS+EIN ( 578166 ) on Sunday November 22, 2009 @01:06PM (#30194448) Homepage Journal

      ``I've gotten to use Python in the last couple of years - it's concise, expressive, whole lot less verbose (compared to Java, C)''

      On those issues, Ruby isn't very different. In fact, I think the reason there are so many heated debates about which of Ruby and Python is better is exactly because, all things said and done, the differences don't matter that much and your preference is largely a matter of taste.

      ``but bit problematic when trying for tighter design with bigger scopes.''

      Ruby borrows features from other great languages like Lisp and Smalltalk, which allow it to more naturally express paradigms other than imperative, and classes-and-methods. On the other hand, there is something to be said for Python's "one way to do it", as well.

      Comparing Ruby and Python, I find that Python programs tend to have cleaner syntax (fewer hieroglyphs in the code) whereas Ruby programs tend to have cleaner structure (program more closely expresses what is being done because the language is multi-paradigm).

      For programming in the large, both languages have about the same advantages and disadvantages: you have metaprogramming, which is a big plus, but no static checking, which is a minus. Personally, I feel like metaprogramming is an integral part of Ruby programming, whereas, in Python, it runs contrary to the spirit of "one way to do it", but Python does support metaprogramming and plenty of people are putting it to good use.

      ``What are the pluses/minuses of Ruby compared to Python? Has it dumped all its Perlism now? (I looked at Ruby briefly years back).''

      Ruby definitely hasn't dumped its Perlisms. That's both a blessing and a curse: on the one hand, it allows for ugly programs, on the other hand, sometimes it's useful to say in a few hieroglyphs what would otherwise require lots of boilerplate code. Again, taste plays a role, but I must note that many languages that forgo Perlisms usually end up adopting regular expressions anyway, only with less power and more leaning toothpick syndrome. Given the choice, I'd rather have first-class regular expressions like Perl, even though they are the worst offenders in making Perl code look like line noise.

      Basically, if you like Python for its purity, you'll probably detest Ruby. It's messy. But if you like Python for its expressive power, you may like Ruby because it offers you more of that. If you like Python but want static typing, don't bother with Ruby, because it won't give you that. You might be better off trying OCaml, Haskell, or Common Lisp (with appropriate compiler) in that case. If you're looking for speed, those are better options, too.

      • Re:Ruby at a sight (Score:4, Informative)

        by ultrabot ( 200914 ) on Sunday November 22, 2009 @01:21PM (#30194588)

        In fact, I think the reason there are so many heated debates about which of Ruby and Python is better is exactly because, all things said and done, the differences don't matter that much and your preference is largely a matter of taste.

        Indeed. It probably won't make much sense to switch from ruby to python or python to ruby, unless you get paid to do that.

      • Re:Ruby at a sight (Score:4, Insightful)

        by Hurricane78 ( 562437 ) <deleted&slashdot,org> on Monday November 23, 2009 @05:06AM (#30200210)

        Personally, I feel like metaprogramming is an integral part of Ruby programming, whereas, in Python, it runs contrary to the spirit of "one way to do it", but Python does support metaprogramming and plenty of people are putting it to good use.

        You have heard of the concept of functional programming, have you? If functions are first-class citizens in data-type world, there is no separation between functions and data (or algorithms and data structures) anymore. So there is no point in a word like “metaprogramming”. What those languages support, is metaprogramming. And it’s sometimes shocking how much it exactly looks like Haskell (where everybody steals from nowadays). ^^

        JavaScript also belongs into that family.

        As soon as you understand Haskell, suddenly, all those languages become much more intuitive, expressive and useful. (I love higher-order functions! ^^)

        • Re: (Score:3, Interesting)

          by RAMMS+EIN ( 578166 )

          ``You have heard of the concept of functional programming, have you? If functions are first-class citizens in data-type world, there is no separation between functions and data (or algorithms and data structures) anymore. So there is no point in a word like "metaprogramming". What those languages support, is metaprogramming.''

          Not quite. Metaprogramming [c2.com] is programs operating on programs. In that sense, there isn't actually a real need for a language to specifically support metaprogramming, because you can al

    • Re:Ruby at a sight (Score:5, Interesting)

      by iluvcapra ( 782887 ) on Sunday November 22, 2009 @01:20PM (#30194580)
      On Ruby's side:
      • Pervasively object-oriented, with anonymous classes, metaclasses and proper private methods. However, if your keyboard doesn't have a period, you could be convinced it pervasively functional, since it has 1st-class blocks, closures and continuations.
      • A very loose syntax, with no syntactic whitespace.
      • A lot of mindshare and goodwill, centering on the Ruby on Rails framework.

      Negatives:

      • Interpreter has been too damn slow for too long, but as you see here they're working on it.
      • it has a big learning curve for Python people. It's very different.
      • Re:Ruby at a sight (Score:4, Informative)

        by Megaweapon ( 25185 ) on Sunday November 22, 2009 @04:28PM (#30196024) Homepage

        A lot of mindshare and goodwill, centering on the Ruby on Rails framework.

        Nothing against Rails, but there's a lot more to Ruby and the Ruby community than that one web framework.

        • I know, I myself have written several tools in Ruby CLI and RubyCocoa for work and other things, but Rails is really how I, and a lot of people over the last few years have received their entre to the language.

          Rails it the reason there are now 6-odd OSS projects trying to speed up Ruby interpretation. For a long time Rails just couldn't compete on raw metrics with Python and PHP, but Rails was simply so much better from a developer workload standpoint, and its evangelist so much more organized, that now R

          • I know, I myself have written several tools in Ruby CLI and RubyCocoa for work and other things, but Rails is really how I, and a lot of people over the last few years have received their entre to the language.

            Rails was my introduction to Ruby, and the reason I hated it. Once I found learned about the language itself, it was the start of a new love.

            Just sayin', there are different experiences out there.

      • Re: (Score:1, Interesting)

        by Anonymous Coward

        It'd be good if you'd actually been familiar with Python before comparing the two.

        Pervasively object-oriented

        Like Python.

        with anonymous classes

        This is convenient, but it's nothing more than a convenience, and not one you have to use often.

        metaclasses

        Like Python.

        and proper private methods.

        Many Python programmers would probably consider this a bug, not a feature.

        1st-class blocks

        Here's something that's an actual, genuine advantage, and that I wish Python had.

        closures

        Like Python.

        continuations

        This is another act

      • Re: (Score:3, Informative)

        Pervasively object-oriented, with anonymous classes, metaclasses and proper private methods. However, if your keyboard doesn't have a period, you could be convinced it pervasively functional, since it has 1st-class blocks, closures and continuations.

        Continuations have been removed from the core of Ruby, though they remain a library feature available with the main Ruby 1.9 implementation. They were removed for a number of reasons -- one is that no one was using them directly in production code (in part, that

  • Good News (Score:5, Insightful)

    by RAMMS+EIN ( 578166 ) on Sunday November 22, 2009 @12:28PM (#30194102) Homepage Journal

    I'm glad to see so much work is being done on Ruby, and especially that people are working on compiling Ruby to native code. Ruby is a great language, but there is no denying that the old implementation (MRI 1.8 and before) is dog slow.

  • by Anonymous Coward on Sunday November 22, 2009 @05:21PM (#30196402)

    This is an exciting time not only for Ruby, but for other dynamic languages as well, especially javascript and python.
    For example python has a number of different implementations on the works that are starting to show good results in performance improvements.
    Pypy (python in python) is already able to generate very fast numerical code, its JIT is making progress at good pace since the last months, and a new release is expected for the end of January.
    Unladen Swallow is a Google sponsored project which aims to speed up the current cpython implementation, by implementing a jit with llvm, amongst other modifications. Their goal is to speed up current applications used by google in a relatively short time (they don't want to mantain a python implementation forever, this is an incremental improvement of cpython), and they concentrate in web applications that use c extensions.
    Psyco, which is an extension module which speeds up python by a large margin and has been around for some years, has been revamped to version 2 and shows significant improvements as well.
    We can also mention Ironpython, the implementation of python in .NET which opened the door to IronRuby.
    And there are many other minor efforts and one-guy projects that may give us surprises in the near future. For example CrossTwine linker (for python and ruby), Hotpython ( a new virtual machine built from the ground up to be fast), etc, etc...

    As for javascript, those who thought it would be a dead language by now were plainly wrong. Google's V8 is a success and runs code at holy crap speed. Safari's Nitro followed suite.

  • What happened to Cardinal? The project that was aiming to have Ruby compile to Parrot bytecode and promised full Ruby Perl 6 interoperability?
    • by chromatic ( 9471 )

      Cardinal still exists; it could use a couple of people concentrating on it.

      • Re: (Score:1, Interesting)

        by Anonymous Coward

        Let's translate that for everyone who doesn't speak the same language of bullshit that the Parroters all speak:

        "Cardinal is a dead project. You can find old, shitty code for it, but don't expect it to compile or do anything useful. Even a illiterate Republican from Arkansas could make a helpful contribution to this project."

        • Re: (Score:2, Informative)

          by chromatic ( 9471 )

          Let's translate that....

          The dominant meaning of "translate" used by native English speakers generally implies some non-zero amount of veracity.

          Cardinal [github.com] hasn't had much activity in the last couple of months because there have been only a couple of people working on it lately, and one of them started a new job at the end of September.

          Even so, it exists, it passes tests, and it can interoperate in the same Parrot process with Perl 6 and Perl 5 code. (I suspect it can work with other Parrot-hosted languages

I have hardly ever known a mathematician who was capable of reasoning. -- Plato

Working...