views:

568

answers:

14

Ruby on Rails has become a new competitive face in the server programming industry, along with php, asp.net, jsp, python, and a few others. But is ruby used for anything BESIDES rails? Does it owe all of its success to the rails framework? More questions here are tagged ruby-on-rails than ruby. However, I supposed PHP isn't used for that much outside of server stuff,

thoughts?

+1  A: 

Scripting tasks.

For example, I once used Ruby to scrape an entire website's content (hundreds of pages) into a comma separated file. Did it for migrating someone's static html website to a dynamic, database-driven one. Just bulk inserted the csv. Doing that by hand would've been impossible.

statenjason
+1  A: 

It's used to write all sorts of applications. Often used to write small script applications like python is.

Check out ruby forge.

Ólafur Waage
A: 

LessCSS and Webgen. Even if there was no ROR, those two would be quite enough to justify Ruby's existence in my book.

ChssPly76
A: 

Web applications, scripting, some games, anything you can think of. A friend of mine was working on a ruby to as3 compiler :D

Seth Illgard
A: 

Various testing scenarios. WATIR and RSPEC as examples.

+17  A: 

Firstly, PHP was built to be a server language, first and foremost. That's one of the primary reasons it's not usually used for anything other than web applications - it's not designed for it and therefore can't match up to the requirements of, say, a scripted desktop application.

Ruby was designed as a general-purpose scripting language, and thus has a wide support for a number of different applications. It has been used across the board for everything from web applications, to web servers themselves, to intelligent graphing libraries, to picture recognition engines, to threaded database servers, to low-level system utilities. It has a wide spectrum of use throughout computing.

Rails has most certainly boosted the popularity of Ruby by a huge amount, brought it up into the forefront of scripting languages, spawning 40+ books, 18 conferences, distribution with nearly all the major operating systems and 7 different implementations to boot!

To begin with, all of Rails' internals are written in Ruby itself, but all of the Rubygems, libraries, snippets or anything else that is used by Rails developers is written in Ruby too, and is most likely built to work outside of the Rails stack.

Having said that, the popular web framework is not the reason why Ruby is popular. Sure, it has helped bring much-needed attention to the language, but it's not the reason why people use it day to day. It's used for everything from web applications to desktop GUI applications because of it's simple, elegant syntax, it's clean, sensible and complete standard library, it's wide ecosystem of community code, support and toolchains.

Ruby is used because it rocks.

Jamie Rumbelow
very good answer. it could get a better rank if you just start with the 2nd paragraph: "Firstly, PHP..."
austinfromboston
I think you're a bit confused here. Rails absolutely *is* why Ruby is popular. Without Rails Ruby would have a mere fraction of the adoption it does today. Certainly not half as much, and probably a mere fraction of half. To deny this is fanboi-ism. As is your ending flourish "because it rocks".
George Jempty
Many gems have native extensions written in C.
John Topley
Well there is a php-qt extension so you can write client applications
txwikinger
+1  A: 

It is used as a base for DSLs. It is perfect for this purpose since its grammar is so flexible. For instance there is a make replacement called Rake.

stonemetal
+1  A: 

Shoes is a cross-platform GUI toolkit written in Ruby.

Kevin Dente
+4  A: 

Ruby was really a boutique language before Rails came out. It fills the same need that Perl and Python do. In the scripting space, Perl reigns supreme with Python gaining a lot of popularity the past 10 years. Ruby was sparingly used or heard of among people writing Perl and Python programs. When Rails came out it was very attractive to people doing web development (typically in PHP) so a lot of web programmers picked up Ruby while others saw no reason to switch from their comfortable Perl and Python environments.

Most people still use it only for Rails but its increased exposure has lead to more people using it "out in the wild" for non web tasks. Most places already have many programs written in Perl or Python and see no reason to switch. Most Linux distributions ship with Perl and Python preinstalled but not Ruby. Ruby also doesn't have as many third party modules available.

J Bruno
I see the "Ruby doesn't have the coverage of CPAN" complaint a lot, but seldom see any examples of what specifically isn't available. I'd submit (from a point of general-Ruby-not-just-Rails bias) that what isn't there is probably not needed much, if at all.
Mike Woodhouse
+2  A: 

As others have said, general scripting. The reason I prefer it for general scripting (over Python) is simple: inline regexes. Python's regex support is unfortunately awkward, and for scripting, regexes are usually pretty important.

I don't even think I have to mention why it beats Perl.

Sam DeFabbia-Kane
The irony is as soon as you state "I don't even think I have to mention why it beats Perl,", then, actually yes you do, since you brought it up.
George Jempty
Well, @$%#. (I wasn't swearing — just answering in Perl.)
Chuck
See? I really don't.
Sam DeFabbia-Kane
Gimme a break, Ruby has sigils AND regexes just like Perl.
George Jempty
@George: It has them, but they're not anywhere as pervasive or complicated. Readable Perl is possible, but Ruby is generally the more readable language for people who aren't gurus.
Chuck
+2  A: 

It can also be used for scripting both standalone (with an interpreter) and within many other programs. Google Sketchup (for 3D-modelling) comes to mind...

+8  A: 

Bio Medicine

Jules J. Berman, PhD, MD wrote a 378 page book on how to use ruby to solve the most common computational tasks in the field of biomedicine. As to my knowledge, this book has no mention of Rails.

jrhicks
+1-That is very helpful..thanks
Webbisshh
+4  A: 

But is ruby used for anything BESIDES rails?

Oh my gosh yes. Look at RubyForge, which predates Rails and the even older RAA for examples of non-Rails stuff. At work, besides the inevitable Rails-based intranet apps, I use ActiveRecord standalone for database work, scheduled backups, XML parsing, FTP downloads, CSV parsing, manipulating Excel workbooks and just about any other ad hoc scripting job that turns up. But I'm old - I started playing with Ruby before Rails was an apple in DHH's eye.

At home, I've done all kinds of strange things, some successfully, some rather less so. All, however, were fun and very few were related to Rails.

Does it owe all of its success to the rails framework?

No. Some, but not all. It's also true to say that Rails owes much of its success to Ruby, without which it would be a different beast.

Rails has undoubtedly increased the acceptance of Ruby, taking it to some sort of critical mass where a large enough proportion of developers - regardless of their opinion - have now heard of the language and have some idea of things for which it can be used.

And yes, it rocks.

Mike Woodhouse
A: 

Rubystein - Wolfenstein game clone using the Gosu library :)

astropanic