User loginNavigation |
archivesSun's new JavaFX Script languageSun recently announced JavaFX Script, a new Java-based scripting language designed for use with Sun's nascent rich interactive application development platform, JavaFX. JavaFX Script is statically typed, but it seems heavily influenced by dynamic languages like Python and JavaScript. JavaFX Script provides an unusual declarative syntax intended to facilitate rapid interface development and it has some interesting features like support for first-class functions and Pythonic list comprehensions. The language also has some really unusual array manipulation operators that are somewhat thought provoking. Here are a few samples to consider: var titleTracks = select indexof track + 1 from album in albums, track in album.tracks where track == album.title; select n*n from n in [1..100]; function factors(n) { return select i from i in [1..n/2] where n % i == 0; } x = [1,2,3]; insert 10 as first into x; // yields [10,1,2,3] insert 6 after x[. == 2]; // yields [10,1,2,6,3] You can also find some good examples of the declarative interface design syntax in Sun's JavaFX Script tutorial for Swing developers. -- Ryan Paul Pickler CombinatorsPickler Combinators, Andrew Kennedy 2004.
This is a very pretty functional pearl, which is both useful and illustrates some nice semantic principles. |
Browse archivesActive forum topics |
Recent comments
22 weeks 20 hours ago
22 weeks 1 day ago
22 weeks 1 day ago
44 weeks 2 days ago
48 weeks 4 days ago
50 weeks 1 day ago
50 weeks 1 day ago
1 year 5 days ago
1 year 5 weeks ago
1 year 5 weeks ago