Questions for Sun over JavaFX
Sun has released a JavaFX preview. Having played around with it, here are my questions.
- Will using the scenegraph API conceivably consume less resources than a comparable app developed using DHTML? In Meebo is what’s wrong with web 2.0 (cached), Uncov writes that Meebo consumes 39Mb RAM over-and-above that of Firefox. Running a basic JavaFX app (JRE1.6u7) consumes about 33Mb “VM Size”, i.e. private process memory. Is JavaFX going to ditch flyweight rendering in Swing's JTable and switch over to Scenegraph-based tables instead?
- Why is interpreted JavaFX script slow, when interpreted javascript is fast enough for client-side work? Web apps don’t necessarily have to compute prime numbers. Is it because browser's javascript interpreter (gasp) is more performant than the JVM?
- Silverlight will consume markup generated from any web server. JavaFX requires a server-side compiler, or a precompiled script. Any client-side plugin ignores PHP at it’s own peril. Will Sun be shipping a JavaFX Script interpreter so that the browser can be used as a general canvas?
Article Type:
Opinion/Editorial
(1 vote)
- Login or register to post comments
- 5529 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
Brian Sayatovic replied on Thu, 2008/08/21 - 9:20am
I honestly don't understand why Sun felt the need to build JavaFX. I don't think ease of development is what has been holding back Java from proliferating beyond the enterprise.
To Chui's point about Silverlight being markup capable of being generated by any server, I think that is the key. OpenLaszlo could get to this point, but they too seem too focusedon the server-side.
The only way to stop web 2.0 from becoming the next leaky abstraction is to come up with an open UI markup language that is NOT tied to any one programming platform.
David Lee replied on Thu, 2008/08/21 - 10:23am
in response to: Trinition
Jacek replied on Thu, 2008/08/21 - 10:56am
in response to: sybrix
Jim Weaver replied on Thu, 2008/08/21 - 11:26am
The JavaFX SDK Prelease is not interpreted. It compiles to JVM bytecode and in my experience has been very performant. Interpreted JavaFX was just a prototype for the JavaFX SDK.
Chui Tey replied on Thu, 2008/08/21 - 2:35pm
in response to: jlweaver
geekycoder replied on Thu, 2008/08/21 - 4:21pm
"I realize that the SDK ships a compiler, but I assert that an interpreter would enjoy a wider audience."
Hi Chui,
can you elaborate further why interpreter would allow JavaFX enjoy a wider audience ? Is it because the code is exposed like JavaScript so that user can run change it and refresh the content easily ?
Can you tell us what are the advantages of running interpreted versus compiled when JavaFX under the hood just compile and run the script. From technical point of view, the bytecode class file is generated but from user's point of view, I did not see that it is a concern as it is all transparent and user experience isn't affect whether it is running interpreted or compiled. At least the compilation improves on the performance.
Why make JavaFX behave like JavaScript and what is the advantages of doing so ? JavaFX is designed to develop desktop-like application running not only in browser but also in desktop and mobile platforms therefore I do not think comparing with JavaScript is appropiate as it is designed to embedded in html page.
cheers....
Chui Tey replied on Thu, 2008/08/21 - 5:44pm
Thanks Geekycoder for your comments
content: [ <?php foreach ($comment in $comments): ?> Text { content: "<?=$comment>" }, <?php endforeach; ?> ]Incidentally, while I'm ranting, it'd have been better to create a class called transitions rather than animations. Effective transitions have different characteristics to timeline animations.
Patrick Wright replied on Fri, 2008/08/22 - 2:46am
As far as the interpreter, I haven't seen anybody on the compiler dev mailing list (which I've been following since it opened last year) state that an interpreter isn't possible, just that their primary goal is writing a compiler for the language. I'd like to see an interpreter for JFXS again, as the JFX Pad app was a cool way to play around with the language. But the compiled code will handle large apps better, I assume. One advantage of developing the compiler is that they were forced to specify the language accurately, and to clear up a number of open issues from the original F3 prototype--at least, that's how I see it.
Patrick
Chui Tey replied on Fri, 2008/08/22 - 5:01am
in response to: pdoubleya
and Joshua Marinacci has this to say
To be honest, a language specification shouldn't have to change regardless of whether it is interpreted or not. There may be some differences in compile-time vs. run-time type checks and exceptions, but that's about it. I believe that the assumption Sun made that compilation is always better than interpretation is errorneous, and will impede broader adoption of a fine technology.
cfagan replied on Fri, 2008/08/22 - 10:07am
in response to: teyc
- There are plenty of programmers who work in an edit-compile-run pattern. Is that any less valid?
- What you seem to want is a new, more fully featured, markup language. You goal seems to be to generate content via a preprocessor like PHP. Thats cool but it's not really what JavaFX is all about. In JavaFX you can build a presentation layer and then add data. There is no good reason to mix data retrieval and UI definition. It's just how a lot of web technologies work. Google Web Toolkit builds the same kind of separation. The power of this style is that you take the server requirements out of the rich content delivery mechanism. With cheap PHP hosting I can build a Java or JavaFX applet that consumes data generated from PHP and MySQL. It's even less intensive on the server because there is no generation of markup, just data. I can also point the same front end to a Glassfish or Jetty back end, or even to a C# web service if I wanted. When you separate your data from presentation you build MORE opportunities to build a development community, not less because you components can be consumed by a larger group.
- There is a lot of horrendous code in the wild. I won't argue that it's not informative to have a "view-source" but it's still not the bast way to get quality information on programming techniques.
- There is no benefit to inlineing as you describe. There would still need to be an applet involved. It would just be more work to generate the JavaFX then to just write the applet that consumes the important data.
- Searching/indexing is very important. There is no reason the raw data could not be indexed though, and it would be less work to parse because of the lack or extraneous markup.
- The URL? Really? You want to depend on the URL? Why? I understand it's roll in indexing is important but other then that I say the less you put in the URL the better.
- I agree Java/JavaFX enables creation of a better text-editing widgets.
- Jar files are delivered compressed with Zip or pack200. Your uncompressed example is not really valid.
- JavaFX has/will have video acceleration and do 3d. Are you complaining about the performance of a prototype interpreter?
In the end what you want could be done, if you really wanted to, but implementing hooks in the Scripting API for JavaFX, like Javascript or Groovy. I see JavaFX as an opportunity to move away from heavily server dependent generated UIs and towards richer content delivery.Richard Osbaldeston replied on Fri, 2008/08/22 - 11:05am
in response to: teyc
Chui Tey replied on Fri, 2008/08/22 - 4:08pm
in response to: cfagan
My points are about having JavaFX widely adopted.
An interpreter is a very small download. The class libraries is the bigger pig that's got to be squeezed down the tube.
Riyad Kalla replied on Sun, 2008/08/24 - 1:04am
in response to: teyc
Chui,
Excellent writeup, you don't even need to go beyond #1 in your list, #1 is *exactly* why JavaFX will never become dominate.
Developers, especially smart ones, underestimate how powerful stupid-simple can be sometimes. Only time will tell, and I'm willing to bet my house and cats that JavaScript will stay dominate unless something else can come along that works in a edit/save/refresh cycle as quickly.
If you keep the compile/deploy cycle, you've immediately cut your viable user-base down to developers that are used to an IDE environment, post here at JavaLobby, and probably read Slashdot... the rest of the world will be using JavaScript while we sit here in 5 years and argue JavaFX or Air... or Silverlight... or Swing... or SWT... while everyone else continues to not care, and actually gets work done with something else we aren't discussing.
Gonzalez Flores replied on Tue, 2008/09/02 - 5:51pm
Mmmm, I agree with geekycoder but maybe You are missing one important point, JavaFX is not only for Web, with JavaFX technology you can build applications on desktop, mobile devices, and TV screens, not only on web apps."Chui Tey:
The WEB is 20 years old and Google has just announced it is able to now crawl .swf files. Commercial sites can't wait another 20 for .class files to be crawled." ?
The SWF files aren't 20 years old and Google has 20 years old either. The web is older than 20 years old, please go back to school and review your history books.
In 2028 maybe you were been using and developing with Javascript for the 3 pc's at your home, the world is moving and not everything is on HTML, not everything is a PC and a Browser.
Lets do a little exercise. Look at your pocket!, you have a cell phone( or smart phone)?, now you have your mobile device on your hands, please go to develop an application with JavaScript and PHP, push right click alter on view the source code on your mobile device, then when you have finished, do the same for your desktop enviroment, then for your TV and so on...
I'm not saying that JavaFX its a killer technology, but please focus in the real target of that technology, not in your learning curve seeing like a fetish the code of other guys.
Lets work like Riyad Kalla says!!!
Chui Tey replied on Tue, 2008/09/02 - 8:27pm
Five years ago, when developing some apps for PDAs, I'd never consider HTML + javascript. This is because there are enough form factor issues as well as browser incompatibilities to keep one awake all night. Lately, with webkit taking hold, and mobile devices becoming more powerful, it seems closer to reality.
Mobile device manufacturers do not particularly care whether you build applications in Java or HTML+javascript. All they really care about is selling more devices. Any device that can make use of existing applications (i.e. the web) is going to be important.
Just as Microsoft was careful not to break backwards compatibility from DOS to Win 3.1 to Win NT, mobile device manufacturers have a business reason to support HTML. I read this to mean browser support is only going to improve. Against this backdrop, Sun has to work very hard to woo the web development crowd, and not count on winning by default as it has in the past.