Tuesday, May 08, 2007

JavaFX vs. Flash vs. DHTML vs. Silverlight

It's becoming a bit saturated in the "Web 2.0" space right now, as Sun announced a new UI framework called JavaFX today. The UI language/compiler is new, but it runs on the same old JRE with Java Web Start.

Installed base: Sun definitely has the installed base to try this. Java is available on 75% of browsers or something like that (as opposed to Flash, which is around 85%, and Javascript, which is more like 98%). I still can't figure out if JavaFX actually runs in a browser though. All of their examples use Java Web Start. Microsoft has a tougher task. Sure, IE is on everyone's desktop, but how many people have Silverlight or .NET 3.0 installed at this point? Whatever that number is, it's almost exactly the same number of people that are running Vista. Still, it takes only one popular site to use this stuff to get it going for any of these technologies.

Appeal to devs: I think the appeal of Silverlight and Java FX is that they're using the same tech that the server side is using. This is why they're going to get some momentum. Flash and Javascript gurus are in short supply. Being able to code an end-to-end solution in Java or C# is very appealing. Plus, the development tools for AJAX/DHTML are so poor that everyone has started writing server side wrappers around the stuff to make it not suck.

Memory footprint: If you haven't noticed that Java has an absolutely ginormous memory footprint, you've never used it. Running the test app for Java FX, Java FX Pad, takes 65 megs of RAM on my machine -- and that's one canvas and one textbox. Granted, I think most of that is the runtime, but it launches a javaw.exe runtime for every app. So when I launched another demo off of their website, another 65 megs.

More random memory stats (all IE7 tests utilized a relaunch before loading website):
  • IE7 on startup at "iGoogle" home page: 8640k
  • javaw.exe running Tesla website demo: 55800k
  • IE7: Actual Tesla website in IE7 (Flash, DHTML etc): 29156k
  • Silverlight Microsoft.Com demo, after clicking on Products: 30136K
  • The real Microsoft.com (DHTML), after clicking on Products: 27740k
  • IE7: gmail.com inbox (AJAX, DHTML): 36064k
  • IE7: Yahoo Mail Beta inbox (AJAX/DHTML): 40600k
  • IE7: Hotmail light (very little Jscript): 18948k
  • Windows Mail in Vista and a full inbox: 7424k

So there you have it: Win32 wins again. Actually I think a lot of this, except Gmail and Javaw, can be attributed to imagery. That's probably why there was very little difference between Silverlight and the real Microsoft.com.

Dev tools: For Flash, you've got... Flash. For DHTML/AJAX you've basically got notepad or XEmacs, unless you're using something like GWT. For Java FX we've got netbeans with no UI designer, and for Silverlight we've got Visual Studio Orcas with a designer. I think we know who wins this battle.

Brand Name: Flash is very indentifiable at this point. So is Java, but I hate the name Java FX. Some marketing guys with little ponytails, cooped up in Sun Quentin for too long, must have come up with that name. Or they must have thought the "WinFX" code name for WPF was a good idea (not that WPF was a good name... it's too close to "WTF"). Silverlight's a pretty good name, but it reminds me of Clearsilver. Javascript and DHTML have no brand name, people don't know what they are and often confuse them with Java (+1 to Sun on that one).

Early call: First off, I just don't see the bizarro Flash apps taking over... ever. I've seen good Flash UIs very rarely, it's mostly good for crappy video, annoying advertising and for stupid flash movies. Java FX and Silverlight have a chance, but I think it's going to take a killer website to get it rolling. Microsoft is fortunate to have a built-in audience, and Sun is fortunate to have millions of Java developers who adopt every framework ever made for the language.

My take: We're still headed towards JITted Javascript, my friends. It's an ugly, ugly future.

3 comments:

Anonymous said...

Hmmm... I am not saying you are entirely wrong... You seem to know AJAX/DHTML to some extend, but from what I read, you haven't used AJAX/DHTML that much, have you? Working with AJAX isn't as bad as what you wrote in the article.

Trimbo said...

It's true, I haven't written sites that use JS to the extent of Gmail, but I've put together pages intended to be used in an embedded browser with a Javascript API, using Prototype.

Counter-question... have you used Silveright and C#, or Visual Studio?

Mattias said...

Java memory footprint is high, but not THAT high. First of all launching a javafx applet, embedded in a web page (but draggable outside of the webpage), is by defualt launched within a common shared JVM. Applets (javafx or not) can request to launch in their own JVM though, if they are big and need the resources etc. Launching JavaFX programs through Java Webstart will create a JVM for each. I don't see the need to launch with Java Webstart, that is more for installating and launching standalone software on your computer, not embedding in/replacing a webpage.

Even so, multiple JVMs running on the same machine share parts of their memory. You should also check HOW you get those numbers, private working set? "WS private" in process explorer for example. There you can also see how much is shareable. For example, a javaws process I have right now seems to use 40MB, in reality it is 27MB in current use (other stuff is paged out by the OS and not used) of which 13MB are shareable with other processes.