JavaFX: Beautiful language | May 10th, 2007
Keeping with the rich client times, I was having a quick look at the brand new JavaFX scripting language and came across some really interesting additions.
JavaFX is declarative and statically typed but from the examples feels very terse. It reads quite naturally. I like it.
Creating guis with swing for example:
Frame {
content: Button {
text: "Press Me"
action: operation() {
System.out.println("You pressed me");
}
}
visible: true
}
Neat. Clean, and dare I say, easier to read than markup. I remember a really smart guy I know proposing a similar approach for declaritive user interfaces recently. Eh Dave? =)
It gets better, Arrays get some much needed love in the form of XPath and XQuery syntax additions. I love how this reads:
var nums = [1,2,3,4]; // just a regular array insert 5 into nums; // yields [1,2,3,4,5] woah! var numsGreaterThanTwo = nums[. > 2]; // yields [3, 4, 5]
Beautiful!
Great things happening for user experience focused developers with more options than ever before. Things are heating up with Flex, JavaFX and possibly Silverlight seeking to rule the next web. I’ll be sticking with Ajax for the time being but I’m really enjoying how this is all playing out. XPath and XQuery treatment for non xml structures, eh.. hmmm.
May 12th, 2007 at 11:54 am
Good stuff here Brian. It even prompted me to formulate some of my own thoughts about JavaFX Definitely love the declarative approach and selector stuff - both awesome approaches!
XQuery and XPath for non-xml indeed but what about SPARQL and RDF …