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!

The State of Ruby VMs — Ruby Renaissance

Soulskill posted more than 3 years ago | from the take-your-pick dept.

Programming 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."

cancel ×

89 comments

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

Yawn. (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30193860)

Web 2.0 is still gay.

Re:Yawn. (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30193962)

And Ruby is still horribly fucking slow. We unfortunately have some Ruby on Rails apps where I work, and have always had performance problems, even under relatively minimal load.

We've tried some of these alternate VMs, without much success. Some of them wouldn't even compile on Debian. The ones we did manage to get working actually ran our apps slower than the normal Ruby interpreter.

Right now we're considering porting these applications to Java, since even that offers better performance than Ruby. And I don't mean using JRuby, either. That'd just be the worst of both worlds.

Re:Yawn. (1, Insightful)

hey! (33014) | more than 3 years ago | (#30194284)

Web 2.0 is still gay.

To quote Mel Brooks' *The Producers*:

If at the end you want them to cheer
Keep it gay, keep it gay, keep it gay!

Ruby Javascript (2, Insightful)

Djupblue (780563) | more than 3 years ago | (#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:Ruby Javascript (2, Informative)

korney (1469497) | more than 3 years ago | (#30193976)

That's unlikely to happen. RJS with Rails is a nice alternative though.

Re:Ruby Javascript (0)

Anonymous Coward | more than 3 years ago | (#30194048)

While I love ruby, I really don't get you. Javascript is awesome just the way it is. Nor do I have any desire for it to replace html as well. Web development gets so repetitive after a while, no wonder diversity is a breath of fresh air.

Re:Ruby Javascript (0, Flamebait)

Mystra_x64 (1108487) | more than 3 years ago | (#30194142)

Javascript is awesome just the way it is

That's rather amusing way to say it sucks.

Re:Ruby Javascript (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30194172)

The people who say stupid shit like "Ruby is awesome" and "JavaScript is awesome" are the same sort of stupid fuckers who say stuff like "PHP is awesome".

First off, JavaScript is pure shit in every way possible. It's a mid-1990s hack that has been taken way, way, way too far. It's the client-side mistake that's equivalent the the server-side PHP abomination. JavaScript and PHP are both mountains of steaming, worm-infested cow feces.

Ruby is basically dumbed-down Perl. It retains the shitty syntax, but removes the powerful semantics and flexibility that are Perl's only redeeming qualities.

Clearly, Python and Clojure are the way to go these days. Even C# and VB.NET are more respectable languages that JavaScript, Ruby and PHP, and that's pretty fucking sad.

Re:Ruby Javascript (4, Interesting)

caseih (160668) | more than 3 years ago | (#30194622)

Truly spoken like someone who doesn't know appear to know anything about Javascript, and has never programmed anything significant in it. Or Ruby either for that matter. If you do, you should have backed up your comments with real evidence and experience rather than just a few silly expletives.

How does Ruby retain Perl's syntax but not the semantics? Sounds like you're making this up. Have you ever coded anything significant in Ruby? I don't care for Ruby's syntax either (the ability to call functions with () means you can pass functions around as parameters), but that doesn't make Ruby any less powerful as a full OOP, dynamic language.

As for Javascript, try using it for something significant sometime. Write a firefox plugin or something. Javascript is here to stay and is the mainstay of client-end user interface code. Javascript is an extremely powerful and dynamic language, akin to smalltalk in it's power and flexibility. Javascript uses a prototype-based style of OOP that takes some getting used to but is very powerful indeed. Even better Javascript has functional and lisp-like qualities to it. Javascript has its warts. Some of them are apparent if you've ever used Gnome Seed with GTK binding, from what I've read.

Despite all this I'd rather use python in the browser to script DOM objects, but ahh well. I'm also bitter that epiphany dropped Python in favor of Javascript for writing Epiphany plugins. Sigh.

Re:Ruby Javascript (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30194704)

Faggot, I've had the misfortune of using both JavaScript and Ruby (for web development and scripting) more than you likely ever have, and ever will.

Have you looked at the syntax of Perl and Ruby? The vast similarities should be pretty clear to everyone but the stupidest of mental retards. Look at some Perl code, then look at some Ruby code, and if you honestly can't see the similarity for yourself, then fuck off.

You'll need to use both Ruby and Perl to experience Ruby's weak semantics compared to Perl. Stuff that can be done in literally a fraction of a line of code in Perl can take several lines of Ruby code. That's not a huge difference for a 5 or 10 line scripts, but once you're developing applications with 500,000 lines of code or more, it makes a huge difference.

As for JavaScript, I wrote three custom Firefox plugins for one company. It's unbelievable how fucking stupid the combination of JavaScript and XUL is. It makes development tedious, and debugging it is a huge pain in the ass. Even developing Win16 apps in pure C was more enjoyable, and that's a pretty fucking miserable experience.

Re:Ruby Javascript (1, Insightful)

obarthelemy (160321) | more than 3 years ago | (#30194794)

Something in your tone tells me you're not the open-minded type. Maybe you just failed to get into the language, expecting it instead to fit your own mindset+knowledge ?

Re:Ruby Javascript (1)

caseih (160668) | more than 3 years ago | (#30194968)

It's good to know your programming skills are orders of magnitude higher than your articulation skills. If you had mentioned these things in the first place, but dropped the childish language, you're post would likely be moderated a +5 insightful.

Re:Ruby Javascript (-1, Flamebait)

Anonymous Coward | more than 3 years ago | (#30195652)

One can't properly articulate the disgust one feels when discussing Ruby and JavaScript without resorting to profanities.

Re:Ruby Javascript (1)

MightyMartian (840721) | more than 3 years ago | (#30196292)

Amen! Javascript sucks. It's one of the key pillars of "Why Web Browsers Are The Worst Development Platform Ever".

Re:Ruby Javascript (0, Troll)

linuxgeek64 (1246964) | more than 3 years ago | (#30195854)

You're a hypocrite. "You're" articulation skills are horrible if you can't even tell the difference between you're and your.

Re:Ruby Javascript (0)

Anonymous Coward | more than 3 years ago | (#30197446)

Given that they got it right the first time, and that otherwise the post was well spoken and polite, I think their point stands.

One typo doesn't make someone a drooling idiot.

Re:Ruby Javascript (1)

caseih (160668) | more than 4 years ago | (#30205566)

Spell checker is useless I tell you. But read again... I wasn't commenting on his grammar. Nothing like a good flame war!

Re:Ruby Javascript (0)

Anonymous Coward | more than 3 years ago | (#30196266)

Your probably right, but if you're post gets modded to +5, I'd be surprised. Some mods believe its there responsibility to mod down posts in which their are abuses of the English language.

Re:Ruby Javascript (1)

caseih (160668) | more than 4 years ago | (#30205520)

The problem is not that you abused the english language (though this does reduce your persuasiveness), but rather that you made an inflammatory (assertion based on emotion) statement with _nothing_ to back it up originally. Your grammar and childish language did not cause you to be modded down alone. It was your substance, or lack thereof, that got the mod. Mods do have agendas and are sometimes grammar nazis. But by and large, if you speak persuasively and logically you'll be modded up. If you're perceived to be calling someone names or making personal attacks (like "I know more about Javascript than you'll ever know"), that is not persuasive, informative, or insightful. You obviously feel deeply about the issue of Javascript and Ruby, and have responded to my posts twice, so I can tell you really do want to communicate your experience and knowledge. So this is just free, unsolicited, advice.

Also, I suppose that posting an inflammatory statement as AC also contributes a lot to a negative mod.

Anyway, enough karma burned for now.

Re:Ruby Javascript (4, Interesting)

Serious Callers Only (1022605) | more than 3 years ago | (#30196232)

Faggot, I've had the misfortune of using both JavaScript and Ruby (for web development and scripting) more than you likely ever have, and ever will.

Or perhaps you're just some internet blowhard [penny-arcade.com] who likes to play to the peanut gallery? As you demonstrate very little in the way of knowledge in your posts, we'll never know. Your silly pronouncements of superiority in spite of very little knowledge of your interlocutor certainly make this a distinct possibility.

Have you looked at the syntax of Perl and Ruby? The vast similarities should be pretty clear to everyone but the stupidest of mental retards...then fuck off. You'll need to use both Ruby and Perl to experience Ruby's weak semantics compared to Perl.

You claimed that Ruby kept most of the syntax of Perl, but not the 'semantics' whatever that means in this context. Care to explain what you think it means, because you haven't so far?

I've used both, and there are similarities, but there are also many significant differences. The object system in Ruby is far less a tacked on afterthought, you don't have to declare variables with a prefix so there is less line noise, everything is an object, nicer blocks, etc. There is also quite a tradition of choosing the way which seems least surprising and sticking to it, as opposed to 'There is more than one way to do it' in Perl - that means radically different library classes.

The syntax of Ruby encourages legibility but keeps most of the shortcuts (in regexp for example) of Perl, while avoiding the horrific write-once possibilities of Perl which you seem to be so proud of (i.e. stuff can be done in fraction of a line of code); just because it can be done in half a line doesn't mean it should.

There is a spectrum from code which is far too verbose to code which is far too succinct (i.e. unintelligible even to the creator after a certain period), and I'd say Perl can be pushed too far to the succinct side, but that's personal preference really. It's quite possible to write good Perl code, but that doesn't make it the be all and end all of scripting languages, indeed several other languages are now more suitable for scripting if you prefer an object-oriented approach.

While I must agree with the sentiment that people who cheerlead for a certain language as radically different from all others need an education in the history and diversity of computer languages, to claim that Ruby is a bad copy of Perl without qualifying the statement betrays your lack of knowledge of the language, nothing more.

Re:Ruby Javascript (1)

Aighearach (97333) | more than 3 years ago | (#30197116)

Look up "object semantics" and quit being meanypants.

Indeed, the "semantics" is a lot of what makes it great. And the Ducks.

Re:Ruby Javascript (-1, Troll)

Anonymous Coward | more than 4 years ago | (#30197898)

Sadly, I'm just a programmer who has had to deal with far too much JavaScript and Ruby bullshit.

Unlike many people, including yourself, I came to JavaScript after years of programming with much better languages. I don't live in ignorance, and I know there is much better out there. I'm also not afraid to call out shitty languages like Java and Ruby.

That all said, I didn't bother to read more than the first sentence of your post. I know that you're just a college student, and thus I consider your opinion to be worth about as much as the shit the programmer from India left in our office's urinal during his training session.

Re:Ruby Javascript (1)

Serious Callers Only (1022605) | more than 4 years ago | (#30200216)

Unlike many people, including yourself, I came to JavaScript after years of programming with much better languages.

Heh heh. It would have made a more interesting troll if you had stated your preferred languages and the reasons for their superiority rather than hiding behind vague comparisons to 'much better languages', and explain *why* you feel Javascript/Ruby/EvilLanguageX are so impoverished, and what is better about other languages. There are plenty of things to criticise in all of them.

The fact you think Perl, which has many faults of its own, and still hasn't fully integrated oo, among other things, is clearly a greater language, does strike me as at odds with your swagger as a language expert. I don't claim to be an expert but have used all the languages you discuss, and your analysis, such as it was, was simplistic, one-sided, and seeded with juvenile put-downs. Not a very good troll.

You clearly make *far* too many assumptions predicated on a misplaced sense of superiority.

That all said, I didn't bother to read more than the first sentence of your post. I know that you're just a college student, and thus

QED.

Re:Ruby Javascript (1)

goose-incarnated (1145029) | more than 4 years ago | (#30200492)

Unlike many people, including yourself, I came to JavaScript after years of programming with much better languages.

Me too, however I still don't see it as "shitty"

Re:Ruby Javascript (1)

chromatic (9471) | more than 4 years ago | (#30198090)

You claimed that Ruby kept most of the syntax of Perl, but not the 'semantics' whatever that means in this context.

You gave a great example yourself:

[In Ruby,] you don't have to declare variables with a prefix....

That tiny syntactic change -- which you describe as line noise -- moves variable scoping out of the realm of heuristics you have to guess about because they depend highly on containing context. You can still make a mess of lexical scoping in Perl, but at least you have syntactic hints about what people expect to happen as well as a compiler which can tell you if you've gone wrong.

Re:Ruby Javascript (1)

Serious Callers Only (1022605) | more than 4 years ago | (#30200244)

Thanks for the cogent response.

That tiny syntactic change -- which you describe as line noise -- moves variable scoping out of the realm of heuristics you have to guess about because they depend highly on containing context.

I agree that's one use for it, but I'd prefer to strictly use objects to scope variables which need controlled, and get rid of all the $. Much like the ; at the end of the line, it's not necessary (IMHO) and just means more typing. I haven't run into many problems scoping variables in Ruby, whereas in Javascript the var is obligatory because of the strange scoping rules, and the odd rules still trip me up. So I'd say it depends on the rules of the language whether scoping will become an issue.

Re:Ruby Javascript (1)

chromatic (9471) | more than 4 years ago | (#30205216)

I'd prefer to strictly use objects to scope variables which need controlled....

That includes loop iterators (yes, I know these are rare in Ruby with pervasive blocks) and block-local variables not declared as incoming parameters. I'm curious to see idiomatic Ruby code written using only instance variables where a more straightforward approach would use lexicals. (Don't forget that if you have a method_missing on the object, you have more work to do to catch variable typos.)

I remember multiple debates over scoping changes between Ruby 1.8 and Ruby 1.9. That debate wouldn't have happened if scoping were more explicit.

Sigils are a different story. In Perl, they exist for two reasons: to provide additional namespaces to disambiguate builtin and user-defined symbols and to provide compile-time context hints. The latter doesn't apply to Ruby.

Re:Ruby Javascript (1)

flabordec (984984) | more than 4 years ago | (#30208030)

Have you looked at the syntax of Perl and Ruby? The vast similarities should be pretty clear to everyone but the stupidest of mental retards. Look at some Perl code, then look at some Ruby code, and if you honestly can't see the similarity for yourself, then fuck off.

For example, they both use letters AND numbers. The similarities are endless!!!

Re:Ruby Javascript (1, Flamebait)

FlyingGuy (989135) | more than 3 years ago | (#30197258)

There is nothing wrong with Python that a block closure character wouldn't cure; but sadly the fucking IDIOTS who decided that a fucking INDENT aka a TAB is proper for a block closure more then deserve the scorn that has been heaped upon them and if I ran the Epiphany project I would have done the same but I am sure they did what they did for a myriad of other reasons.

When the language gets a block closure character I will actually look it it's utility, until then it goes on the scrap pile.

Re:Ruby Javascript (-1, Flamebait)

Anonymous Coward | more than 3 years ago | (#30197338)

Oh, stop whining. It has a clearly defined block start (line ending in :, next line further indented), and a clear block stop (a line less indented than ther previous). Since you've obviously got a self-image the size of alaska, consider it a way to force the lesser idiots whose code you'll have to read into writing decently formatted code.

Re:Ruby Javascript (0)

Anonymous Coward | more than 3 years ago | (#30194662)

So would you say Python is awesome? LOL

Re:Ruby Javascript (1)

Yvan256 (722131) | more than 3 years ago | (#30194824)

He sure is! Have you ever watched Quest for the Holy Grail?

Re:Ruby Javascript (0)

Anonymous Coward | more than 3 years ago | (#30195282)

You have no idea what you're talking about. 'nuff said

Re:Ruby Javascript (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30195486)

Take your significant whitespace piece of crap toylanguage and get the fuck out of here. If you still believe significant whitespace was a brilliant idea look at the steaming pile of number two that is PSP.

Dumbass.

Re:Ruby Javascript (0)

Anonymous Coward | more than 3 years ago | (#30196582)

Web development is repetitive because you have to learn to do the same few things in every layer of the stack. If there weren't so many standards, most web development tasks could be automated away.

Re:Ruby Javascript (1)

DrXym (126579) | more than 3 years ago | (#30194130)

Google web toolkit allows devs to write in Java which is translated into JS. I'm sure something similar is feasible for Ruby too.

Re:Ruby Javascript (2, Insightful)

piquadratCH (749309) | more than 3 years ago | (#30195866)

I'm sure something similar is feasible for Ruby too.

It certainly is [github.com] .

And there's also a Python port of GWT, very aptly named pyjamas [pyjs.org] .

Re:Ruby Javascript (1)

Blakey Rat (99501) | more than 3 years ago | (#30195448)

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

Re:Ruby Javascript (1)

perlchild (582235) | more than 4 years ago | (#30199102)

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:Ruby Javascript (1)

Blakey Rat (99501) | more than 4 years ago | (#30202438)

Whine, whine. I never said it would be easy, I said it's possible.

Re:Ruby Javascript (1)

spongman (182339) | more than 4 years ago | (#30223788)

ironically, you can write Silverlight apps in IronRuby that can manipulate the DOM.

Re:Ruby Javascript (2, Interesting)

mythz (857024) | more than 3 years ago | (#30195806)

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/javascript/ [crockford.com] to learn some advanced techniques.

For anyone who's interested I have a Class.js as described on my blog http://www.servicestack.net/mythz_blog/?p=3 [servicestack.net] that simplifies using OOP in Javascript.

What do you mean by clean? (1)

namespan (225296) | more than 3 years ago | (#30196482)

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 the backend.

Re:Ruby Javascript (1)

harlows_monkeys (106428) | more than 3 years ago | (#30197300)

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.

Re:Ruby Javascript (1)

Hurricane78 (562437) | more than 4 years ago | (#30200190)

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-designed languages, and thereby have an obvious preference. :)

Re:Ruby Javascript (0)

Anonymous Coward | more than 4 years ago | (#30200270)

Oh, and if you so much as ask about PHP, I’ll fuckin’ murder you!!! ;P

Re:Ruby Javascript (1)

toriver (11308) | more than 4 years ago | (#30203706)

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

Re:Ruby Javascript (0)

Anonymous Coward | more than 4 years ago | (#30223042)

there's hotruby, a javascript/flash hybrid implementation of ruby: http://hotruby.yukoba.jp/ [yukoba.jp]

and you can of course run jruby as a java applet.

Renaissance? (1)

Jacques Chester (151652) | more than 3 years ago | (#30193990)

Did the ancient Greeks and Romans have Ruby VMs that are just now bursting back onto the cultural scene?

Ruby at a sight (2, Interesting)

oldhack (1037484) | more than 3 years ago | (#30194026)

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:Ruby at a sight (1, Insightful)

Anonymous Coward | more than 3 years ago | (#30194092)

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 (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30194180)

Ruby is far more powerful and expressive than Python.

Translation: you can write code and come back in six months and have no fucking idea what it does without a secret decoder ring (ahh.. the phenomenon of write-only code). Add in a heaping helping of syntactic sugar and we're there.

Python is far more readable and maintainable when doing large amounts of code.

Sorry kid, Python is for the pros and Ruby is for the Rails fanbois designing 'leet' sites as web contractors. On more than one occasion I've made fools cry because I broke their scaffolding... but.. we approach the straw man at this juncture.

Re:Ruby at a sight (1)

jkauzlar (596349) | more than 4 years ago | (#30209218)

On more than one occasion I've made fools cry because I broke their scaffolding...

Ha! That's the quote of the day :)

For what it's worth, I don't mind Ruby. I don't particularly like it, but I don't mind it. The (lack of a) type system makes it unwieldy for any serious endeavor. I'll bet you anything that a Java developer with Eclipse or Netbeans can work at least twice as fast as any Ruby/Python/Perl developer. Not to say Java is good for all things...

Now, with Python, doesn't the significant whitespace pretty much rule it out for use as a headache-free templating language? Or is that not a problem?

Re:Ruby at a sight (-1, Flamebait)

Anonymous Coward | more than 3 years ago | (#30194500)

Ruby is far more powerful and expressive than Python.

I call bullshit.

Ruby fans say this a lot, without really knowing anything about Python in the first place.

Ruby is less mature, much slower, and too web-focused developer community to be of interest to serious programmers. However, it does have multiline anonymous functions, which creates a sensation of attachment to the language - using them "feels" good, even if they don't really improve productivity (let alone readability).

Get a closer look.. (1)

Steeltoe (98226) | more than 4 years ago | (#30199466)

Hey. I'm using lambdas and procs all the time. It helps to make loops and other construct more abstract and shareable between different parts of the code. Basically, lambdas can fit neatly between classes and functions in reducing lines of code (Don't Repeat Yourself principle), making the code more both more readable, more maintainable and less error-prone. Basically, I hardly need to document my code anymore, as the code speaks for itself - due to the expressibility of Ruby and well-chosen design of code and symbol names.

And don't get me started on modules and mixins. So many cool features in Ruby which solves hard problems like multiple inheritance elegantly, it really deserves a more in-depth study.

I don't understand why you're saying Ruby is web-centric. It started out as an executable, then Rails came in many years later as one of many web frameworks and libraries. Any library under the sun is supported in Ruby. Right now, I'm using WIN32OLE, AutoIT and Selenium to automate Internet Explorer and Excel using ruby as a command-process. Thanks to Ruby, all of this is supported through library function calls and iterators. If I want to make a distributed application, all I have to do is require distributed-ruby, and objects can be sent back and forth on the fly. It's usually very quick to do some new stuff, since the syntax is so simple. You can get quickly started by using Google, since examples abound on how to do most common things.

So I'm really impressed of the libraries and gem-system of Ruby. It's easy to use, and they all incorporate native ruby functionality, to give that extra which most other languages are missing, either in their libraries or expressiveness.

Having used many languages, I always smile when I return to Ruby. Yes, it's good to feel good about coding again. Finally a language that lets you program more of what is inherent in the english language. It's really pretty easy once you get used to the concepts, and then you discover how much time you can save.

Re:Ruby at a sight (3, Informative)

Fred_A (10934) | more than 3 years ago | (#30194110)

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

Short version : Same Same but different.

Re:Ruby at a sight (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30194128)

It still has problems wrt performance and variable scoping is still brain-dead. But at least its semantics and syntax suck.

So, it's a bit worse than python with a better designed object model.

Re:Ruby at a sight (0)

Anonymous Coward | more than 3 years ago | (#30194154)

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

Very true and probably this is the scenarios where a compiled (statically checked language) would have an edge if ... it wouldn't take eons to develop anything.
At prototyping stage is faster using a scripting language (my favourite being python): once the general design (and the business requirement have been
better defined) a rewrite in java/C# might be beneficial (I haven't still seen the case tough).
 

Re:Ruby at a sight (5, Informative)

RAMMS+EIN (578166) | more than 3 years ago | (#30194448)

``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 (3, Informative)

ultrabot (200914) | more than 3 years ago | (#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 (1)

burris (122191) | more than 3 years ago | (#30194920)

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.

Or there exists code you need for one language that isn't available for the other...

Re:Ruby at a sight (0)

Anonymous Coward | more than 3 years ago | (#30196506)

Like what?

Re:Ruby at a sight (2, Informative)

robbrit (1408421) | more than 4 years ago | (#30198674)

pygame [pygame.org] comes to mind.

Re:Ruby at a sight (1)

WizzardX (1048000) | more than 4 years ago | (#30200438)

There is also rubygame [rubygame.org] , although it's a lot less mature than pygame.

Re:Ruby at a sight (0)

Anonymous Coward | more than 3 years ago | (#30197188)

I programmed in both Python and Ruby for more than a year each. I stopped Ruby when I realized that Zed Shaw was right, the community had become a bunch of D*cks - and the languages' memory use and speed was scr*wed as well.

As a language, though, I think Ruby itself is still a thing of beauty. I don't expect to return to it but I still love it.

Python's meaningful white space is feature something that can feel nice but which I think ultimately makes it *completely* unacceptable as a serious development language - it indeed looks clean and nice yet the fact that you can have invisible bugs that are removed only by rewriting the code as you see it is just a nightmare. It's like a cancer or poison or something else equally nasty. And yes, there are lots of tools out there to deal with this BUT it is inevitable that your code will find itself onto a machine that doesn't have to those tools. And then you are screwed in a distinctly awful fashion. I've debugged lots of nasty things but "looking" for tabs instead of spaces in code in a random server w/ vi is not acceptable.

Also, the meaningful newline/white space makes embedding in HTML more kludgy, though that's a smaller problem.

And python's pretty slow as well.

The thing that I thing that I like about Ruby is how it incorporates all the messy Perlisms in the least messy, most coherent and logical fashion possible.

Ruby's metaprogramming is actually behind Python and these new VMs might change that. Still, the many VMs are sadly a statement that Ruby is done, not that Ruby is beginning.

Re:Ruby at a sight (3, Insightful)

Hurricane78 (562437) | more than 4 years ago | (#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:Ruby at a sight (2, Interesting)

RAMMS+EIN (578166) | more than 4 years ago | (#30205282)

``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 always have one program generate the source code for another program.

The thing that metaprogramming lets you do is basically to build your own programming language. This is nothing new; in fact, the first compiler is an example of that.

Now, languages differ in their support for metaprogramming in a single program. Some, like old versions of COBOL, don't allow any of it at all: everything you want your program to do has to be spelled out in the primitives the language provides. Most languages offer at least the ability to define ones own functions as an abstraction mechanism. It's debatable whether that counts as creating a new language, though, and most people I know would agree that it's not.

Beyond functions, there are various mechanisms that allow more powerful abstractions. Function pointers (like C has) are one. Functions as first-class values (which you mention) are even more powerful. Indeed, using first-class functions, you can basically pass around pieces of behavior, which allows very powerful composition and abstraction. It _almost_ allows you to create your own control structures, and in many cases, the results are good enough that people don't feel the need to go any further.

Another abstraction mechanism, and one that allows you to do metaprogramming, is macros such as those found in Common Lisp. These allow one to, basically, run a transformer function for certain patterns in the source code. The transformer function takes program code as input and produces program code as output, which is then used instead of the original code. The power of this lies mostly in the fact that you can define a macro for patterns that would occur often in your program, and let the macro write your code for you. Programs writing programs. Build your own language _inside_ the language you already have.

Yet another construct is letting a running program change its own structure. This is something you can do in Ruby, where you can add and remove methods and variables at run time.

Finally, there are some languages where the actual language implementation is available to and can be modified by your program. Taken to the extreme, this would allow your program to modify everything from how it is read to how it is translated to code to be executed.

Long story short: metaprogramming goes far beyond what functions as first-class values gives you. Does that mean that the things you can do with first-class functions aren't metaprogramming? That's a matter of definition, but I would say that "What those languages support, is metaprogramming" and "there is no point in a word like "metaprogramming"" is a bit of a mischaracterization.

Re:Ruby at a sight (4, Interesting)

iluvcapra (782887) | more than 3 years ago | (#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 (3, Informative)

Megaweapon (25185) | more than 3 years ago | (#30196024)

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.

Re:Ruby at a sight (1)

iluvcapra (782887) | more than 3 years ago | (#30196102)

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 Ruby's major handicap is within a year or two of resolution.

Re:Ruby at a sight (1)

xiong.chiamiov (871823) | more than 4 years ago | (#30198084)

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:Ruby at a sight (1, Interesting)

Anonymous Coward | more than 4 years ago | (#30197888)

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 actual advantage, except one that's going to be used only rarely and has massive potential for making your code mostly impossible for humans to comprehend.

A very loose syntax, with no syntactic whitespace.

Again, a bug, not a feature.

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

Python has a lot of mindshare and goodwill too. Understandably, though, it is not centered on RoR.

it has a big learning curve for Python people. It's very different.

No, it's very similar. The biggest differences are in syntax, not semantics.

tl;dr most of your 'advantages' are either in Python too or for most Python programmers not advantages at all, and Ruby is overall not nearly as different as you seem to believe it is.

Re:Ruby at a sight (0)

Anonymous Coward | more than 4 years ago | (#30198728)

"Pervasively object oriented" is an advantage of Ruby? I guess that depends on what you think of OO ...

Re:Ruby at a sight (2, Informative)

DragonWriter (970822) | more than 4 years ago | (#30205152)

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 was a result of the fact that the pre-1.9 implementation was horrendously inefficient and produced memory leaks), and other features that they were in theory useful for (and the one thing in the standard library that leveraged them) were replaced with a more limited, tightly focussed coroutine feature (Fibers).

With the cleaned-up continuation implementation in 1.9, if enough of the alternative interpreters do implement them as well (I think its on the plans for some, though not JRuby, the main alternative) and they get much use, I can see them working back into the language core.

Good News (4, Insightful)

RAMMS+EIN (578166) | more than 3 years ago | (#30194102)

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.

Big deal (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30194606)

Who outside of the Ruby and Rails communities honestly gives a crap about the "Ruby Renaissance"? I've worked with Ruby for over a year and a half, and I can say with absolute confidence that the language is horrible. You can flame back to this all you want, the fact remains that it's a slow blob and throwing more hardware at it is a stupid argument. No major VM is going to make it rival the top languages in raw processing power (C/C++/Java even Python). And Rails "automagic" combined with Ruby's inability to report exceptions in a meaninful way (the backtrace is 99% rubbish, and often reports the error in a place where it didn't even occur) leaves you in a state of MURDEROUS RAMPAGE should anything go wrong in your precious RoR app.

As for Ruby in a browser - there's already projects that do that, and do it fairly well. Some of them use Applets, which is where suddenly everyone has a hissie fit. Yeah, using a proprietary Windows-centric tech like Silverlight is a MUUUUCH better option. Please. Or writing a VM in JavaScript? Talk about MOLASSES!

No thank you. If I want to use a quick scripting language with ample flexibility and power, I'll use Groovy, thank you very much. For one thing, Groovy and Grails gives me a LOT more choice as flexibility over RoR any day of the week.

So, Rubyists, have your little childish flames now. I've used it in 3 major projects, right up to Rails 2.3.2, and I've hated it every single time. And don't assume I'm a "n00b" - I've got over 15 years IT experience in more languages that I can list in this comment block.

Re:Big deal (1)

iluvcapra (782887) | more than 3 years ago | (#30194964)

To quote the great Kottke:

...I've been sitting here copying a file to a floppy disk on my Mac design work station, the file is 5 megs and I've been waiting 20 minutes!!...

Benchmarks or it didn't happen. (3, Insightful)

SanityInAnarchy (655584) | more than 3 years ago | (#30195268)

I've worked with Ruby for over a year and a half, and I can say with absolute confidence that the language is horrible. You can flame back to this all you want...

That might be an interesting discussion, actually, but:

...the fact remains that it's a slow blob and throwing more hardware at it is a stupid argument.

See, that's a property of the implementation, not the language. You have noticed what's happened to Javascript lately, right? It used to be slower than Ruby. With v8, it's faster than Python.

Also, you fail to address why throwing hardware at it is a stupid argument, and you don't provide any benchmarks that it's slow.

No major VM is going to make it rival the top languages in raw processing power (C/C++/Java even Python).

If you actually looked at benchmarks, you'd notice that if nothing else, Rails beats PHP, consistently, for performance.

And Rails "automagic" combined with Ruby's inability to report exceptions in a meaninful way (the backtrace is 99% rubbish, and often reports the error in a place where it didn't even occur)

It would help if you actually gave an example here, but you don't. In my experience, the backtrace is actually quite helpful, but use of unit tests and specs helps avoid it.

As for Ruby in a browser - there's already projects that do that, and do it fairly well.

Which is one of the things TFA is about. So what's your point?

Some of them use Applets, which is where suddenly everyone has a hissie fit. Yeah, using a proprietary Windows-centric tech like Silverlight is a MUUUUCH better option.

I suspect Silverlight is at least faster to load, but I haven't tried doing either. Javascript does what I want it to do well enough.

Or writing a VM in JavaScript? Talk about MOLASSES!

Again, benchmarks or it didn't happen. Make sure to test it in one of the better Javascript engines, like v8.

If I want to use a quick scripting language with ample flexibility and power, I'll use Groovy, thank you very much. For one thing, Groovy and Grails gives me a LOT more choice as flexibility over RoR any day of the week.

Can you give an example of how? I mean, for one, there only really seems to be Grails, whereas Ruby has more web frameworks than VMs, and that's saying something. Take Sinatra, for example:

get '/' do
  'Hello, world!'
end

That's right, a REST DSL. What has Groovy got, again?

So, Rubyists, have your little childish flames now.

That's the most literal example of flamebait I've ever seen. Unfortunately, it doesn't look like anyone's really flaming you back. I'm the closest, and I'm just asking for facts.

And don't assume I'm a "n00b" - I've got over 15 years IT experience in more languages that I can list in this comment block.

With all that experience, you couldn't figure out that the comment block seems to allow very, very long comments -- almost certainly longer than the total list of programming languages that exist?

More importantly, you seem to have fallen into the same trap that Jerry Taylor [centos.org] did. I have no idea what your experience is, but it certainly doesn't seem to be reflected here.

Re:Benchmarks or it didn't happen. (0)

Anonymous Coward | more than 3 years ago | (#30196346)

If you actually looked at benchmarks, you'd notice that if nothing else, Rails beats PHP, consistently, for performance.

What benchmarks?

Not these: http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=php&lang2=yarv&box=1

Re:Benchmarks or it didn't happen. (1)

SanityInAnarchy (655584) | more than 3 years ago | (#30196406)

No, not those, but benchmarks which measure actual web performance, not merely fibonacci.

Try these [slideshare.net] . Note that when we actually compare a full framework (Cake vs Rails), Rails is faster, and Merb is much faster. When we try to compare closer to the bare metal (raw PHP), we find that the Merb controller is almost as fast, and the Merb router is much faster.

Also, the page you linked to links to this [php.net] , which is actually less about PHP and more about your app in general. Ruby may be the bottleneck more often than PHP, but still far less than database design, front-end (HTML/etc) design, and your own stupid mistakes.

Re:Benchmarks or it didn't happen. (0)

Anonymous Coward | more than 4 years ago | (#30200652)

raw PHP? Is it a joke? PHP is one of the slowest languages ever, and I can't imaging what is "raw" about it.

Re:Benchmarks or it didn't happen. (1)

Axello (587958) | more than 3 years ago | (#30197152)

Nice and eloquent reply, thank you. I'll look at RoR again after messing about with Capistrano years ago.

Dynamic languages renaissance (3, Informative)

Anonymous Coward | more than 3 years ago | (#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.

no cardinal? (1)

cmdr_tofu (826352) | more than 3 years ago | (#30196916)

What happened to Cardinal? The project that was aiming to have Ruby compile to Parrot bytecode and promised full Ruby Perl 6 interoperability?

Re:no cardinal? (1)

chromatic (9471) | more than 3 years ago | (#30197158)

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

Re:no cardinal? (1, Interesting)

Anonymous Coward | more than 4 years ago | (#30199032)

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:no cardinal? (2, Informative)

chromatic (9471) | more than 4 years ago | (#30199442)

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 as well, but I haven't tried.)

Yawn (-1, Troll)

Anonymous Coward | more than 3 years ago | (#30197008)

Ruby seems to passe now. It really brings nothing to the table between Perl or Python.

Scala (0)

Anonymous Coward | more than 4 years ago | (#30244060)

Scala! There I said it, someone just had to
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?