{"id":77,"date":"2007-03-17T11:26:39","date_gmt":"2007-03-17T19:26:39","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=77"},"modified":"2007-03-17T11:26:39","modified_gmt":"2007-03-17T19:26:39","slug":"mtnwestruby-jruby","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/mtnwestruby-jruby\/","title":{"rendered":"mtnwestruby: JRuby"},"content":{"rendered":"<p>\nMountain West Ruby Conference: JRuby by Charles Nutter and Ted Enebo<br \/>\n16 March 2007\n<\/p>\n<p>\nMost of the developers in the auditorium have been Java programmers, and don&#8217;t<br \/>\nwant to go back. Charles said that they have a hard time getting the message<br \/>\nout that JRuby isn&#8217;t about Java, it&#8217;s about Ruby, and they&#8217;ve aimed to make<br \/>\nJRuby as compatible as possible with Ruby.<\/p>\n<p>\nBackground: They&#8217;ve both been Java developers for the past ten years, and<br \/>\ntheir goal is to make Ruby a first-class language on the Java platform. They<br \/>\ndidn&#8217;t start the JRuby project &#8212; they adopted it.<\/p>\n<p>\nRuby 1.8 Design Issues:<\/p>\n<ul>\n<li>Green Threading doesn&#8217;t scale across multiple processors\/cores. The<br \/>\none-size-fits-all scheduler doesn&#8217;t fit all platforms where it runs. Although<br \/>\nRuby 1.9 will use native threads, there&#8217;s much work left to make it work on<br \/>\nvarious platforms. Java\/JRuby already uses native threading and scales across multiple processors and cores.<\/p>\n<li>Partial Unicode support. Ruby 1.9 will have Unicode support, but will bring with it other difficult issues (e.g. what happens when you concatenate two strings, each being in a different encoding?). In JRuby, one can use Java Unicode strings, or the Rails Unicode library.\n<li>Slower than most other dynamic languages. Makes it difficult to sell to management. It&#8217;s a long term perception problem for the language. JRuby will allow compiling to bytecode, which allows HotSpot to do JIT optimization.\n<li>Garbage collection is simplistic. JRuby uses Java&#8217;s best-in-the-world memory management and GC. Scales well to enormous applications and loads, and is battle-tested in deployments worldwide.\n<li>C language extensions can crash the Ruby runtime, don&#8217;t necessarily interact well with garbage collection or with threading. JRuby lets you use Java-based extensions, which aren&#8217;t going to crash the VM.\n<\/ul>\n<\/p>\n<p>\nPolitically, it&#8217;s easier to get JRuby into an organization than Ruby, because<br \/>\norganizations have already accepted and deployed Java. JRuby is just a library for Java.<\/p>\n<p>\nMost &#8220;pure&#8221; Ruby code runs on JRuby, and Rails mostly runs on it, although<br \/>\nonly 90% of ActiveRecord passes unit tests. It&#8217;s easier to write JRuby code<br \/>\nthan Java code. Perhaps Java is good for implementing libraries, and JRuby is<br \/>\ngood for using those libraries for implementing applications.<\/p>\n<p>\nJRBuilder\/Cheri project by Bil Dortch lets you build Swing apps in JRuby much<br \/>\nmore easily than writing Java code. Demo shown. Project is still in development.<\/p>\n<p>\nNetBeans Ruby support is a one-man developer effort by Tor Norbye. His<br \/>\nprogress has been impressive. Demo shown. Code completion, syntax<br \/>\nhighlighting, built-in ruby documentations, go-to-declaration, auto-indent,<br \/>\nrename support, built-in interactive ruby shell (irb). By the way, Charles<br \/>\nuses vim, and Ted uses emacs. NetBeans Ruby uses the JRuby AST to do its work.<\/p>\n<p>\nSpeed. Interpreted JRuby is currently generally slower than Ruby 1.8.5, although some things are faster. They&#8217;re working on making it faster, and should be able to achieve comparable performance to Ruby 1.8.5. Compiled Ruby (bytecode) runs faster on the JVM than it does on Ruby 1.8.5.<\/p>\n<p>\nQ: How can you make a JRuby app deployable so that people don&#8217;t know it&#8217;s a Ruby app or a Java app?<br \/>\nA: Make your ruby app into a jar file, and just double-click it.<\/p>\n<p>\nQ: How easy or hard is it to deploy JRuby apps to servers?<br \/>\nA: Use Sun&#8217;s glassfish deployment framework.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mountain West Ruby Conference: JRuby by Charles Nutter and Ted Enebo 16 March 2007 Most of the developers in the auditorium have been Java programmers, and don&#8217;t want to go back. Charles said that they have a hard time getting the message out that JRuby isn&#8217;t about Java, it&#8217;s about Ruby, and they&#8217;ve aimed to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/mtnwestruby-jruby\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;mtnwestruby: JRuby&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,17],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-programming","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}