Skip to main content

Browser makers walled javascript garden

Posted by robogeek on August 27, 2008 at 12:07 PM PDT

Why JavaFX should be inlineable with HTML raises an interesting question in my mind. He's making a number of suggestions about JavaFX and many boil down to the power of "View Source" and perhaps JavaFX script code should be directly runnable as part of the source of a web page.

That's an interesting suggestion and maybe it would work well. It remains to be seen whether that equation could be implemented from a technical standpoint. However there's a non-technical control point which is in the way.

The browser makers so far have forced the web side programmers of the world into using exactly one language for scripting web pages: Javascript

Maybe this is dangerous ground to walk because of all the history. But it really strikes me as a walled garden which prevents other technologies from taking part in scripting behavior on web pages. Javascript a.k.a. ecmascript isn't a bad language, and clearly a lot of things can be accomplished with it. But why is that the only language which can be used?

Related Topics >>


Oh, and yeah, "view source" doesn't work. That is NOT a feature. You want to hide your code, start your own internet. ;)

I don't think there's been a call on the Web developer side for non-Javascript scripting. It's already extremely hard to get a Javascript application to behave the same across browsers. If the web browsers can't get that right, how is adding another language going to help? On the other hand, there's a lot to be said for the plug-in approach such as Adobe's Flash (yes, I know, boo hiss, but hey it works). You don't have to depend on the browser developer (especially Microsoft). Unfortunately then you have to convince all your users to install the plugin. Adobe does this by making it painless and as close to automatic as possible. Sun is making strides in that direction, but they're not quite there yet.

Can Flash be inlineable with HTML ? It don't think so. So, why inlining JavaFX with HTML ? At first sight, 'no', but it might bring opportunities, for example, if, similarly to GWT, JavaFX is compiled to HTML+JS. This being said, of course, there is a kind of race between HTML+JS versus other platforms. But while JS may gain more market, this language should become more complex to deal with complexity other languages are already facing. One example: doing AJAX request on client-side raises the thread race pb and then, AJAX frameworks have to deal with that pb. Another example: while AJAX scripts become longer, "programming in the large" raises pbs better resolved by using a typed language, at least, more typed than JS. And another point is that Java has a standard library and is more standard than JS (accross all the browsers). So, language market share evolution is still unclear. Looks like future is still open, and that's interesting.

Thers is also a discussion of Chui's arguments on javalobby: [] He and I (cfagan) go back and forth on this, but he stopped posting my replies so the conversation ended. I'm not sure using a prerpocessor with JavaFX really gives buys you anything. What can you generate that you can't just write?

@janerik: agree. there're not many ui designers and sun is not adobe ;) anyway, the fact that the ajax to java guys ratio is 1000 to 1 is perfect - that's actually why i can earn more as java guy :) am just wondering from which community will sun grab designers :P because adobe is making programmers from designers and that's pretty straightforward way ;) jfx will have a hard time, unfortunately.

On IRC Mark Weillard suggested the following: But you might want to look into GWT (Google Web Toolkit) if you want to "script" in java through javascript. so, yeah, it lets you write a web app using "Java" source code. But in the end it's still participating in the walled garden of javascript-only.