SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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:

    - is there a builtin cache system? I only found this http://threadbox.net/articles/2005/1...-ruby-on-rails

    - the most important to me, are there I18n functions? (I found answers saying no and to me, it's hard to believe!). No complete UTF8 support, no locale support...

  2. #2
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

    Rails has quite a bit of caching support built-in:

    http://api.rubyonrails.com/classes/A...r/Caching.html

  3. #3
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should be really easy to do your own I18n, or Google: gettext+rails

  4. #4
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Luke, thanks for the tips

    Fenrir2, gettext is not always available on shared hosting.

    I was disappointed because Ruby should already handle UTF8 and localization (it was created by a Japanese dev so he should be aware of this)

  5. #5
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    Yakima WA.
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a pure ruby version of gettext avalable

  6. #6
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I'll check that. BTW, I always ear about RoR it is really slow. Is there any benchmark compared to php or jsp app ?

  7. #7
    SitePoint Member Arto's Avatar
    Join Date
    Mar 2005
    Location
    Spain
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    and the built-in caching support in Rails doesn't do the trick
    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.


    or wait for the next major version of Ruby which will include a fast bytecode compiler
    ruby 2.0 will be significantly faster? I didn't find any roadmap about it.

  9. #9
    SitePoint Member Arto's Avatar
    Join Date
    Mar 2005
    Location
    Spain
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HenriIV
    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.)

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

  10. #10
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks Arto, I have a lot to learn before diving into Rite, between now and then Ruby 2.0 will be production ready

  11. #11
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Meanwhile, don't let the current speed of Ruby put you off learning it, or Rails. Its working for a lot of people. Ruby 2 will just see it get a whole lot faster.

  12. #12
    SitePoint Zealot HenriIV's Avatar
    Join Date
    Jun 2004
    Location
    France
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its working for a lot of people
    Yes, I tested Rails websites and it's not an issue for me, except maybe Ajax stuff but I don't need it right now

    Last question for now: is it ok to work with mysql 5.0? I've read that ruby driver is not ready yet (authentication problem?)

  13. #13
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HenriIV
    Last question for now: is it ok to work with mysql 5.0? I've read that ruby driver is not ready yet (authentication problem?)
    I've used Rails with MySQL 5 without any problems, this was on Windows XP though and I didn't really test it that extensively.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •