Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Ruby Implementation Shootout

ScuttleMonkey posted more than 7 years ago | from the always-with-the-shooting dept.

Programming 112

An anonymous reader writes "Ruby has an ever growing number of alternative implementations, and many of these attempt to improve the suboptimal performance of the current mainstream interpreter. Antonio Cangiano has an interesting article in which he benchmarks a few of the most popular Ruby implementations, including Yarv (the heart of Ruby 2.0), JRuby, Ruby.NET, Rubinius and Cardinal (Ruby on Parrot). Numerical evidence is provided rather than shear opinions. The tests show that Yarv is the fastest implementation and that it offers a promising future when it comes to the speed of the next Ruby version."

cancel ×

112 comments

Sorry! There are no comments related to the filter you selected.

so... ruby? (0, Flamebait)

TinBromide (921574) | more than 7 years ago | (#18069444)

Can they update the article to give a brief blurb on what ruby is? Or is it something that has become so commonplace in the past 2 weeks that i'm a doof for not knowing?

Cause i read this and immediately thought of the chick who premiered with ati's r9x00 series video cards.

Re:so... ruby? (-1, Flamebait)

Anonymous Coward | more than 7 years ago | (#18069512)

In the time it took you to type that post and wait for a reply, you could have read what Ruby is. And yes, you are a doof for not knowing, it's been relatively popular for years now.

Re:so... ruby? (1, Insightful)

Anonymous Coward | more than 7 years ago | (#18071384)

Don't be such a pure functional twit. A little 'state'-ment at the top of the page about how Ruby is an OO scripting language/interpreter of the curly-brace variety hailing from Japan would be nice. You may find state offensive, but it can save time.

Re:so... ruby? (1, Informative)

Anonymous Coward | more than 7 years ago | (#18069536)

Check out http://www.ruby-lang.org/ [ruby-lang.org]

Re:so... ruby? (1)

brunokummel (664267) | more than 7 years ago | (#18069632)

Can they update the article to give a brief blurb on what ruby is? Or is it something that has become so commonplace in the past 2 weeks that i'm a doof for not knowing?

hmmm...Could it be the object-oriented programming language Ruby?
Ruby [wikipedia.org]

Re:so... ruby? (4, Informative)

spellraiser (764337) | more than 7 years ago | (#18069640)

I was on the same boat until a couple of weeks ago ... anyway, Ruby is The Hottest Thing Since Sliced Bread (TM). It's a programming language that was created in Japan all the way back in 1995. However, it has only just recently garnered mainstream interest due to the emergence of a web application framework built on Ruby, which is called Ruby on Rails and is said to be an incredibly well-thought and efficient framework.

More on Ruby here [wikipedia.org] .

And more on Ruby on Rails here [wikipedia.org] .

I personally have an enormous interest in Ruby on Rails, as it seems to be a very neat way of writing web applications, but I'm also a bit daunted; it's a new language and a whole new framework with different ways of doing things, so it's been slow going learning it. I just wish I knew where to get some extensive sample code to peruse - that's how I learn best. All I've seen are some very basic applications which don't really teach you the real tricks and show how it all comes together.

Re:so... ruby? (5, Informative)

XorNand (517466) | more than 7 years ago | (#18069964)

Yes, Ruby is the current web development flavor of the month, however, don't get caught up in the hype. There are good number of MVC web development frameworks in other languages, including even Lisp and Smalltalk, but most notably Python. In my opinion it makes more sense to learn a Python framework for a number of reasons. Mainly because Python is used in considerably more non-web applications than Ruby, which makes your skills more portable (and you more employable). Ruby on Rails is also very monolythic, while two of the the three most popular Python frameworks, TurboGears [turbogears.org] and Pylons [pylonshq.com] are very modular (especially Pylons since it's built around the WSGI [wsgi.org] spec). Finally, Python compiles to bytecode whereas Ruby does not. Hence Python outperforms Ruby in almost every shootout [debian.org] .

Further reading:
Of snakes and rubies; Or why I chose Python over Ruby [infogami.com]
TurboGears and Pylons (a technical comparison) [ianbicking.org]
From PHP to Python [rightbrainnetworks.com] (my blog)

Re:so... ruby? (2, Informative)

daeg (828071) | more than 7 years ago | (#18070586)

If you're going to mention Web Python Frameworks, don't forget Django [djangoproject.com] . Honestly they are all really good choices (Pylons, TG, Django, etc). I know you mention it in your "why py?" post, well, assuming it's the same post I read a few months back. :)

Re:so... ruby? (0)

Anonymous Coward | more than 7 years ago | (#18070816)

Yes, Ruby is the current web development flavor of the month, however, don't get caught up in the hype.

Also keep in mind, wherever there's hype, there's also the predictable anti-hype.

Python is just as much a "flavor" as Ruby.

Some thoughts from a person with almost two decades of experience: most apps consist of well-designed data models (documented precisely in a DBMS) combined with well-designed UI's. The framework you use to tie them together is basically inconsequential glue. When I get hired to clean up some novice programmer's "flavor of the month" code, the first thing I do is clean up those two items, and use whatever brand of glue the client is comfortable with, or has the best performance, or whatever. I don't care about languages any more. They are subsets of Lisp or SmallTalk anyway.

Re:so... ruby? (4, Insightful)

Stamen (745223) | more than 7 years ago | (#18070980)

Minor note, Ruby on Rails is the web development flavor of the month, not ruby. There are a lot of interesting things happening in plain ole ruby, plus there are other web frameworks than Ruby on Rails, such as Nitro, Camping, etc.

I find it amusing someone would say learn Python because it's used more. Python may be older, but it's still sitting in the programming language high chair right next to Ruby. People say the same thing about Python; "if you want a job learn Java, c#, c++"; and you know what they're right, if you want a job learn Java, period.

I like both Ruby and Python, and I think a programmer would do well to learn one or both. They aren't as popular yet, like Java or c#, but I think they will be. And if you understand the concepts in one, you'll understand the other. Like Gretzky said, "I skate where the puck is going to be, not where it is"; good advice.

I prefer Ruby, but that is just a preference.

Re:so... ruby? (1)

prockcore (543967) | more than 7 years ago | (#18072394)

I prefer Ruby, but that is just a preference.


Same here. I love Ruby, and I love the fact that there aren't any primitive types at all, everything is an object. You can do weird stuff like: a="Hello".downcase.reverse.capitalize That's just cool.

Re:so... ruby? (1, Interesting)

Anonymous Coward | more than 7 years ago | (#18074816)

Oh, you mean something like in Python:

>>> "hello".lower()[::-1].capitalize()
'Olleh'

Code tend to be read more then written. (1)

krischik (781389) | more than 7 years ago | (#18079966)

But I understood the Ruby one right away. "reverse" is just easier to understand then "[::-1]". And don't waste your time explaining it, or to tell me how elegant or nifty "[::-1]" is - I understood "reverse" right away and that is what counts.

Martin

Re:so... ruby? (1)

maxume (22995) | more than 7 years ago | (#18075226)

Until someone else, or even a later version of yourself tries to figure it out(not that this comment really applies to your example, but if.some.magic.thingamajig, well, there ya go).

Re:so... ruby? (3, Funny)

ralphdaugherty (225648) | more than 7 years ago | (#18075456)

from the summary:
Numerical evidence is provided rather than shear opinions.

      Do those opinions come from sheeple?

Strings as objects (3, Interesting)

RallyDriver (49641) | more than 7 years ago | (#18076070)

Well, you can also do it in Java .....



String a = "Hello".toLowerCase().toUpperCase();

.... but I'm not sure it makes a huge difference in real software development. I do however like it as the safe test for an exact match without worrying about null ....



if ("FOO".equals(a)) { ....

Re:Strings as objects (1)

prockcore (543967) | more than 7 years ago | (#18077278)

I do however like it as the safe test for an exact match without worrying about null ....


That's neat, I didn't know java could do that. But your example demonstrates another thing about Ruby I really like, if a function returns a bool, convention is the function should have a questionmark at the end.

if a.empty? then ...

It's very readable, and you know it's testing against empty and not setting it to empty.

Also if a function modifies the object in-place, then convention has it end with a !. So a.capitalize will return a copy of the string, and a.capitalize! will modify a.

Re:so... ruby? (1)

nbehary (140745) | more than 7 years ago | (#18072942)

"Python may be older, but it's still sitting in the programming language high chair right next to Ruby. People say the same thing about Python; "if you want a job learn Java, c#, c++"; and you know what they're right, if you want a job learn Java, period."

Was going to make a comment about the first public releases of Python and Ruby being in 1991 and 1995, respectively, thus making both as old or older than Java. So, guess I just did. Anyway, think you were getting at the people who tout Java, C# etc cause they are popular, not necessarily newer. I agree with that.

Re:so... ruby? (1)

Paulrothrock (685079) | more than 7 years ago | (#18081432)

Yes, but the expressive nature of Ruby is incredibly addictive. I've used both Python and Ruby, and I'd prefer Ruby any day because the syntax matches my thought processes more than Python. Also, I'm not quibbling over invisible things like newlines and tabs.

These things are qualitative rather than quantitative, and I might get used to Python as I work with it over the year, since it's my next Language of the Year.

Re:so... ruby? (1, Insightful)

Anonymous Coward | more than 7 years ago | (#18070096)

Ruby on Rails and is said to be an incredibly well-thought and efficient framework.

Well thought of is debatable as RoR is an "opinionated software": if you don't like the way DHH (the framework's creator) works you're going down fast.

Efficient, no damn way, Rails itself is not really fast and it's implemented on top of a very slow language (Ruby), unless you're talking about programmer time Rails is not efficient at all, and in the programmer-time-efficiency land it has a lot of competition (e.g. Django in Python-lang).

Other than that, Ruby's a nice language, takes many features from Smalltalk and makes them easier to use, I think it could be a nice stepping stone:

  • from a statically typed language (Java) to the land of dynamically typed fully OO languages
  • From anywhere to Smalltalk, as smalltalk would be fairly alien to anyone using "mainstream" languages (including but not limited to C, C++, Java, C#, Python, Visual Basic, PHP, ...)

Example Code (1)

The Raven (30575) | more than 7 years ago | (#18074084)

Hmm... maybe you just overlooked it, but if you want to learn Ruby, then read the source code for Rails. There's a ton of it, and it's relatively well written and easy to follow, with good commenting. It makes heavy use of Ruby-isms like polymorphic code. It's huge, and it works.

If you want to learn Rails, well... that's a bit harder. I recommend the Rails Cookbook... lots of good practical code in there. I don't know of a big, open source, Rails website that you can examine though. Haven't looked.

One Criticism of Ruby, But a Major One (1)

nikster (462799) | more than 7 years ago | (#18078790)

IDE Support.

I love Ruby. I did a RoR project, learning Ruby and RoR at the same time, got the whole thing up and working in 3 odd weeks. I was impressed with the elegance of the Ruby API and even more so with the supreme elegance of the Ruby on Rails API - it's awesome. It's what's Java with its mess of backwards compatible and not-well-thought-out and clunky APIs can only dream of. [Note: I am a professional Java dev]. Things that should only take a line of code, do. Unlike Java where they take 2 classes, a thread and one listener.

The main problem is that there is no proper IDE for it. By which I mean, something on par with the java development tools in Eclipse or IntelliJ for Java. Sure there's some stuff out there that does mild syntax highlighting, things like that - beefed up text editors.

But if I have a project consisting of 50 CVS modules and tens of thousands of classes, I don't want to be either hand-editing all of them or doing a text-grep search or alternately perhaps better not rename a method at all. I am used to refactoring and call tree hierarchy views, I use them every day and multiple times a day. Refactoring has made a significant contribution to improving code quality. If I don't like something, I change it - the IDE takes care of finding all affected files and making all the changes.

There are also numerous other benefits which mean I don't have to define variables in Java (IDE does it), don't have to look up API docs (popups with that appear, with all possible methods etc), and most importantly whenever I make a tiny change somewhere in some file the live compiler tells me if that breaks anything else. Huge time savings. Without this it would easily take 5 times as long and some things would be just impractical to do.

Ruby proponents easily get defensive and proclaim that Ruby's so good that all you need is a text editor. Sadly, that's absolutely not true and these people have never used refactoring. Or written large pieces of software. If you have done both and still think it's not needed please explain to me how you deal with the complexity: How do I rename a method, then?

Re:One Criticism of Ruby, But a Major One (0)

Anonymous Coward | more than 7 years ago | (#18080088)

Um, Radrails is a dedicated Ruby IDE that is based on Eclipse... you can get standalone or Eclipse plugin.

Re:so... ruby? (1)

pkulak (815640) | more than 7 years ago | (#18069692)

If there is anything that doesn't have to be defined on /., it's Ruby.

Re:so... ruby? (4, Informative)

Phrogz (43803) | more than 7 years ago | (#18069820)

Ruby is a dynamically typed, strongly typed, runtime-interpretted, very object-oriented programming language. It was created about the same time as Python (10+ years ago?), but is less well-known in the United States as it originated in Japan. It is the langauge that the Ruby on Rails [rubyonrails.com] web framework is based on. See the official Ruby website [ruby-lang.org] for more information.

Re:so... ruby? (0, Flamebait)

Anonymous Coward | more than 7 years ago | (#18070284)

Ruby is a dynamically hyped, strongly hyped, runtime-addled, somewhat object-oriented programming language. It is discussed by infinitely more people than have a clue as to how to use it and will continue to be implemented by those who like to feel superior by using something only marginally accepted.

"Shear" opinions (1, Funny)

Anonymous Coward | more than 7 years ago | (#18072180)

from TFA:
Numerical evidence is provided rather than shear opinions.

Would that be what the author thinks about scissors? For the semi-literate that should be "sheer opinion," not "shear opinions."

Read the disclaimer... (2, Insightful)

tcdk (173945) | more than 7 years ago | (#18069542)

This being /. I don't expect anybody to actually read the acticel, but before you begin your rant^H^H^H^H ... post about how these tests are useless etc. etc. please, at least read the article disclaimer:

Don't read too much into this and don't draw any final conclusions. Each of these exciting projects have their own reason for being, as well as different pros and cons, which are not considered in this post. They each have a different level of stability and completeness. Furthermore, some of them haven't been optimized for speed yet. Take this post for what it is: an interesting experiment;
Now fell free to begin your rant about it being a slow news day...

Re:Read the disclaimer... (1)

fatphil (181876) | more than 7 years ago | (#18071328)

Unfortunately the guy performing this experiment doesn't know about how to benchmark, in particular how to aggregate results into a mean result.

In the first table, he uses an arithmetic mean, which is invalid as it unfairly weights slow benchmarks. This has the effect of making the windows version look bad, as against the equivalent linux implementation, the longest benchmark is nearly 30s slower on the windows box, so I was almost tempted to not mention it, and let windows look bad. The correct mean to use is the geometric mean. This weights all benchmarks equally.

To see this, an extreme example would be:
Benchmark A - implementation X=0.05s, implementation Y=0.02s
Benchmark B - implementation X=0.10s implementation Y=0.05s
Benchmark C - implementation X=100s implementation T=102s
Arithmetic Mean: X=33.38s Y=34.02s
Geometric Mean: X=0.794s Y=0.467s

He comes closer to that in his second table, where he started taking ratios; but alas he dropped the baton when he started introducing negative numbers to imply 'slower'. Ratios of positive times are never negative, he was simply looking for ratios less than 1. So his "mean" is in fact mean(ing)less.

Re:Read the disclaimer... (1)

fossa (212602) | more than 7 years ago | (#18071354)

Also note that "average and Median values take in consideration only working tests (they exclude âToo longâ(TM) programs as well)", so the averages for Cardinal and Rubinious with many errors are of dubious utility.

really? (-1, Troll)

Anonymous Coward | more than 7 years ago | (#18069606)

Only fags use Ruby

Cardinal interesting (3, Interesting)

mattr (78516) | more than 7 years ago | (#18069652)

Though not familiar with the project, I'm impressed that the project with by far the most errors (Cardinal), indicating I assume that the least work has been done on it, is still so close to YARV - only 2-4 times slower in a couple tests.

I can't tell if those fast tests are so trivial that they offer little chance of further speedup, or whether YARV, which has had speed as a goal, is not going to be so much faster than a Parrot-based implementation once it (Cardinal) gets into working on optimization.

Anyone interested in providing some information on where the YARV performance comes from and whether Cardinal is likely to approach it more closely and farther across the board in the tests?

Re:Cardinal interesting (2, Insightful)

archen (447353) | more than 7 years ago | (#18069938)

Personally what annoys me more is that this is giving me no benchmark against how ruby in general is performing. Maybe something is twice as fast, but twice as fast as what? Slow as hell? My understanding is that ruby has always lagged a bit in the performance sector, although maybe that has improved over the last 2 years. I'd be more interested to see additional benchmarks against equivalent programs in Perl5 which is sort of the interpreter execution standard, or maybe something in C.

Re:Cardinal interesting (1)

Azarael (896715) | more than 7 years ago | (#18070238)

That probably wouldn't be too difficult to do using the computer language shootout http://shootout.alioth.debian.org/ [debian.org]
You have to figure out the equivalent tasks(Mandelbrot seems to be be one) and then flip between the two benchmark pages.

Re:Cardinal interesting (0)

Anonymous Coward | more than 7 years ago | (#18070260)

Personally what annoys me more is that this is giving me no benchmark against how ruby in general is performing.

Of course not, there's the Alioth shootout for that... (nb: the current Ruby 1.8 is slow as molasses)

Re:Cardinal interesting (1)

Phrogz (43803) | more than 7 years ago | (#18070498)

"Though not familiar with the project, I'm impressed that the project with by far the most errors (Cardinal), indicating I assume that the least work has been done on it, is still so close to YARV - only 2-4 times slower in a couple tests."
  1. It's easy to run fast when you only account for a very limited subset of functionality. I'd be shocked (am shocked) if preliminary results of something like this *weren't* much faster than the original. I'd take it as a sign that it's not worth it to continue (at least, not if your only purpose for Cardinal was speed).
  2. 2-4 times slower is not "so close" in my opinion. 1.5x as long is maybe close.
  3. It's only a very few tests that it's even that close. Ignoring all the numerous error tests, and assuming that the 'too long' tests actually would have completed a millisecond after they were killed, the factors between the YARV and Cardinal results are: 2.2x, 418.2x, 4.7x, 1751.0x, 20.1x, 40.2x, 2420.0x, 2.9x, 1.6x, 6.1x, 3.3x, 3.7x, 94.9x. That's an average factor of 366.8x, or median factor of 6.1x. Even if you throw out the three that are over 100x slower (assuming that they are crazy outliers), That's an average of 18.0x, or median of 4.2x.

I can't tell if this is an indication of how adept the human mind is at seeing patterns where there are none (or seeing what it wants to see), or if it's an indication of how adept it is at throwing out a bunch of random points and 'feeling' the median score.

Re:Cardinal interesting (2, Informative)

chromatic (9471) | more than 7 years ago | (#18071464)

Note that Parrot has had little optimization too.

No, that's not interesting. (1)

Estanislao Martnez (203477) | more than 7 years ago | (#18073154)

Though not familiar with the project, I'm impressed that the project with by far the most errors (Cardinal), indicating I assume that the least work has been done on it, is still so close to YARV - only 2-4 times slower in a couple tests.

If your program doesn't have to return the right answer, it's very easy to make it go really fast.

cool (1)

jrwr00 (1035020) | more than 7 years ago | (#18069666)

they need to post the specs of the computer they where using tho, i could post numbers, but i would be running it on a p1 150mhz!

Re:cool (0)

Anonymous Coward | more than 7 years ago | (#18069724)

Quoting from the article:

My tests were conducted on an AMD Athlon(TM) 64 3500+ processor, with 1 GB of RAM.


This is a fair spec, and a decent processor.

Re:cool (1)

h4ter (717700) | more than 7 years ago | (#18072620)

My tests were conducted on an AMD Athlon(TM) 64 3500+ processor, with 1 GB of RAM.

It's right there under the large "Benchmark Environment" heading.

So even with YARV, Ruby is still... (0)

Anonymous Coward | more than 7 years ago | (#18069742)

v e r y _ s l o w ? [debian.org]

A shear opinion... (1, Funny)

Ancient_Hacker (751168) | more than 7 years ago | (#18069802)

A shear opinion is like, a comment about Britney's latest screwup.

Try "sheer".

Re:A shear opinion... (1, Funny)

Anonymous Coward | more than 7 years ago | (#18071020)

When my shears talk, shrubbery trembles!

An y'all don' wan' nunna my rake-fu!

Java not slow enough for you? Try Ruby! (3, Insightful)

Jagasian (129329) | more than 7 years ago | (#18069870)

Performance isn't everything, but then again, when you are 400 times slower than Java [debian.org] ... performance starts to matter.

Re:Java not slow enough for you? Try Ruby! (2, Insightful)

arevos (659374) | more than 7 years ago | (#18070540)

Performance isn't everything, but then again, when you are 400 times slower than Java... performance starts to matter.
Sure, if you're interested in generating mandelbrot fractals or the spectral norm of a matrix. However, Ruby typically isn't used for such computationally intensive tasks.

Re:Java not slow enough for you? Try Ruby! (1, Informative)

Anonymous Coward | more than 7 years ago | (#18070948)

No, but it IS one of the slowest of the "dynamic" languages. Tcl, Perl and Python are all faster, have better threading and i18n support.

Re:Java not slow enough for you? Try Ruby! (3, Insightful)

Rufty (37223) | more than 7 years ago | (#18073904)

Yep, I agree. Ruby's slow. Probably slower than the rest at just about everything.
Except speed of code development.
So for my one-off scripts that run for 45s in ruby instead of 0.1s in perl, well
what's mattered to me is that it took 5 mins to write, rather than the 90mins +
a brain tumor that perl does*

* I last used perl at about 4.036, tried to get into "objects" with perl 5, and
jumped to ruby for the sake of my sanity.

Re:Java not slow enough for you? Try Ruby! (0)

Anonymous Coward | more than 7 years ago | (#18070784)

Why do you believe Java is slow? It's comparable to most compiled languages, and I'm not aware of any non-compiled languages that are faster than it.

Re:Java not slow enough for you? Try Ruby! (0)

Anonymous Coward | more than 7 years ago | (#18070972)

Why do you believe Java is slow? It's comparable to most compiled languages, and I'm not aware of any non-compiled languages that are faster than it.

Except Java is a compiled language. Ruby is an interpreted language.

The fact that Java manages to keep up with interpreted languages isn't really anything to brag about.

Java definitely isn't faster than other compiled languages, though. Compare any Java-based program with a native C++ implementation and the difference is like night and day: the C++ implementation will smoke it.

The reason people think Java is slow is because they've experienced it, and discovered that it is, in fact, slow.

Re:Java not slow enough for you? Try Ruby! (1)

Doctor Memory (6336) | more than 7 years ago | (#18071114)

He didn't say that Java was slow. He said that Ruby was slower than Java. Since Java isn't 400 times faster than most other contemporary languages, that makes Ruby slower than most other languages out there. It doesn't affect Java's position vis-a-vis performance comparisons.

Re:Java not slow enough for you? Try Ruby! (2, Insightful)

TopSpin (753) | more than 7 years ago | (#18071500)

Performance isn't everything, but then again, when you are 400 times slower than Java..

400 times slower? Still too efficient. Consider a Ruby implementation on the JVM and multiply inefficiencies! Should be thousands of times slower for those same benchmarks.

About JRuby; Sun recently hired [slashdot.org] two (both?) of the JRuby developers and progress has accelerated [codehaus.org] . The promise is a highly capable Ruby implementation running on a JVM. This, coupled with very recent changes to the JVM [artima.com] to facilitate scripting languages could lead to an interesting future. Sun is also leveraging the JVM for other language projects such as Fortress [sunsource.net] .

Apparently Sun isn't content to let Microsoft's CLR become the de facto standard bytecode runtime platform. I don't know whether it's possible to make Ruby performance on the JVM competitive with native implementations, but I am hoping.

Re:Java not slow enough for you? Try Ruby! (1)

Decaff (42676) | more than 7 years ago | (#18073212)

Consider a Ruby implementation on the JVM and multiply inefficiencies! Should be thousands of times slower for those same benchmarks.

There is no justification for this statement. One of the aims of JRuby is to compile to JVM byte code, which can then be translated to highly optimised machine code.

Apparently Sun isn't content to let Microsoft's CLR become the de facto standard bytecode runtime platform.

Do you realise how many instances of the JVM there are right now? Not just on servers, but on mobile devices and phones? There is not the slighest chance of the CLR becoming the de-facto anything.

Re:Java not slow enough for you? Try Ruby! (0)

Anonymous Coward | more than 7 years ago | (#18080746)

Apparently Sun isn't content to let Microsoft's CLR become the de facto standard bytecode runtime platform.

Here's your pot, smoke it. You need it.

Dude... In the real-world, such as the banking world, stuff like a bullet-proof VM running on bullet-proof OSes has made Sun's JVM a standard that shall still be there in decades. Those security concerns have ruled anything named 'Microsoft' out of the picture. The server-side in the real-world is all Java-backed, wheter you like it or not. And this is very good, for it means JRuby may have a chance in the real-world.

Re:Java not slow enough for you? Try Ruby! (1)

cout (4249) | more than 7 years ago | (#18081372)

We have been using Ruby in a production environment for the last seven years at a company that trades a significant portion of Nasdaq and NYSE-listed securities. We have been using C++ for the performance-critical portions of the system and Ruby for the portions of the system that we want to get out the door more quickly. I won't lie: we've run into more than once case where the Ruby interpreter just wasn't fast enough. However, had we done the initial pass in C++, it could have taken days or weeks longer to develop.

This really is where the power of dynamic languages like Ruby and Python lies -- rapid development followed by benchmarking followed by optimizing the portions of the code that aren't fast enough. We tried doing the same with Java, but the language interoperability wasn't there, nor was the rapid development (at the time JRuby and similar projects were much less mature than it is today).

I should also mention that I was skeptical of this model at first, and in fact it didn't work at first. Ruby has a small learning curve, but there are aspects of our particular application that made integration of Ruby into the system more than a little challenging. Now that we have the framework in place, though, I really like the results and don't want to imagine the system working any other way (with respect to what I've discussed here).

Any YARV experts (2, Insightful)

Timesprout (579035) | more than 7 years ago | (#18069948)

Can anyone comment on why the YARV implementation is so much faster than the standard implementation? I know for example the SUN VM was originally only intended as a reference VM and faster implementations were developed but not on the scale of the differences highlighted here.

Re:Any YARV experts (3, Informative)

Balinares (316703) | more than 7 years ago | (#18070298)

Short answer: various things, compilation to bytecode before execution (I thought it was the case in the current interpreter, but might have been mistaken), etc.

Slightly less short answer: if I'm not mistaken, YARV includes a JIT compiler, similar to what Psyco [sourceforge.net] does in the Python world. Psyco has been known to accelerate code execution up to 100x times, so I'd expect YARV to be even faster than this benchmark shows when it's stabilized.

Re:Any YARV experts (4, Insightful)

mo (2873) | more than 7 years ago | (#18070576)

The standard 1.8.X Ruby interpreter is a single-pass interpreter, and YARV is a virtual machine implementation. You can expect big improvements when moving to a VM implementation from an interpeter. The reason Java has never had such big improvements is that it's always been based on a VM.

This rule isn't exactly hard and fast, as verying implementations of VMs and interpreters can have different performance characteristics. For example, while perl is still probably considered an interpreted language, it's quite fast due to the interpreter using many compiler tricks such as parse tree optimizations. The ruby interpreter however has been notoriously slow, which is why ruby people are so excited about it.

Re:Any YARV experts (1)

MemoryDragon (544441) | more than 7 years ago | (#18079614)

Java had this jump twice, once when the vm went from purely interpretet to jit compilers, the second one was when the vm went from jit compilers to runtime optimization + jit.

Ruby ? Shootout? Don't take your love to town. (0)

Anonymous Coward | more than 7 years ago | (#18070452)

Anyone else immediately think of this old Kenny Rogers recording [cowboylyrics.com] when they read this thread's title?

unicode? (2, Interesting)

bcrowell (177657) | more than 7 years ago | (#18070536)

What's up these days with ruby and unicode? Of these implementations, do some do it one way and some another?

Ruby and Unicode (2, Interesting)

metamatic (202216) | more than 7 years ago | (#18071098)

What's up is that there's massive disagreement on whether Ruby's standard strings and characters should become Unicode. There are quite a few people used to the old world where a string was interchangeable with a vector of 8 bit bytes, and they don't want to let go [archivesat.com] . To add to the problems, Unicode is controversial in Japan [jbrowse.com] . So, expect Unicode to continue to be painful and inconsistent in Ruby even after the next major release.

Re:Ruby and Unicode (1)

tuffy (10202) | more than 7 years ago | (#18072054)

Why don't they implement a Unicode string which can be encoded to a classic string via UTF-8 or some other desired encoding. Then add an decode() method to regular 8-bits-per-character strings to reverse the process. This eliminates ambiguity between "a binary blob of random data" (regular strings) and "human-readable text in some language" (Unicode strings). Python's used this method for years without a problem, so Ruby should be able to follow suit.

AAAAARGH!! (1)

Balinares (316703) | more than 7 years ago | (#18074746)

> There are quite a few people used to the old world where a string was interchangeable with a
> vector of 8 bit bytes

No. No, no, no. NO. Please, no. Seriously. This is bad. A LOT of damage happens because people can't be bothered to spend the 10 minutes it takes to learn the basics of Unicode. It's easy. I don't always think very highly of what Joel Spolsky writes, but his introduction to Unicode [joelonsoftware.com] is an ABSOLUTE must-read.

Seriously. Strings are NOT interchangeable with byte arrays. EVER. Without an encoding information, a byte array can represent a wild number of different strings. Without an encoding information, you can't even tell where the string that the byte array represents ends! This is one of my pet peeves, really -- pretending that byte arrays and strings are equivalent is on the same level of professionalism as pretending that the data won't ever be larger than your buffer. Ignoring issues that bother you don't make them go away.

Want unicode? Try tcl (1)

198348726583297634 (14535) | more than 7 years ago | (#18072496)

There's but one language you'll find with rigorous support of unicode to make it a non-thought, and that's tcl. Add to unicode the excellent wiki [wiki.tcl.tk] , a grammar completely defined in eleven rules [www.tcl.tk] , and a versatile cross-platform GUI toolkit [wiki.tcl.tk] , and you've got a language that can't be beat for a great many situations.

Suggest you to start with this page [wiki.tcl.tk] to get a glimpse of what Tcl is all about!

Re:Want i18n? Try .NET (1)

Thundersnatch (671481) | more than 7 years ago | (#18078046)

Say what you will about Micrsoft, but they do it better than just about anyone else as far as internationalization goes on the .NET platform. They go beyond pervasive support for Unicode: the framework has built in support for all standard ISO cultures, and can automatically translate and format dates, numbers, currencies, etc. on the fly with almost zero extra code.

Of course you have to manually translate text strings into resource files for each language, but once you do that, programmatically switching between languages extraordinarily simple. You can easily read the language preference from a vistor's browser and display the code in the correct language, in about 5 lines. All of the .NET standard library automatically checks the Thread.CurrentCulture object and displays the appropriate unicode text, date, and number formats, so you don't have to do those language checks everywhere yourself.

Re:Want i18n? Try .NET (0)

Anonymous Coward | more than 7 years ago | (#18080114)

Say what you will about Microsoft, but Apple did this in Mac OS X about 5 years before .net existed, and even now Microsoft Office's support for Unicode is rubbish (even on Mac OS X).

Microsoft is about the only company in the world with the arrogance to override a built-in system language/font API that works with a proprietary one that doesn't, but then this is the same company that is trying to replace ISO standard dates with their own version that marks 1900 as a leap year when it wasn't:

http://www.charcoaldesign.co.uk/weblog/10 [charcoaldesign.co.uk]

shear opinions? (0)

Anonymous Coward | more than 7 years ago | (#18070682)

Yeah, I was watching my Rails app the other day and when the load spiked around 2pm, the whole ActionPack just sheared right off. I tried to re-attach it, but the bolts were all gone. Cheap Japanese plastic. I duct-taped it back in, but I gotta tell you, if it's one thing Ruby needs, it's more shear strength.

Feature comparison? (1)

kahei (466208) | more than 7 years ago | (#18070842)


I don't think anyone decides to use Ruby based on performance, really. I'd be a lot more interested to hear whether any new features (notably, proper Unicode strings and native threads) are included in any of these implementations -- I really can't use Ruby without at least the former. I would have thought the Java and .NET implementations would be able to do these without too much trouble -- I'm well aware of the difficulty of working around the issues in the original C implementation but they are all just that, implementation issues.

I'd also be interested in standardization -- currently IIRC Ruby is specified as 'whatever Matz's implementation is observed to do, that's Ruby'.

Re:Feature comparison? (0)

Anonymous Coward | more than 7 years ago | (#18071554)

Ruby is so sloooooow that speed is a determining factor in most decisions.

Ruby is GAY (-1)

Anonymous Coward | more than 7 years ago | (#18070952)

especially ruby on rails

One thing's for sure (0)

Anonymous Coward | more than 7 years ago | (#18071030)

Parrot's not a contender - it cannot even run 90% of the tests. And the ones it CAN run are 20 times slower. What problem is Parrot supposed to solve, again?

Good news on Yarv speed improvements (1)

MarkWatson (189759) | more than 7 years ago | (#18071132)

I would use Ruby more if the runtime performance were better. For speed and dynamic language niceness I use Franz Common Lisp for most of the work for my current customer (AI medical applicaion) and I still find myself using Java a lot for serverside deployment goodness :-)

I would have prefered Ruby, BTW, because it is easy to train people in Ruby development while Common Lisp is a harder learning curve.

Once Yarv is very stable (maybe it is already?), then I will use Ruby for a larger percent of my new projects.

Re:Good news on Yarv speed improvements (1)

MarkWatson (189759) | more than 7 years ago | (#18071392)

I just built the Ruby 2.0 svn trunk under OS X (as per directions on the web, I used an application suffice of -yarv to not interfere wih my production Ruby build).

My irb-yarv will not work (for me), but I have tried running ruby-yarv against the examples for my in-progress "Ruby AI" book and did not see any problems.

Yarv will be cool! Especially when it supports Rails.

c'mon - it's hyped about as much as Java was (0, Flamebait)

oldwarrior (463580) | more than 7 years ago | (#18071182)

when it was cool. And java was waaay too slow for anything useful for quite a long time. Now it's the Cobol for a New Millenium tm (ugh). I personally wish every java bag of bytecodes, jar, JVM, and xml file would fuse into hydrogen ions and become background radiation. Ruby (or something like it) will be a better place to spend time once the hype settles and the implementations sizzle.

Re:c'mon - it's hyped about as much as Java was (0)

Anonymous Coward | more than 7 years ago | (#18076046)

hahaha. That's funny. Mod up as funny!

Ruby's Windows support (1)

trimbo (127919) | more than 7 years ago | (#18071324)

This study backs up what everyone who has tried Ruby on Windows already knows... it stinks! I'm actually not surprised to see that some of their tests errored out completely on Windows, even with the Ruby 1.8.5 binary.

Granted, Ruby is mostly used with Rails right now, but you'd think that if the language proponents want the language to take off, Windows support would be taken more seriously. In the couple years since I first tried Ruby, it doesn't seem like it has improved much at all.

Re:Ruby's Windows support (1)

Stamen (745223) | more than 7 years ago | (#18071882)

I think this is just because of the age of the language, as the same was true for Perl and others when they were young.

Most servers are going to be running a *nix, and the primary domain of scripting languages is the command line and the server. If someone is running Windows as a web-server, they most likely will be using .net, because frankly, why else would you be using Windows as a web-server? (Serious question)

As Ruby matures, so will things like performance and secondary OS support. JRuby and Ruby.net will solve this problem too.

Currently, I find, a lot of developers of Ruby and Ruby on Rails run under Linux or OS X. Many of the questions on the Ruby forums from Windows users are things like "Why does it run in DOS", "Can you make apps like I can in VB, what is Ruby good for?". I don't know but I'm guessing those people are going to give up on Ruby, and probably would never consider Perl or Python either.

Re:Ruby's Windows support (1, Insightful)

Anonymous Coward | more than 7 years ago | (#18072264)

I think this is just because of the age of the language, as the same was true for Perl and others when they were young.
Ruby has been around for 12 years. It's only 7 years younger than Perl, and just 4 years younger than Python.

Perl, for one, acquired decent Windows support in the late 1990s... at a time when it was younger than Ruby is today.

Re:Ruby's Windows support (2, Insightful)

shmlco (594907) | more than 7 years ago | (#18073100)

"As Ruby matures, so will things like performance and secondary OS support."

And when will that happen, exactly? I've been hearing about R/RoR for years now, and it's still distinctly in the low-performance category. Yet every time I go visit the site for updates all I see is talk about how they're adding feature X and Y in the next point release.

These guys need to stop dinking with the language, freeze it, and work on fixing bugs and increasing performance so people out here in the real world can actually use it.

Unfortunately, like most OSS projects it seems that it's cooler to add the feature-of-the-day, rather than do the actual work needed to make it a stable and solid development platform...

Re:Ruby's Windows support (2, Interesting)

zallus (714582) | more than 7 years ago | (#18074080)

make it a stable and solid development platform...
Whoever said that was their primary, or even secondary goal? I use ruby as a prototyping language before rewriting in C. I only use it because it's so easy to work with all the "features of the day" in it.

Re:Ruby's Windows support (2, Insightful)

chromatic (9471) | more than 7 years ago | (#18073358)

I think this is just because of the age of the language, as the same was true for Perl and others when they were young.

Ruby's almost 14 years old! By 2001, Perl had fantastic Windows support.

Now people may deploy Ruby or Perl or Python or PHP applications to Unix and Unix-like servers, but I know plenty of people who develop on Windows. Some of them even have a choice.

Re:Ruby's Windows support (2, Informative)

Stamen (745223) | more than 7 years ago | (#18074244)

12 years old (December 21st, 1995) but who's counting a few years.

First off, the parent of my post said that the Windows port wasn't as fast as Linux and should be supported and worked on more. Ruby supports Windows just fine thank you.

Second, Ruby has had an interesting history. It was basically unknown in the west until Dave Thomas and Andy Hunt wrote the first book in English in 2000. At that time, the language started to take off, and only in the last few years has development really ramped up. So technically it is 12 years old, but in reality it is a very new language.

Unless you have Microsoft (.net) or Sun (Java) putting a huge amount of resources into development, languages take a long time to fully bake. This is normal, expected, and desired.

Choose to use Windows for development... heh, you almost had me there, nicely done.

Re:Ruby's Windows support (1)

chromatic (9471) | more than 7 years ago | (#18075362)

12 years old (December 21st, 1995) but who's counting a few years.

Matz, I suspect, who started in February 1993, if I recall correctly.

It was basically unknown in the west until Dave Thomas and Andy Hunt wrote the first book in English in 2000. At that time, the language started to take off, and only in the last few years has development really ramped up. So technically it is 12 years old, but in reality it is a very new language.

Immature, maybe, but it's about the same age as Java.

Re:Ruby's Windows support (1)

daviddennis (10926) | more than 7 years ago | (#18072960)

Ruby and Ruby on Rails seem to appeal largely to Mac users. The Mac-only textmate text editor is extremely well integrated with Ruby and Rails, and I believe almost all the principal developers of Rails work on Macs. Apple includes Ruby in their standard OS distribution.

I think the "it just works" philosophy of the Mac has a lot in common with the similar philosophy of Ruby and Rails. So if you are attracted to Rails you are likely to be attracted to Apple products and vice versa.

Since Ruby adoption is largely driven by Ruby on Rails, i strongly suspect this Mac bias for the client side of computing is a major reason Ruby for Windows is not highly developed.

(Note: I'm a Mac user and amazing.com was developed (and is being developed) using Ruby on Rails).

D

Re:Ruby's Windows support (1)

shmlco (594907) | more than 7 years ago | (#18073602)

"...and amazing.com was developed (and is being developed) using Ruby on Rails"

Gack! Somebody needs to hire a graphic designer quick. That site is NOT a promising endorsement for RoR...

Re:Ruby's Windows support (1)

daviddennis (10926) | more than 7 years ago | (#18074180)

Alas, as you probably know, most developers are not artists. I'm a developer at heart who's trying to keep control over the site, and avoid spending money I don't have by designing it myself.

The big problem I have, though, is that most sites I see created by designers seem to follow the same rather boring mold. Every site developed in the last year or two looks just like every other site developed in the last year or two.

I'd appreciate knowing what it is that creates such a negative reaction to what I've produced. It's an effort to be unique and stand out from the crowd. Are there ways you would suggest to improve it without making it bland?

I'd appreciate your ideas and feedback. You can send it to my email, david@amazing.com if you'd like. Please be sure to use a subject like Ruby or Slashdot so I catch it from all the spam i get.

Many thanks in advance.

D

Design (1)

shmlco (594907) | more than 7 years ago | (#18077242)

Why do half the links on the bottom go to pages with no format? Why do About us and Safety Tips use different layouts, widths, line widths, etc. Why the 1980's-style colored text on a patterened background on the home page? Why is the page style/font/color scheme different from the logo scheme, which is different from the sign-up block, which is different from the sign-up button.

You have three choices: 1) hire a designer; 2) get a template; 3) find a designer.

You've already indicated you don't want to do number 1. Fine. There are thousands of page templates available for $50 or so. Go through those and find somethng that works for you. Standing out is all well and good, as long as you're not standing out by looking amateur, home-built, and unprofessional. That's not so good.

Third, find an art school nearby and see if you can work out a trade with someone. A design for some of your time, or a design for their portfolio, or just a design that's cheap ($100?).

You're trying to get people to sign-up and give you their name, email, and personal information (. You can NOT afford to look untrustworthy. Good luck.

When your server is Linux... (1)

SanityInAnarchy (655584) | more than 7 years ago | (#18073480)

...why do you care about Windows support?

And if your server is Windows, I'd say you're on your own. If, for some perverse reason, you want it to work well, the code is there, but why should we help you?

Re:When your server is Linux... (1)

trimbo (127919) | more than 7 years ago | (#18076466)

...why do you care about Windows support?

I do not want to deploy Linux on my home machines, but a couple of my sites are hosted on Linux with Rails. It would be nice to be able to work locally with the same apache-mysql-ruby config, even though I don't want to install Linux at home. Ruby also would have probably made more inroads into my Windows-centric workplace if it had better support, but instead I went with ASP.NET after failing to get Rails on Windows to work effectively on Windows with Apache and MySQL.

If, for some perverse reason, you want it to work well, the code is there, but why should we help you?

You don't have to, just don't be surprised while we continue to choose Python. I was pointing out that there seem to be no strong advocates for this language on the world's most popular OS. Python would not be in the place it is on Windows without the early persistence of one man in the mid- to late-90s (Mark Hammond). Now there's a Python implementation on Windows supported by Microsoft (IronPython). No one seems to have stepped up that plate for Ruby, which it will need if it is to be taken seriously outside of the Rails on Mac and Linux domain.

Re:When your server is Linux... (1)

Stamen (745223) | more than 7 years ago | (#18076798)

60,000 downloads of Ruby for Windows last month on RubyForge says someone is getting it to work on Windows. What does that mean "work effectively"?

I highly doubt a Window-centric Corporation would retrained all thier developers, and switch to an open source laungauge that isn't supported by Microsoft only if it had "better support". I call shanigans. Ruby is making inroads in PHP, Perl, and Python shops; I woudln't hold my breath for Windows shops. I have many clients like this, they rarely even know about anything that isn't made by Microsoft, much less consider it.

World's most popular OS, perhaps you are limiting that to desktops?

Oh, and I'm sure Microsoft going to port .net to Linux and OS X any day now.

Re:When your server is Linux... (1)

SanityInAnarchy (655584) | more than 7 years ago | (#18077146)

I do not want to deploy Linux on my home machines, but a couple of my sites are hosted on Linux with Rails. It would be nice to be able to work locally with the same apache-mysql-ruby config, even though I don't want to install Linux at home.

You could mess with it on the server, which was my point. What makes your local Windows machine more convenient?

I could make this into a big deal about you refusing to roll out Windows at home, but I imagine this is closer to a minor inconvenience than a major stumbling block.

Ruby also would have probably made more inroads into my Windows-centric workplace if it had better support, but instead I went with ASP.NET after failing to get Rails on Windows to work effectively on Windows with Apache and MySQL.

Again, why are you installing Ruby, Apache and MySQL on Windows, for a server? What is it that Windows makes easier?

The only place I've had problems here is a workplace that's running off of a single Windows server running ASP.NET for a couple of apps. If I remember, ASP is well supported on Linux, and ASP.NET is starting to get some support with Mono.

But I can make the same complaint to Microsoft as you do to Rails -- after going to all the trouble to make a nice bytecode engine, why don't they provide and support a Linux version? Or at least work with the Mono developers to make it easier...

You don't have to, just don't be surprised while we continue to choose Python.

Oh, go right ahead. I actually don't like any of the scripting languages out there -- not that I have anything better (yet) -- so it doesn't matter much to me. I'm just saying that when you ask for things from the OSS community, understand what you're really asking for.

Personally, I couldn't give a damn if scripting languages are well supported on Windows. As far as I'm concerned, that's one of the big attractions of Linux -- so many nice languages supported, often out of the box. Doesn't mean I mind good Python support on Windows, I just won't lift a finger to make it happen until I have a reason to.

Re:When your server is Linux... (1)

An Onerous Coward (222037) | more than 7 years ago | (#18077978)

I'm curious why you felt compelled to set up Rails with Apache on your home systems. I've always found the pre-installed WebBrick server better for home development.

Why not use C (3, Funny)

zymano (581466) | more than 7 years ago | (#18071732)

C and cgi.

Re:Why not use C (1)

DamnStupidElf (649844) | more than 7 years ago | (#18073354)

C and cgi.

Amen. With critical functions (XML parser, for instance) rewritten in assembly for speed.

Re:Why not use C (2, Insightful)

FrnkMit (302934) | more than 7 years ago | (#18073462)

I worked briefly at a shop that used C and C++ for CGI. They were still struggling with memory errors in their in-house string libraries.

But really, Ruby's for more than just Web stuff. (As is Python and the rest.)

Re:Why not use C (1)

quigonn (80360) | more than 7 years ago | (#18078990)

I worked briefly at a shop that used C and C++ for CGI. They were still struggling with memory errors in their in-house string libraries.

And they deserve it. Everyone who uses C++ but not the std::string class it comes with does so.

Re:Why not use C (0)

Anonymous Coward | more than 7 years ago | (#18077878)

Good taste.

Because C is a system programming language. (1)

krischik (781389) | more than 7 years ago | (#18080096)

Often overlooked: C is a system programming language and not an application programming language. C was designed to write the Unix operating system and quite honestly it is not good for anything else.

Yes you can use C for all sorts of other programming needs (if you have a masochistic tendence) - all programming needs in fact as C is turing complete - but it isn't any good at it.

Martin

Note: I have learned C in 1990, updated my C knowledge regularly, own a copy of the C99 ISO standard and I have quite a lot of experience in C programming.

See all the implmentations (0)

Anonymous Coward | more than 7 years ago | (#18071900)

(Flame suit on)

With all the different flavors, is this where Java is heading now that it's F/OSS licensed? It would be an interesting review a year from now to see how Java turns out--the same as Ruby's state or different (since there's a standard already in place and the JCP).

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>