Skip to main content

JavaFX Script is dead, long live Visage

Posted by fabriziogiudici on September 27, 2010 at 12:52 PM PDT

So, one of the big news from JavaOne is the death of JavaFX Script. Very bad news. A few people think it's good since Oracle will better focus resources, but it sounds as they are reasoning in the past. Over are times of the Java steward being in lack of resources, as it happened in the last Sun years. In the past, Sun dismissed a project mostly when they couldn't afford it; now Oracle dismisses what they think isn't interesting for their business. Since from the January announcements, when Oracle said it would go on with NetBeans, but "leave other languages support to the community", it was clear that Oracle has no interest in other languages than Java. I think it makes sense (for them), it doesn't hurt me personally, as I don't have any special interest in other languages; it should make some parts of the community sad, and not happy.

In any case, while I don't believe in the Next Big Language (for now and the foreseeable future), I do like DSLs. The inner-DSL capability of Scala, for instance, is the only thing that would attract me, too bad they want me to buy the whole pile of features of Scala, and they are too many. So, in the end it's ok for me to have a small, focused DSL with its tools instead (now, please, this is not a Scala post and don't comment about Scala).

Figure out what, one of the places where a DSL makes sense for me is when designing and implementing a UI. Being a mostly declarative task, where layout must anyway be mixed with behaviour (thus making XML mostly unfit), and being Java not declarative at all (hence the origin of typical problems, such as NetBeans not allowing modifying the Swing code it generates for the UI), you get the reason why I'll miss JavaFX Script.

Or not? Stephen Chin announced at J1 the project Visage: “a domain specific language (DSL) designed for the express purpose of writing user interfaces.”. The code is basically a fork of the original JavaFX compiler and it's GPL v2 licensed.

Since I'm used at trying to look at good things in bad situations, Visage has got even some better opportunities than JavaFX Script: it's decoupled from the actual widget toolkit (that is, it's not only a JavaFX/Swing thing) and it's not an Oracle product - thus I hope it's perceived as a neutral thing in the Oracle - Google war; in other words, I hope Google has not any adverse prejudice on it. You get my point, I'd be delighted to see Android supporting it (not expecting that Google should work on it, just not boycotting it).

It will need some IDE support, of course, even for visual designers.

Of course, it's also a matter of us, the community, to embrace it to make it successful.

Related Topics >>

Comments

Visage

I'm not much in GUI DSLs right now, but I can see some benefits of them. This Visage project looks interesting. Thanks for the link!

Why lament?

"In any case, while I don't believe in the Next Big Language (for now and the foreseeable future), I do like DSLs. The inner-DSL capability of Scala, for instance, is the only thing that would attract me, too bad they want me to buy the whole pile of features of Scala, and they are too many. So, in the end it's ok for me to have a small, focused DSL with its tools instead (now, please, this is not a Scala post and don't comment about Scala)." I respectfully disagree. It is only pure Java community that sees and seeks the "next big language" among the ideas of its own thought leaders and the derivatives (e.g. DSL being M. Fowler's favorite). There is certainly a language that has very significantly surfaced in the past two years as the language of choice for very many developers - Objective-C. It is funky, it is niche but it is a language of very many developers who are also making money from programming as individual contributors. With iPad this trend is only going to continue - Java (on Android) and Objective-C will most likely grow to be languages of choice for the next generation of developers. Regards, Edmon http://it.toolbox.com/blogs/lim

I hope this project goes ahead...

Without JavaFX Script, the best "plan B" (to old, verbose Java) seems to be building a equivalent DSL inside some extensible, high-level language. My opinion is that Scala is that only true choice, because it's statically-typed and efficient like JavaFX Script and Java. Other langs like Groovy, Clojure, JRuby etc. can have JavaFX support that's just as good in terms of tight code and special syntax, but they won't ever fill JavaFX Script's shoes completely. Certainly not for most people coming from Java (and that's a ton of people).

The problem is that Scala fails in another requirement - it's not a simple language that could attract many developers coming from either Java or AS3. I'm keen to really learn Scala for the single purpose of using it to program JavaFX 2.0 when that's available, but I don't think this will be a very popular option.

Another important factor is light weight. I don't want any language that comes with a runtime jar of several megs. When JavaFX 2.0 ships, its own extra runtime will be basically "free" (in extra downloading time or resource usage) as Oracle controls the whole Java stack, and they can and will do things like bundling JavaFX with JRE (or loading it in background from JavaKernel), or updating the browser plugin to be completely free of AWT dependencies and be able to run the much leaner Prism stack, or writing (even more) part of the runtime in native code as necessary for both performance and loading time / resource usage (binary libs signed by Oracle have the privilege of not asking the user to click through a security dialog). But if you write your RIA app in JavaFX 2.0 + Groovy, your HelloWorld is suddenly a 5Mb download... this just won't fly, at least for internet apps.

Mirah is actually a (potentially) better alternative

Well, Mirah is still in its infancy but looks promising: (J)Ruby syntax, static typing and *zero* runtime dependencies. I'm watching this one closely. Link: http://www.mirah.org/ Cheers, -Alex

Re: Scala as the only choice

Actually I would argue Groovy is a better choice. The static vs dynamic argument has seen a lot of electronic ink to be repeated once more. Groov has metaprogramming capabilities (both at runtime and compile time) that far greater exceed what Scala can offer at the moment. It's true that Groovy imposes a 5M download with the current 1.7.x developmenet line, however the upcoming 1.8.x (if not 1.9.x) will provide a modular design, which means leaner and smaller jars for the using the core features.