…JVM, Clojure comes with batteries-included and can be deployed anywhere that Java can (almost anywhere).
Satish>> You have written a Clojure wrapper (congomongo) for the mongo-db java api. Can you tell us more about this wrapper? Also, why did you target MongoDB?
Andrew>> I really like working with MongoDB. The combination of schema-less document storage and ad-hoc queries is fantastic. The JSON format fits Clojure's data structures well, and the mongo-java-driver …
…C-based apps shipped with the JVM. The answer is yes! Because of the maturity of the Java platform, there are standard Java APIs you can use to access all the same information the previous tools consumed. And since we're talking about JRuby, that means you have Ruby APIs you can use to access that information.
That's what I'm going to show you today.
Introducing JDI
The APIs we'll be using are part of the Java Debug Interface ( JDI) , a …
…in his presentation, there are some significant performance gains to be made just by switching to Java 6 and you can get another performance boost if you upgrade from an older JDK 6 release to a recent one. JDK 6u21 is currently the latest release and that's what I would pick if I were to set up a production Confluence server today.
If you are wondering about which Java VM to use, I suggest that you stick with Sun's HotSpot (also known as Sun JDK). It's the …
…these times, you just have to use the native library...and the barrier to entry for doing that on the Java platform is just too high. Rolle JNA or JFFI or something similar into the JDK, so we grown-ups can choose when we want to use native code.
The Punchline
The punchline is that for most of these things, we've solved or worked around them in JRuby...at *great expense*. I'd go so far as to say we've done more to work around the JVM and the JDK's lackings …
I really enjoy Processing , but... Java. Can we have something fast, but with closures and easy syntax, please? Either Scala or Mirah might meet that need.
Mirah is a Java compiler that reads Ruby-like syntax: looks like Ruby, but it's still Java. That seems promising, but I don't think you can use, say, Array.map, since it's not part of Java's core library.
Scala is a functional/ OO hybrid language that brings closures and …
JAX-RS in theory makes it easy for you to simply mark up a piece of Java code with annotations and have it automatically be presented as a RESTful service. Of the available options, it may be the simplest, quickest way to get a Java-based service published and running.
So I figured I'd try to use it from JRuby, and when doing it in Ruby it's actually surprisingly clean, even compared to Ruby options.
The Service
I followed the Jersey Getting Started tutorial …
…of course, but consider the potential for another case: calling from Ruby to arbitrary Java code. Instead of encumbering that call with all our own multi-method dispatch logic *plus* the multiple layers of Java's reflection API, we can instead make the call *directly*, going straight from Ruby code to Java code with no intervening code. And with no intervening code, the JVM will be able to inline arbitrary Java code straight into Ruby code, optimize it as a whole. Are we getting …
…speaking. The original version of Bingo Card Creator was a downloadable Java application. It has gone through a series of revisions over the years, but is still there in all its Swing-y glory. Last year, I released an online version of Bingo Card Creator, which is made through Rails and AJAX.
My personal feeling (backed by years of answering support emails) is that my customers do not understand the difference between downloadable applications and web applications, so I sold …
…in his presentation, there are some significant performance gains to be made just by switching to Java 6 and you can get another performance boost if you upgrade from an older JDK 6 release to a recent one. JDK 6u21 is currently the latest release and that's what I would pick if I were to set up a production Confluence server today.
If you are wondering about which Java VM to use, I suggest that you stick with Sun's HotSpot (also known as Sun JDK). It's the …
I can still remember how I felt the first time I deployed a a Java application from the WinNT desktop where I had developed it to a pair of Solaris servers. It was either late 1998 or early 1999. Up to this point most of my experience in cross platform development had consisted of the surprisingly difficult and painful task of tweaking the code and header files of open source programs to compile on ever so slightly different flavors of Unix. Forget about crossing the Unix/ Windows divide …