Jeff Mesnil
Weblog · About

Using Java 1.5 on Mac OS X Tiger

May 2, 2005

Since I upgraded to Mac OS X Tiger, I also installed Java 1.5 on my PowerBook.

Apple provides a small application to change the default JVM to 1.5 instead of the standard 1.4.2. However it is only useful for Applets and WebStart applications. To change the default JVM for the CLI and Java applications such as Eclipse, I also had to change a symlink.

$ cd /System/Library/Frameworks/JavaVM.framework/Versions
$ sudo mv Current Current.old
$ sudo ln -s 1.5 Current

Et voila!

$ java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-56)
Java HotSpot(TM) Client VM (build 1.5.0_02-36, mixed mode, sharing)

Ars Technica review of Mac OS X Tiger

April 29, 2005

A extensive review of Mac OS X Tiger has been published on Ars Technica.

The explanation of how metadata have been implemented and how Spotlight works under the hoods is the best I've seen so far. I'm eager to try Spotlight but after reading that article and figuring out what can be done if users could apply metadata to file, I'm already looking forward to Mac OS X 10.5 (lion?, wolverine?).

Favorite features in Mac OS X Tiger

April 12, 2005

Now that the release date is known (April 29th), and after having browsed the 200+ new features of Tiger, these are the ones I'm looking forward to:

  • Spotlight -- I'm using Quicksilver for some of the Spotlight features but Spotlight integration in Apple applications (especially Mail) seems quite powerful
  • Dashboard -- Widgets are cool (but are they useful?). What is interesting with Dashboard is that it's based on Web standards (HTML, CSS, JavaScript). If it is possible to use an XmlHttpRequest object from Dashboard widgets, there is a lot of potential (a new wave of Web Services straight to my desktop)
  • Preview -- View and create annotations to a PDF document
  • DVD Player -- Bookmark favorite moments of a DVD
  • iChat AV -- Jabber support
  • Mail -- Add photos from Mail directly to iPhoto
  • Mobility -- More battery usage for my PowerBook
  • Access Spotlight from a UNIX command line using mdls or mdfind (will it be more powerful than find/grep/locate combination?)
  • Java 1.5 -- it seems it's not part of Tiger but available as a separate download

There is no killer feature for me (like Expose was for Panther) but a lot of minor enhancements which should improve the great user experience I have on my Mac so far.

Continuations In Ruby

March 24, 2005

updated with a code example

Via Tim Bray, I read an example of Continuations in Ruby.

The example is very impressive but I didn't grok it at first (I'm still not sure to have understood it yet!).

After some searches on continuations, I found this funny analogy on the RubyGarden Wiki which helped me to understand better what continuations are.

I don't see yet where and when I would use them but it's a new way for me to think about the execution of the code that I'm not accustomed to. Very interesting stuff!

Here is the Ruby code corresponding to the analogy:

puts "Walking..."
turn_left = callcc do | turn_left |
    turn_left
end
if turn_left
  puts "Turning left..."
  puts "Bitten by a dog!"
  bitten = callcc do | bitten |
      bitten
  end
  turn_left.call false if turn_left
  puts "I prefer to bleed!"
else
  puts "Turning right..."
  puts "Hit by a train!"
  bitten.call
  puts "DEAD!!"
end

which outputs

Walking...
Turning left...
Bitten by a dog
Turning right...
Hit by a train!
I prefer to bleed!

The simple example is no better than using goto statements but the example in Continuations on the Web shows that continuations can become more powerful than that when they keep state.

Comments on "Data on the Outside Versus Data on the Inside"

March 9, 2005

Fantastic paper from Pat Helland : Data on the Outside Versus Data on the Inside. In this paper, Pat gives a high-level overview of what SOA really means and all its implications.

His conclusions are not really groundbreaking:

  • use version dependent identifier
  • use XML for outside data
  • use SQL for inside data
  • use Objects for business logic

But what is great is the way he comes to that conclusion.

My favorite part is the introduction of a temporal notion in SOA. I never realized before that using SOA has implications both on space and time. And the analogy between Newton and Einstein laws and RPC/2PC and SOA is simply brillant.

This paper is a must for anyone interested in SOA without the hype surrounding the acronym (and not cluttered by a list of hundreds of WS-blablah).

I had the great pleasure to meet Pat Helland at HPTS'03 and I learned a lot by listening to him (and his songs!). He has the most amazing quality to make complex things simple to understand (is there any better description for 2PC protocol than calling it the "unavailibility protocol"?)

Ruby as Java pseudo code

March 8, 2005

I laughed out loud when I saw that Brian uses Ruby syntax as Java pseudo-code to describe a Web framework. It might be caused by too much exposure to Ruby On Rails!

Brian is right: his Ruby pseudo code is clearer than equivalent Java code. It is a testimony of Ruby expressiveness and, sadly, of the lack of it in Java.

As an aside, very interesting stuff Brian!

Rails is slow, J2EE is Fast - Haven't I already heard this?

February 28, 2005

On Dion's blog, someone commented that Rails is 8x slower than J2EE (don't get me started on such benchmark figures...).

It reminded me of the old "Java is slow, C is fast" argument that I heard some years ago (I still hear it but mostly from Slashdot crowd these days). Then people realized that C and Java have their respective strength and weakness and are best used in some areas than others.

So maybe, we will realize that the same thing apply here and that Java/J2EE and Ruby/Rails serve different purposes and are better suited for different kind of web applications. Maybe, just maybe, one size does not fit all...

I'm not sure I'll build the next Google or Amazon on Rails. But there is also a range of web sites for which Rails is the way to go. Besides, it has a great quality long forgotten in the Java world: that simple things should be simple and complex things should be possible.

I developped in Java for a living and enjoy it most of the time (a little less since I was introduced to Ruby by the way) but sometimes the complexity of Java/J2EE saddens me and I'm not talking about EJB only.

I understand that there are some kind of applications which require this complexity and I contributed to it (on a J2EE server, a JMS one and a distributed transaction manager).

But there is way much more applications which don't need it and would benefit from some simplicity.

From that point of view, developping on Ruby and Rails is an eye-opener. I saw that it makes simple things simple. Now I need more time and experience with it to see if it is possible to do the complex stuff. So far, I've got a good feeling about it.

I plan to talk a little more about my (good) experience with Rails and Ruby. And the best resource from a Java perspective is Brian McCallister's Waste Of Time.

As an aside, maybe Rails is 8x slower than J2EE but it is also 10x more productive so that compensates it... What a bunch of meaningless figures!

JOTM 2.0.3 released - TCK + Recovery

February 21, 2005

It has not made to the headlines but this is a significant achievement.

JOTM is an Open Source (BSD-licensed) implementation of the JTA and JTS API to provide transaction management in Java/J2EE applications (I lead this project for some time but eventually passed the lead to David Egolf due to other job commitments).

This release was used by the J2EE server JOnAS to pass the J2EE TCK. It also includes a recovery log based on the HOWL project.

I believe it is a great step for Open Source J2EE applications for several reasons:

  • As far as I know, it is the first implementation of an Open Source transaction manager which supports recovery (there is some work on that in JBoss JTA and nothing for Tyrex)
  • the HOWL project is the result of the collaboration between the ObjectWeb and Apache communities. Coopetition is a Good Thing
  • There is a good opportunity for JOTM to be used as the default transaction manager in Geronimo

Congratulations to the JOTM and HOWL teams. Keep up the good work!