Switching to JRuby

Currently I am working on an “enterprise-y” integration solution, where we offer a RESTful interface making heavy usage of HTTP and XML on the implementation side. While suitable for HelloWorld and blogging applications, all the standard Ruby libraries simply do not work in the corner cases:

  • XML builder generates illegal XML
  • REXML - occasionally the stack level is too deep :O
  • Net::HTTP can not proper handle HTTP 1.1 and “100 Continue”
  • hpricot - tag soup parsing and creation

While being thankful to all the great hackers, who developed the mentioned libraries, partly in their personal spare time, it is simply too much pain to use them in the real world application, that has to 100% work.

And at this point of time we would also like to get rid of ImageMagick.

The JRuby is pretty mature nowadays and promises to eliminate debugging in mentioned areas thanks to java libraries, that evidently work. For years.

That is why we decided to switch to JRuby for all the new application development. For automation tasks (organizing my life with Rake) the MRI still remains the platform of choice, especially due to its incredibly short start up time - 12ms on my machine.

P.S. Just for completeness: you could use libxml and libcurl (known 100% working solutions written in C) with their respective Ruby wrappers, but

  • I found the quality of libcurl wrappers not convincing
  • searching for cross-platform compiling issues (production servers are Sun Solaris based) does not belong to our hobbies
  • we wanted to solve all our problems at once. ;-) You know, the silver bullet.

Comments

blog comments powered by Disqus