Phobos at the Web 2.0 Expo
In my talk, I went over three key components: Phobos (the server-side framework and development environment), jMaki (the client side Ã¼ber-framework) and GlassFish v3 (the server platform). I demoed all three of them, and I'm glad to report that, as promised in my slides, the startup time for GlassFish v3 on my Mac Book was well under 1 second (626ms to be exact). Furthermore, deploying a Phobos application took all of 1.3 seconds, and the resulting app was as live and editable on the fly as anything in PHP, Python or Ruby -- if that doesn't impress you, nothing will.
Interestingly, since my session was scheduled on the last day, I got to attend several talks on other web frameworks before presenting. I'd say that the one closer in concept and execution to Phobos is Django. It was great to listen to Django's mastermind, Adrian Holovaty, describe his creation at the conference. I suspect it'd be healthy for the resurgent Jython developers to target Django with the same single-mindedness that the JRuby guys reserve for Rails. Should Jython become Djython?
As it often happens, at the conference I was asked what container Phobos runs on at development time (we sport a sub-2-second startup time there too). Here's the answer: when you run a Phobos application inside NetBeans, it starts a Grizzly-based lightweight web container which does not depend on the servlet machinery. Currently we pretty much gather all the jars that we need and load them together using a child classloader of the NetBeans' one. Of course, since nobody likes maintaining multiple code branches, the plan is to switch to a GlassFish v3-based runtime as soon as possible. An important direction for Phobos from the very beginning was to validate the feasibility of a really small, really fast container. This had the side-effect of offering a convenient target for GlassFish v3: being a new, unencumbered container, Phobos was easy to integrate from the beginning. The fact that the Phobos framework is container-agnostic makes it possible to deliver it as its own lightweight container (where Grizzly does all the heavy lifting) as well as embedded inside a regular web application, which is the mode you'll want to use in deployment until GlassFish v3 ships and perhaps beyond.
If you check out my slides, you'll see that I spent some time describing the notion of "soft" vs "hard" layers in an application, which from my perspective is a key reason for supporting as many languages as possible on the Java platform. Fundamentally, my thesis is that successful platforms, including ones that we normally consider applications, like Office suites, have this distinction between the "hard" layer, accessible to wizards and used to implement the platform itself, and a "soft" layer which ends up being programmable by users (or at least power users). There are more examples of this than I can quote (I listed some of them on my slides), but the interesting thing is that it's hard to come up with good counterexamples, i.e. widely successful platforms which were single-language and didn't enforce a boundary between normal use(r)s and advanced ones. And I say this with all the regret of somebody who, to this day, considers Smalltalk the work of genius.
One slide that seemed to stir the audience was the one where I went out on a limb and singled out one language as having the greatest potential of all on the JVM: Scala. What's not to like? Structural typing, first-class functions, clever integration of object-oriented and functional features, Erlang-like actors, full Java interoperability... On top of it, it gels together like a real language (yes, this is a snipe to a language whose name ends in "oovy"). The rumored addition of record types would make it really perfect; for the uninitiated, in the presence of structural typing record types capture what's become fashionable to call duck typing. In my own classification, Scala falls into the "hard" bucket, but its syntax is light enough to be usable in a larger scope. At any rate, my intent in bringing it up at the Web 2.0 Expo was to point out that there is some awesome innovation happening in and around the Java platform, and developers looking at getting an edge over the competition would be advised to learn about Scala, Phobos, Grizzly, GlassFish v3 and a lot of other Java-related things (Hadoop on Amazon EC2 comes to mind). Did I mention they are all open source?