<< September 2007 | Home | November 2007 >>

Saterday Apple/Java Quiz: Putting Things In Perspective

Yesterday's storm of "No Java 6 on Leopard" posts, (including mine, and I don't even have a MacBook Pro) clouded the blogosphere a bit. I can't say we are not warned. I picked up the warning 11 days ago. Now it's the morning after, and I'm starting to see some more reasoned responses. I thought it would help to ask myself some questions, just to put things in perspective.

What's in it for Apple?

Apple spent a huge amount of resources to port Java 4 and 5 to Mac OS X. I've heard people claim that Apple has the most integrated Java on any platform. Almost all Java speakers in the traveling tours changed their laptops to MacBook Pros overnight.

Now that that's achieved, what other incentives are there for Apple to continue investing in a Java port?

None of the MacBook Pro carrying Java speakers, or anybody else, for that matter, wrote a single Java application that gave Apple any advantage—they are all cross-platform.

What's in it for Sun?

We use to laugh at Microsoft when they wrote MSDN articles like "Writing cross-platform Windows applications"—applications that runs on Windows 85 and Windows NT.

And now inevitably Java has come to the same juncture. Without Apple's continuing support, future versions of Java just won't be as cross-platform as they should be.

Given the importance of the MacOSX platform, I think everybody in Sun would agree that Java 6 on Leopard is of critical importance to Sun.

The question is, who should pay for it?

If it is up to me, Sun should pay for it, and Apple should do it. At least Sun should give Apple a little push in monetary terms.

What's in it for me or my clients?

Over the close to ten years of the Java phase of my career, I've worked for several clients. I've worked on Solaris, AIX, Tru64, Windows 95/NT/2K/XP, RedHat, Fedora, Debian, Ubuntu. Not once was whether Java runs on the Mac mattered to me or my client.

It is cool that what I wrote would work on the Mac if Sun and Microsoft and the Linux community were to all close down tomorrow. But I don't see that happening anytime soon.

So is Leopard not having Java 6 a big deal?

For me, and I think most of the Java developers, not having Java 6 on Leopard for (what I hope is) a short period of time is not such a big deal. We'll just keep on using (or switching back to) Windows when we want to develop Java 6 code.

No Leopard for me, for now!

As much as I wanted to replace my trusty G4 mac mini, I'm going to wait a little while to decide my upgrade path. Through my crystal ball I see that by Christmas time, there should be Java 6 on Max OS X.

I just couldn't tell which Christmas.

Tags :

AAPL Disappoints JAVA

(Via Cafe au Lait.) A disappointing report from an early Leopard installer. It appears there is no Java 6 in Leopard.

Mikey:

lrwxr-xr-x  1 root  wheel    5 Oct 24 01:25 1.3 -> 1.3.1
drwxr-xr-x 3 root wheel 102 Sep 29 02:53 1.3.1
lrwxr-xr-x 1 root wheel 5 Oct 24 01:25 1.4 -> 1.4.2
lrwxr-xr-x 1 root wheel 3 Oct 24 01:25 1.4.1 -> 1.4
drwxr-xr-x 8 root wheel 272 Oct 24 01:25 1.4.2
lrwxr-xr-x 1 root wheel 5 Oct 24 01:25 1.5 -> 1.5.0
drwxr-xr-x 8 root wheel 272 Oct 24 01:25 1.5.0
drwxr-xr-x 7 root wheel 238 Oct 24 01:25 A
lrwxr-xr-x 1 root wheel 1 Oct 24 01:25 Current -> A
lrwxr-xr-x 1 root wheel 3 Oct 24 01:25 CurrentJDK -> 1.5

Tags :

Thursday Silly Contest: Are You 250 Years Old

I got this link from a private communication yesterday: Blogger: User Profile: Josh Juneau:

  • Age: 250
  • Gender: Male
  • Astrological Sign: Scorpio
  • Zodiac Year: Rat

Notice his age. Pretty impressive, huh?

That leads to today's contest: Are you the oldest blogger on the internet (as evidenced by your blog profile)? You are qualified only if you haven't modified your profile after reading this blog entry.

Tags :

Friday Java Quiz: How Many Parser Generator Runtimes Does The Sun JDK include?

This months OCI internal Java lunch is an introduction to ANTLR 3 and AntlrWorks by Dean Wette. I didn't take good notes, so I can't do a live blog today.

Like what I did 7 days ago with the St. Louis JUG meeting, I'm going to turn the talk into a Java Quiz. (Dean did ask me "No Friday Java Quiz today?" to which I replied "No.")

Well, Friday is not over yet. And Dean may be surprised to find this quiz when he gets back to the client site. I do have a parser generator related question for you. To set it up, let me just mention that if you write a parser in Antlr 3, you will have to ship the Antlr 3 runtime with your final product. This is not the case for JavaCC.

Now the question: How many parser-generator runtimes does the Sun JDK (say Java 6) contain? What are they?

It Could Go Either Way

Elliotte Rusty Harold: Apple's removed the Java 1.6 preview form the Apple Developer Connection, possibly because they expect to ship it with Mac OS X 10.5 Leopard in a couple of weeks, or possibly because they've decided not to ship it at all. With Apple, it could go either away.

Please let it be the former. That would give me at least an excuse to upgrade my already too slow G4 mac mini.

Tags :

It's A Typo (Was: James Gosling: Silverlight Kicks Ass)

James Gosling: As much as I love the Mac's eye candy, it really hasn't been keeping up as a developer's machine - their attention has clearly been elsewhere. Meanwhile, the Solaris folks have made huge strides in Solaris's usability on a laptop with recent Nevada builds: the latest Gnome is quite lovely. Firefox, Thunderbird and Silverlight kick ass.

Silverlight kicks ass? This from James Gosling? Is he talking about the Silverlight?

I'm confused. Please somebody straighten me out.

[Update]

Comment from Simon Phipps:
I asked James and it's a typo. He meant to say Lightning (the Thunderbird calendar add-on).

That's better.

Tags :

Friday Java Quiz: Source Reconstruction

The following is a fragment of source code that I jotted down during Alex Miller's presentation at the JUG yesterday:

    lock.writeLock().lock()
    try {
      data[index] = result;
      pixelComplete++;
    } finally {
      lock.writeLock().unlock();
    }

Today's quiz: reconstruct the original program of which this fragment is a part.

Bonus round: here are some other words in my notes, make sense of them:

             jsr166y
          encapsulate shared state

  handout
  no slides                            ReentrantLock
  all code

            AtomicInteger         wait, notify          ForkJoin
               Lock                   Condition
                                    newCondition()
                 tryLock()           ReadWriteLock

SETA               Future              readLock
SEDA                           writeLock
Tags :

Alex Miller, Mendelbrot, Concurrency, Tonight At 6:30, At The JUG

(I'm trying to alert my readers of the St. Louis JUG meetings ahead of time now. Especially since the IDEA license give away is still in effect, and it doesn't help by reporting after the fact: "We gave away an IDEA license tonight at the JUG." "Why don't you tell us beforehand?")

The October meeting will feature Alex Miller, the chronicler of the happenings (and non-happenings) on the Java 7 trail, talking about Concurrency with Mandelbrot.

Alex Miller: The title is "Concurrency with Mandelbrot" and will be kind of a guided tour of a bunch of concurrency topics, using a Mandelbrot generator as the example program.

I’m really excited about this presentation - the examples are coming together nicely and of course it’s fun to be drawing Mandelbrot images. If you’re in St. Louis and interested in Java and concurrency, please stop by!

Come.

Tags :

The Death Of An iPod

It seems like yesterday when I bought my iPod Shuffles. Well, one of them is dead now. It failed to bring up iTunes when I plugged it into the USB port a week ago. And now the battery is drained. It lasted 941 days.

Went to the Apple Store to ask if it can be fixed. "Not really" was the answer. "We do have an iPod recycling program where you can bring in your dead iPod and get a 10% discount on your next iPod (except the Shuffle)."

Tags :

Friday Java Quiz: Finally And Explicit Return

Just as I was ready to leave for the weekend, David asked a Java question on his way out. And I'll make it a Friday Java quiz. Again, as usual, answer the question without the help of the Java compiler.

Q: What will the following program print?

public class Foo {
  public static void main(String[] args) {
    try {
      System.out.println(1024);
      return;
    } catch (RuntimeException e) {
      System.out.println(2048);
    } finally {
      System.out.println(4096);
    }
  }
}
Tags :

Java's Game Changing Move: The First Step

Sun (through the jdk6.dev.java.net project) released an early access version of Java SE 6 Update N (aka The Consumer JRE) two days ago.

Since this is an early access program, the naming is kind of geeky. But that's OK. I imagine when it is finally released in the middle of 2008, it will be named Java SE 6 Update 5 or some such. (It installs to jdk1.6.0_05 or jre1.6.0_05.)

Also since this is an early access release, the installation process is a little bit different from the normal released versions of Java. I have been trained to just download the JDK and expect the JDK installation to also fire off a sub-installation of the JRE. Not so with 6uN. To try to run Applets with it, I have to either hand edit my registry or download the JRE.

[weiqi@gao]$ java -version
java version "1.6.0_05-ea"
Java(TM) SE Runtime Environment (build 1.6.0_05-ea-b04)
Java HotSpot(TM) Client VM (build 1.6.0_05-ea-b04, mixed mode, sharing)

"Applets?" you ask. Yes, Applets. As I explained 155 days ago, Java applets, or something like it, is having a comeback. And this time, it just might work. I'm not predicting that Sun will win. As a matter of fact, I wish every product in this space wins. However, what I can predict is that classical web app development will fade away as a viable IT option within 3 years. Surely Google and Yahoo and Amazon.com will still be putting out web apps, but for the most part, ordinary people won't be writing HTML or even thinking HTML anymore.

Back to my experiment with 6uN. After I figured out that I need to download and install the JRE in addition to the JDK, everything snapped into place. After reboot (I'm on WinXP Pro SP2) a Windows service called JQS (for Java Quick Start) is started. This small footprint service reads the Java runtime files periodically to load them to the operating systems file cache. This way, when a Java process is started, either from the command line or from the browser plugin, no slow disk access is performed.

And it worked. Here is the timing of a hello world Java program without JQS:

[weiqi@gao]$ time java Foo
Hello, world.

real    0m2.176s
user    0m0.015s
sys     0m0.031s

Here is the samething with JQS:

[weiqi@gao]$ time java Foo
Hello, world.

real    0m0.151s
user    0m0.047s
sys     0m0.000s

That's a 93% reduction in start up time.

What this means is that the perceived slowness of Java that has been bugging everybody since the start of the Java era has finally gone away.

The Java Kernel + Modules feature is not part of this early access release. I hope that when that feature is enabled, the startup time will be further improved. And people will look at Java client development with a different eye.

Tags :

Jeff Brown's Handful Of Languages

Jeff Brown, as quoted on Code To Joy: Scala, Erlang, and Haskell should be on your list for experimentation, and, well, Groovy and Ruby are simply required.

I'm glad to see the list of hot languages keeps on evolving.

At the end of the day, it is what people can do with a language that drives the adoption of a language.

The mathematician in me applaud any language where functions can be defined the most natural way:

hyp(x, y) = sqrt(x^2 + y^2)

Scala and Haskell comes really close to the ideal. However to popularize these languages, something that is uniquely doable in them has to be invented.

The sudden prominence of Erlang is the result of the "It's the end of the free lunch" multi-core scare from Hurb Sutter. It's all the rage in the blogosphere.

As to the Groovy and Ruby comment, I think a more accurate statement would be "Groovy or Ruby is required." I would have thrown in another disjunction "or something like them," but that would make the statement too crowded.