Ruby 1.9.0 Released
sciurus0 writes "The 1.9.0 development version of the Ruby programming language has been released. This version has many changes, including a new virtual machine that provides great speed improvements."
← Back to Stories (view on slashdot.org)
No comments yet (or at least not when I started typing this comment) and the second link is already /.ed.
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
Why does this look like an unedited blurp from the Firehose?
"Thanks for all the money you paid to us. We've used it to buy off ISO among other things" -Microsoft
Well, it seems that Ruby 1.9.0 is the fastest implementation available, it also is reflects the newest version of the language... but I would really like to see benchmarks based on real apps based on things like Mephisto,Radiant CMS and/or Mongrel. Also, does someone have a list with the most important features? The summary is way too poor.
Alright, I know this is going to be flame fodder, but I'm genuinely curious: does Ruby have anything to offer for someone who's already very proficient in Python (and Django, so Rails is already covered)? Basically, I've been using Python for quite a while and work with a largish codebase at the office. Is there any reason why I should give Ruby a try other than the standard - and very valid - "because it's there"? From what I've heard it seems that the two languages occupy roughly the same niche and are approximately as expressive.
Again, I know that sounds flamebait-like but I'm asking sincerely. My available time is pretty limited these days and don't have the luxury of branching out nearly so much as I used to.
Dewey, what part of this looks like authorities should be involved?
Back then Ruby's C interface appeared much easier to use than Python's reference-counting mess (I don't know about recent developments). Apart from that, both are good as far as scripting languages go.
So while it may have improved upon speed, the question still is whether it can scale without having to rely upon PHP and JAVA and PYTHON consistently to help it out in this regard.
You seem to be thinking of Rails, which is a framework for Ruby used for making web apps.
Ruby itself is quite nice for general development work.
Everything I need to know I learned by killing smart people and eating their brains.
That is entirely accurate. There are situations where your Python proficiency will be called upon to support Ruby, (DBF handling comes to mind).
But RUBY always seems to have to rely upon other languages to scale. The RUBY website uses PHP. The Rails website uses PHP.Seems every place that RUBY has to scale requires it to use another language and the RUBY maintainers have not tried to excuse this but the RUBY community has.
This is why most developer say that RUBY is still developing as a language as is good for small implementations that never ever intend to get bigger. But for those that want their applications to grow with them, they should implement in a language that can grow with them.
This is my sig. There are many like it but this one is mine.
Since you don't begin to define what you mean by scalability, I'll take that as FUD. However, scalability is one of the problems Ruby is trying to tackle. 1.9.0 marked the switch from green threads to os threads, but it' going to take awhile before extensions written in C are thread-safe. If you prefer the lightweight approach of green threads, take a look at fibers.
Is parallelization the only niche that isn't supported well? No. There are other areas languages generally do badly in. There are very few languages which handle internationalization efficiently. There are very few languages which handle graphical interfaces efficiently or logically. Languages are typically either good at handling very complicated data structures OR handling structures that are defined just-in-time, typically not both.
My interest in Ruby would be greatly increased if I saw it do something that very few other languages could do, preferably no language that was in mainstream use.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
You must be a troll or never used Ruby. In all languages today, Ruby, or Python, etc., performance is a problem with the developer, not the language. Also, languages are not by themselves slow, the virtual machines or interpreters are, so saying a language is slow is nonsensical.
This is my sig. There are many like it but this one is mine.
Ruby is not a web development language. It is a general scripting language, like Perl or Python. You still seem to conflate the language with the specific use case of Rails - dynamic website scripting.
I use it heavily as my general scripting language; where I would have used Perl for small utilities, file munging or what have you before, I now use Ruby. Not because Perl is bad - it isn't - but Ruby really is in many respects Perl done right, with many of the benefits and without the syntactic quirkiness. Scaling just isn't a factor for most uses of a script language.
Trust the Computer. The Computer is your friend.
The site with the benchmark has been "slashdotted" but should be back up soon. For the moment, if it's down, you can use this Italian translation which has English figures and charts: http://stacktrace.it/articoli/2007/12/ruby-contro-ruby/
It seems like far too many people think that Ruby is just for web stuff because of Rails. They don't realize that it's a really good general purpose scripting language.
I think my two favorite things about Ruby when compared to Perl (which, like you, I used to use for scripting) are:
1) I can actually *read* it because it doesn't look like I rolled my head around on the keyboard
2) It behaves in Windows the same way it does in Linux (with the obvious exception of having to change any hard-coded filenames you use). Perl had a few quirks in that regard. Heck, let's be honest - the Windows implementation was not what you'd call complete (or at least wasn't the last time I bothered to check).
Everything I need to know I learned by killing smart people and eating their brains.
Why do you keep capitalizing the names of languages and frameworks that aren't acronyms? It's Ruby, Rails, Python, and Java. Capital letter at the beginning, since they're proper nouns, then lower case the rest of the way. You're just making yourself look like you really don't know what you're talking about.
Guido tried Lisp and he didn't understood it.
Matz tried Lisp and he understood a little.
Matz wins.
Excuse me but http://www.ruby-lang.org/ runs on Radiant CMS, which is written in ruby, not on php.
--- I w00t, therefore I'm l33t.
Was this 1999? Perl's had first-class support on Windows since at least 5.6.0.
how to invest, a novice's guide
What inherit flaw in Ruby prevents it from scaling? Do keep in mind that performance and scalability are not the same thing.
The performance of the Ruby website has gotten much worse since they switched from PHP.
If you look at it from a features and libraries perspective, then you really won't find much different. But you shouldn't look at it that way.
There's a significant programming style difference between the Python and Ruby communities. Python programmers, as a general rule, tend to be more inclined toward imperative programming, while Ruby has much more of the feel of a multi-paradigm language. To understand a lot of Ruby code out there, you need to wrap your head around concepts like functional programming, metaprogramming, and domain-specific languages. Ruby code tends favor higher-order functional combinators over primitive looping syntax (an influence from functional programming), extending the system base classes extensively (an influence from Smalltalk), and a lot of it has the flavor of trying to extend the language to look more like the problem space itself (domain-specific languages; look at something like rake, for example).
Python aims to be "clean" in a very contentious sense of "clean." To put it in a way that will be taken very partisanly: Python is the language that you get when "clean and easy to understand" is taken to mean "only promotes the concepts that are easy to understand to a mediocre imperative programmer." For example, Guido is on the record that higher-order functions like reduce are supposedly hard to understand.
To be fair, yeah, Python is a reasonably clean imperative/OOP dynamic language, which is no mean feat, but many of us folks really would rather have a language that supports a broader range of programming paradigms. (Though I'm not as great of a fan of Ruby as I used to be before I got going on Scheme, I must say...)
Are you adequate?
As someone who has written a highly scalable website in Ruby (not Rails), I can attest that while Rails isn't inherently scalable, Ruby is very capable of being used in scalable apps.
I can't help but notice that there's nothing mentioned about unicode. I don't see how a major web development language, especially one made by Japanese designers, can go so long without adding comprehensive unicode support. After all, it's not like only English speaking people use rails websites...
Where to begin?
1. It doesn't even have a compiler. Sure, with enough boxes (if you're writing a server), it can go fast -- assuming your code can be parallelized. But this kind of stops you from being within a factor of 10 of compiled code. Matz famously said that it's a bad rip-off of Lisp, but "nicer to ordinary people". Most days, I really don't mind putting in some parens if it makes my code 10x faster.
2. It isn't well-defined. Virtually all of the high-performance, scalable language implementations available today have competing implementations, and I do not believe this to be a coincidence. I've never found a copy of the Ruby grammar, and from what I've heard, it doesn't really exist, except "what the ruby binary accepts" (am I supposed to read parse.y?). Not being well-defined means it's really hard for alternative implementations to appear. (I know about JRuby and Rubinius. Can you run any Ruby program on them out-of-the-box? I can compile any ANSI C or Fortran or Lisp code on any compiler that meets the spec.) How can anybody hope to fix any scalability problems in Ruby if the existing behavior is defined only by its current behavior? Have you *seen* a Ruby AST? Not pretty!
3. Scalability today means using the multiple cores that my processor has. Ruby provides no real means for doing this (e.g., native threads). Sure, you can launch multiple ruby processes, and chat between them with IPC, but look at the overhead of a ruby process: do you really want users to pay that 2 times, 4 times, 8 times?
If you want to go far enough back, then no, there's nothing "inherent" that means the Ruby language can't ever be scalable. (There's a project called "The Ruby Grammar Project" which aims to figure out and document the grammar, for example! It's "pre-alpha".) The point is that they've done kind of a lousy job with performance, specification, compilation, and so on up to this point. To expect scaling to become a priority any time in the near future (especially when seemingly large features like real Unicode support are soon to be added) seems foolishly optimistic.
Disclaimer: I make a living writing Ruby code. The above is intended to be friendly criticism, not a condemnation of Ruby. Most other languages are just as bad, if not in these ways, then in others. But I'd be lying if I said Ruby got an A+ in scaling today, or is even within shooting distance of it.
It's nice to see that Ruby interpreter speed is improving. Performance and compile time checking (think static types) are about the only areas in which I find Ruby lacking. Looking at the table on the shootout page, though, I find that performance has only improved by a factor 2. That's impressive...but it's not enough.
Last I measured, Ruby was about a factor 300 slower than C on low-level code (measuring the performance of high-level functionality implemented in the interpreter is not so interesting, because that isn't actually implemented in Ruby). That means there is still a long way to go before Ruby is actually competitive with the likes of Common Lisp, OCaml, Haskell, or Lua in terms of performance (I wouldn't compare to C or Fortran, because these languages are much more limited in what abstrations they offer).
Still, Ruby is a great language, and I hope they keep up the great work. I end up writing quite a lot of code in Ruby, because it's very _easy_. The language is mostly very well designed, which means you aren't likely to run into limitations of the language, and there is support (either shipped with the language, or available as a third-party module) for almost everything I want to do. Speed isn't usually an issue. And when it is, it's possible (and easy) to write an extension in C.
The one thing I wish they would get rid of is the distinction between blocks and lambdas.
Please correct me if I got my facts wrong.
1) Depends on what you're writing. big_array.collect {|x| x.expensive_file_io }.sort_by {|x| x.to_s } is going to be stuck in library code far more than interpreting Ruby.
2) Granted. Yet the Ruby community seems more cohesive than other languages. JRuby and Rubinius are intentionally staying close to Ruby. Of course, in JRuby, much of what you do wouldn't work without the J, so it's not back-portable, but technically would be.
3) See 1. A ruby process only wastes the time interpreting and garbage collecting that you design it to. IPC does take longer than inter-thread, but most server type projects I've written in Ruby are meant to scale across machines as well as CPUs, so they tend to synchronize via a DB or filesystem rather than directly anyways. Lack of native threads is a pain, but doesn't seem to actually impact performance if you design for processes vs threads.
I agree with your concerns re Ruby's spec itself. Lack of defined grammar, etc. But I don't think Ruby's performance problems are as serious as people say. Sure, any given component might have horrible problems, and might be too hackish to fix (Camping), but that's more a reflection of how easy it is to write a web framework (Camping, under 4k of code, intentionally) and how they aren't as well developed as a larger project would be.
Ruby's odd inconsistencies and little failures (eg. no real x.become y, even with evil.rb) often make me want to learn Smalltalk though.
Well, yes and no. One can meaningfully say that "Language Foo is harder for an implementation to optimise than language Bar". In practice "harder" will often been completely infeasible.
Here's some examples I've plucked out of the air:Having said all that, I'd far rather develop in Python, Tcl or Ruby than in C++, Java or C#, despite that fact that programs written in the latter languages are likely to run faster on most conceivable implementations.
IMHO, Clarity and expressiveness is far more important than performance for at least 95% of code written (and the other 5% can always be done in something from the C family if it's not an algorithmic performance problem).
Umm, you seem to be confusing performance with scalability here.
I'd say that a program based on processes communicating via IPC is far far more scalable that a program based on threads sharing memory.
The processes + IPC program can be distributed across several machines; the threaded program cannot. The fact that the threaded application is slightly faster is irrelevant since it cannot scale beyond a certain point.
It's easy to forget that hardware costs very little compared to developers' time.
Disclaimer: I make a large part of my living writing server-side Tcl code (which is about on a par with Ruby performance-wise I believe).
Something I always wonder when folks say that Ruby isn't competitive with, e.g., C with respect to speed is what the context for the competition is. In my professional career I worked on precisely one application which was capable of pegging a modern processor. The bottleneck is almost never the CPU these days -- in fact, rarely enough is it ANYTHING technological! Disk space, memory, bandwidth, CPU time, I/O on the bus, all of the things which I learned how to optimize at engineering school are available in huge quantities for unbelievable prices. The bottlenecks that I find myself worrying about these days are a) insufficient number of hours in the day (it seems stuck at 24 and Moore's Law isn't helping -- bugfix, plz) and insufficient customers using my systems to cause resource issues.
I run one web application which is essentially an advertising brochure for software that I created. The software is in Java (which I suppose is slow in the abstract, but none of my users can tell the difference) and the website is Ruby on Rails. ($10k in income in 2007, 10k uniques in the average month, to get a rough idea of scale.) Is Ruby on Rails a slow/poor scaling/resource hogging framework? Maybe. My $20 a month VPS account hosts my application fast enough to take 20k page views in an hour. The economic value per pageview for that site is about 5 cents. Please, God, send me resource issues! Make me regret my choice of a productive but slow framework, as the spigot gets up to $1k an hour and then just resists improvement until I go to the $40 a month server!
Your mileage may vary, if your business model involves sending nation-state scales of traffic at sites and picking for pennies in advertising. If it does, could I humbly suggest spending half as much time worrying about the business model as you do about your technology choices?
Help poke pirates in the eyepatch, arr.
Being one of the guys doing the german translation of ruby-lang.org: this is incorrect.
The ruby site uses Radiant, which is a CMS based on Rails.
Both Ruby and Rails are production ready and is ready for large implementations (as you can see on... for example... mtv.com ? ) The "scalability discussion" is a leftover from twitter.com whining that their traffic shot through the roof and them hoping that their framework would fix that (instead of buying new hardware).
Lisp = The Church of All Worlds?
(rot13) rpbzbab@tznvy.pbz
I'm sorely disappointed. I thought the Christmas release was supposed to be the stable Ruby 2.0. Anybody heard any projection for when the stable Ruby 2.0 is supposed to be released?
1. Performance and scalability are different things.
2. Performance and scalability are different things.
3. Performance and scalability are different things.
You've made some nice arguments as to why Ruby is slow, but I'm not sure anyone has ever claimed Ruby is fast. On the scalability front, however, it does just fine.
I see a few Perlisms in the syntax, but mostly I see Lispisms (and Smalltalkisms) in the semantics.
I'm reminded of the Alan Kay line: "Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS." Maybe Ruby isn't *quite* as distressing as MS-DOS because it actually is a decent object-oriented system (quite similar to Smalltalk, Alan Kay's baby).
But it is kind of sad that every new language is evaluated primarily on its syntax, and that programmers (being people, who are emotional) see either "it looks like something I already know, so there's no point" or "it looks weird, so I won't use it".
Matz chose to dress his object-oriented language in Perl clothing, which was perhaps a brilliant way for Smalltalk ideas to actually get used, but the price for that was that many people would take one look, assume it's similar to Perl, and brush it off.
Can we get past "OMG curly braces" and start actually discussing ideas instead of the characters used to write them?
If you want to learn Common Lisp in "mind expansion" mode, you should try Norvig's Paradigms of Artificial Intelligence: Case Studies in Common Lisp.
It's a big, fat book, and will take a long time to work through it, but it'll show you a bunch of different techniques and tackle a number of problems you won't see in a Python or C book.
I've written a few IO-bound applications. C doesn't select(2) measurably faster or slower than Ruby or Perl or Python.
how to invest, a novice's guide
Now I'm no fancy-pants city programmer, but I do believe that the sole (or "reference and 90% of all implementations use it," in this case) interpreter being slow kinda counts as the language being slow, or near as makes no difference. As for trolling, well, you did seem to be deliberately misinterpreting a pretty clear statement, for purposes of raining on this fellow's parade.
Ummm... No...
If you would bother to read, the Ruby language website runs on Radian CMS, a Rails based CMS. The Ruby on Rails website uses instiki, another Ruby on Rails based application that was also developed by DHH.
Rather that spreading FUD, put some facts behind your statements. Because I know many large scale sites that I have worked on or helped, that use rails, and we have moved past scaling issues.
Maybe in theory. For instance, there is only one implementation of Perl, there's no formal specification of the Perl language (the language is defined by its standard implementation), and there's absolute 0% hope of someone being ever able to do another bug-a-bug compatible interpreter. The same applies to Ruby, I think.
Then, most dynamic languages are forcing the implementors to keep type information at run-time, to do garbage collecting, etc. All that comes at a price. It's simply impossible to get it as fast as a static language like C or Fortran, even if you were to design special hardware for it (like Lisp machines).
I hear you. I've been looking in the opposite direction for awhile now.
... but I haven't found a reason, as of yet.
... but the Ruby community is great and growing.
... I've very much in love with it.
I've been using Ruby for a few years and I've been looking for excuses to learn Python. I've gone so far as to buy some books, in case I find the time to go through them
They certainly do seem to occupy the same niche, so there may not be very good reasons for learning one if you know the other. If anything, I might learn Python because it appears to be more popular for *nix programming
Either way, I can't see myself leaving Ruby as my language of choice for awhile to come
Never said it was written in PHP. Said they USE PHP in order to scale and that is their official response.
This is my sig. There are many like it but this one is mine.
Yes, I can. And when I do, I find that contrary to your claims, neither the Ruby language site (which is www.ruby-lang.org, not www.ruby.com) nor 43things.com is running PHP. Rubyonrails.(org/com) is. www.ruby.com doesn't show PHP on Netcraft either, but isn't really relevant to the Ruby programming language in the first place.
Where? Here's DHH's explanation for Rubyonrails.org's use of PHP (from the rubyonrails.org blog:
Strangely, no mention of using PHP for "scaling", which you claim is the motivation and the explanation that "they" give. So, out of the three Ruby-related sites you claim say they are using PHP for scaling that somehow prove that Ruby can't scale, one isn't the site you seem to think it is, 2 aren't (whether you check the site you give the address for or the actual site you seem to think that address refers to) using PHP based on the source you claim confirms that they are, and the one that is using PHP doesn't explain that use with the explanation you say they give.
It would be hard for you to be more wrong about this.
I provided plenty. You Only want to see what you want to. If they shut off php.ini, and you don't wish to do your own legwork outside of this tiny little forum, then you don't truly wish to know now do you. You only wish to argue. To that I say feel free to remain ignorant. I have given you the key to free your mind... it is up to you to remain caged or not.
This is my sig. There are many like it but this one is mine.
Scalability is a general problem, and one that Ruby's development is seeking to address. But its FUD to say its a particular problem with Ruby without some actual measures or other evidence of particular scaling problems that are actually connected to Ruby. Usually, if people are pressed on these kind of accusations, they point back to the twitter thing which:
1) At the outset was suggested to be a problem with the Rails framework, not Ruby,
2) Twitter developers eventually stated wasn't really a particular problem with either Rails or Ruby.
To a certain extent, though mitigating that seems to be the focus of some effort. JRuby is, as I understand, mostly compatible with some important caveats, and there are other alternative Ruby implementations that are more-or-less compatible. One of the big pushes with 1.9.0 seems to be working toward a clear delineation of what features are necessary to generalized Ruby and what are specific, less-portable features of the principal implementation, with a particular eye to what is practically implementable in, e.g., JVM and CLR (and maybe Parrot) based implementations.
Lisp machines were abandoned, IIRC, because they had become slower than Lisp implementations on more conventional hardware of the day, because most of the investment was going into development of conventional processors. But, yeah, while mature dynamic languages (like many Lisps), from what I've heard, can be very fast, there is some inevitable overhead. So if speed given fixed hardware constraints is an overwhelming issue, C may be the only choice. In most real world situations the constraint is money, so if a dynamic language for all or part of a system reduces development and/or maintenance costs, you can afford to throw more hardware at it to address performance issues, provided the implementation can make effective use of the hardware.
A highly dynamic, introspective language, like ruby, is by its nature going to be a slower language. And Ruby is one of the most dynamic, and one of the slowest. Python is also dynamic, and is also slow for it. These languages are NEVER going to be fast. Whereas Java's dynamic/introspective languages features are so limited they have no practical performance penalty.
Who's the troll here?
Is Ruby similar to Python? My public library has a really good Ruby programming manual. i am hoping this is an easy language to learn