On Aug 30, 2:34 am, Karl Brodowsky <[email protected]> wrote: > Dear All, > > I think Ruby and JRuby both have their advantages. It depends on the > environment which one is easier to integrate and maintain. > In a typical Linux-Apache-(Postgres|MySQL)-Ruby environment JRuby with > its additional requirement of Java comes with some > painful extra cost, which can otherwise be avoided. In an > java-enviroment, where part of the stuff should be done with Ruby+Rails > it might be the other way round.
I think the "cost" of the Java dependency is extremely low. Debian, Suse, Redhat, Ubuntu...all the Linux distributions how have single- command installs for Java that "just work". Pick a "Java 6" or "Java 1.6" version and you're ready to go. I would dare say it's at least as easy as Ruby, and probably easier on peculiar systems that have Java installs but no supported Ruby install. It is for this reason JRuby has become the Ruby of choice for a lot of people on Windows; install Java, unpack JRuby, and you're done. > My own observation is that JRuby is slightly faster than Ruby 1.8.7, but > Ruby 1.9 is way faster than that. But it depends on what Java > you use, what you do etc.. Java 6+ should always be used for comparison, and if you're benchmarking or running a production server you should pass --server to JRuby to use the optimizing JVM. We're generally about on par with 1.9...faster at some things and slower at others. > I would like to point out that the set of libraries available may be > quite different. Many Ruby-libraries use native c-code and are > unavailable in JRuby. Almost all libraries that require C code have equivalents in Java that can be called directly from Ruby. In many cases, we've even ported the C code or wrapped those libraries so that the gem versions will work (like, Hpricot, Mongrel, etc). Many C libraries can also be called directly from JRuby with FFI. In general, you probably have access to *more* libraries from JRuby because you've got Ruby libs, Java libs, and any C libs you can call with FFI. > Another point is that operating-system-functionality is not really > available in Java beyond what can be commonly implemented on > different platforms supported by Java. So they are not easily accessed > in JRuby either. If such stuff is needed, native Ruby is better. > I have even used native Ruby to add Windows- and Linux-specific > functionalities for accessing OS-features needed and hidden in Java > from a Java software. We've done a lot of work to implement OS functionality that doesn't normally exist in Java (and isn't planned for addition). Things like FFI for programmatically calling C libraries, POSIX filesystem functions, UNIX sockets, and more. We've worked very hard to make as much OS-level code work well on JRuby as possible. - Charlie --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

