The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Few questions about Ruby and RoR

Hi,

I started reading few stuff about it, the videos are appealing but I 'm quite disappointed with some functionalities missing. Before getting further with Ruby & RoR (I jsut build websites, no sys admin), so if someone can convince me that I didn't miss important things about RoR and Ruby:

There is no I18n functionality built-in to Rails at the moment (it wasn't a target for v1 but it is a future target) but there are various efforts to rectify this. This wiki page contains a lot of information.

It's not a secret that Ruby is certainly slower, at the moment, than PHP, JSP, Python and a number of other more mature technologies. Whether that's a problem will depend what you use it for. Like Paul Graham has remarked, "Inefficient software isn't gross. What's gross is a language that makes programmers do needless work. Wasting programmer time is the true inefficiency, not wasting machine time. This will become ever more clear as computers get faster."

In other words, if you find Ruby's current performance unacceptable, and the built-in caching support in Rails doesn't do the trick, then you could either throw more hardware at the problem, or wait for the next major version of Ruby which will include a fast bytecode compiler, turning the tables on the speed issue.

In practice, you're unlikely to have a performance problem now, either, unless you run a high-volume site; in which case, your server administrators likely already know how to utilize technologies like clustering and caching reverse-proxies, which make the Ruby performance question moot, anyway.

That's what I don't understand, usually web apps are cached (when there is no need to deliver personalized content) so RoR shouldn't be slower in this case because it's just plain html pages.

There are a multitude of ways caching can be set up, and when people talk of caching, they don't necessarily talk of the same things.

For instance, for the enterprise-grade option, if you use a properly set-up caching reverse-proxy, like Squid, then the implementation language truly doesn't matter. With a clustered MySQL backend and one or more Squid front-ends, you can drive arbitarily high traffic (as much as your wallet allows, anyway).

In contrast, for application-level caching, you are still invoking the interpreter on each request, so in those cases Ruby would still be slower than PHP, only the difference wouldn't be nearly as significant thanks to the elimination of database queries etc. Think of RoR's caching as pretty much identical to what the Smarty PHP templating engine can do.

That said, I understand that RoR's caching does have an option to output plain HTML pages, in which case the performance will be, of course, as fast as your web server software can serve them out. (And using a faster web server, like Lighttpd instead of Apache, will allow you to serve more simultaneous visitors.)

Originally Posted by HenriIV

ruby 2.0 will be significantly faster? I didn't find any roadmap about it.

Lots of the core Ruby development happens in Japanese so sometimes information on what's going on can be a bit scarce for us English-speakers. Check out RubyGarden for some information on Rite, the new Ruby VM. AFAIK, it's approaching usable, and you can already compile it with the latest Ruby development versions. Preliminary tests show that performance is significantly improved, and could well beat the crap out of plain PHP once it matures.