Friday, November 10th, 2006
F3: Sun’s new declarative Java scripting language
Chris Oliver, now at Sun via SeeBeyond, has posted about a new declarative Java scripting framework that Sun will be open sourcing shortly.
My project is called F3 which stands for “Form follows functionâ€, and its purpose was to explore making GUI programming easier in general.
F3 is actually a declarative Java scripting language with static typing for good IDE support and compile-time error reporting (unlike JavaScript...), type-inference, declarative syntax, and automatic data-binding with full support for 2d graphics and standard Swing components as well as declarative animation. You can also import java classes, create new Java objects, call their methods, and implement Java interfaces.
We have IDE plugins for both Netbeans and Eclipse Both plugins support as-you-type validation, code-completion, syntax highlighting, and hyperlink navigation (with control-mouse-over).
F3 attempts to demonstrate that we're not exploiting the full capabilities of the Java platform for GUI development and that together with supporting tools like F3, the Java platform is highly competitive with or superior to competing GUI development platforms such as Macromedia Flash/Flex/Open Laszlo, Adobe Apollo, Microsoft WPF/XAML, Mozilla XUL, AJAX/DHMTL.
Example
-
-
import f3.ui.*;
-
import f3.ui.canvas.*;
-
import f3.ui.filter.*;
-
-
Canvas {
-
content: Text {
-
x: 20
-
y: 20
-
content: "Welcome to F3"
-
fill: LinearGradient {
-
x1: 0, y1: 0, x2: 0, y2: 1
-
stops:
-
[Stop {
-
offset: 0
-
color: blue
-
},
-
Stop {
-
offset: 0.5
-
color: dodgerblue
-
},
-
Stop {
-
offset: 1
-
color: blue
-
}]
-
}
-
filter: [Glow {amount: 0.1}, Noise {monochrome: true, distribution: 0}]
-
}
-
}
-
would produce:
And then a demo of a flash port that took a couple of days:
I think that we all feel that GUI work could be easier than Swing currently is. I wonder if a new language that is a hybrid of Java and JavaScript makes sense, or if they could use the latest ECMAScript?












Seems to be rather similar in idea and syntax to the Enlightenment project’s Edje. Edje has been around for something like 5 years now.
The missing link: F3 - from Chris Oliver’s blog.
You should also check out Groovy, particlularly their implementations around both SWT and Swing
http://groovy.codehaus.org/Home
regards
Al
Note that the original URL for this is here:
http://blogs.sun.com/chrisoliver/
Wasn’t sure why there isn’t a link back to the original site….
Flash killer. Datestamp it.
Flash killer? no way! Did you see that flash port thing?? Its a flash port! Means a flash port..means a flash dependent..not a flash killer..its a flash subset. It may be superior to javascript , in the sense that there is not JS IDE[poor Netscape, those loosers are cloning Digg and shit, missing the serious game.Lamers!]
oh and look at that screenshot..its amazingly lame! Poor rendering! I think they are competing with a future Microsoft release,of some Flash killer.
[...] Chris Oliver, now at Sun via SeeBeyond, has posted about a new declarative Java scripting framework that Sun will be open sourcing shortly.read more | digg story Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [...]
yawwwn !
Hmm.. If you want to declarative programming and automatic databinding, in pure Javascript, in pure Open Source, keep your eyes peeled for the next couple of weeks for the Javeline Platform SDK. I’ve been following the beta for a while and it is quite nice…
Great work by Chris. Will try this out pretty soon.
If you get tire of working with braces, give jython a try. For a simple example:
http://www.uselesspython.com/Jython_Swing_Basics.html