F3
Chris Oliver's "Form Follows Function": a statically typed, declarative scripting language for Java GUIs that Sun renamed JavaFX Script in 2007.
Created by Chris Oliver (Sun Microsystems)
F3 (“Form Follows Function”) was a declarative, statically typed scripting language for building graphical user interfaces on the Java platform. Chris Oliver created it at Sun Microsystems and described it publicly in November 2006. Programs described a GUI as nested object literals rather than a sequence of Swing method calls. Values could be bound to one another so that a change in one updated the other automatically, the way a spreadsheet updates formulas. Six months after F3’s public debut, Sun renamed it JavaFX Script and made it the language of its new JavaFX platform.
F3 itself never had a numbered public release under its own name, so its history is short. It still matters because it was the prototype for Sun’s main attempt to compete with Flash, Flex and Silverlight. Its central idea was a declarative UI tree with reactive bindings. That idea outlived JavaFX Script and became common in later UI frameworks.
History & Origins
From SeeBeyond to Sun
Oliver introduced himself in his first F3 post: “I came to Sun through their acquisition of Seebeyond in September 2005.” SeeBeyond made business-integration software. He said the project’s purpose “was to explore making GUI programming easier in general.”
An accidental announcement (November 2006)
Oliver’s weblog post titled simply “F3” appeared on blogs.sun.com on 8 November 2006. It said the work was “not public yet but it should be open-sourced on java.net shortly,” and described the language this way:
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.
He listed working plugins for NetBeans and Eclipse with as-you-type validation, code completion, syntax highlighting and hyperlink navigation. He also mentioned a translator that could convert “most of SVG to F3”. He placed F3 against “Macromedia Flash/Flex/Open Laszlo, Adobe Apollo, Microsoft WPF/XAML, Mozilla XUL, AJAX/DHMTL,” and argued that the Java platform was “highly competitive with or superior to” them for GUI work.
Artima’s Java Community News picked up the post two days later, on 10 November. Commenters on the original post asked whether F3 was compiled. Oliver replied on 11 November: “It’s interpreted, currently. Once its on Java.net and we feel the language syntax has stabilized one of my goals is to experiment with translating to Java byte code.” He also said the language did not require Swing, but “all of the current GUI support is tightly coupled to AWT/Swing.”
More posts followed over the next six weeks. They included an interactive F3 tutorial, demos run as separate applications inside one JVM (each with its own F3 interpreter, class loader and event-dispatch thread), the reflection and query operators, and an XHTML renderer integration. On 19 December 2006 Oliver answered the many questions about availability:
For the record, I actually inadvertently made F3 public. I was just testing out my weblog. I thought it would reside in obscurity for the time being.
He gave the future home as f3.dev.java.net, which was “still private and doesn’t contain the source code yet,” and guessed that February 2007 was likely for its opening.
Becoming JavaFX Script (2007)
The F3 name never got a public release. At JavaOne on 8 May 2007, Sun announced JavaFX, a family of client products that included JavaFX Mobile. InfoQ’s report the same day called JavaFX Script “a rebranding of the internal Sun F3 project.” Sun said it planned to open-source JavaFX, and the language moved to the OpenJFX project on java.net. The language reference published there in May 2007 still described the interpreter-era language. It referred throughout to “the JavaFX interpreter.”
In July 2007 Sun released the source of the OpenJFX compiler. Chet Haase, Sun’s chief client architect for Java, told InfoWorld that the goal was to “compile an entire program.” By the time JavaFX 1.0 shipped on 4 December 2008, JavaFX Script was a compiled language.
Design Philosophy
The name came from the architectural maxim “form follows function.” Oliver’s argument was that the problem with Java GUIs was the programming model, not the platform. Java2D and Swing could already draw anything that Flash could. What they lacked was a concise way to describe a UI and keep it in sync with the program’s data. F3 offered three things:
- Declarative structure. A UI is written as nested object literals that mirror the scene’s tree, much like markup, but checked by a type system.
- Static typing without ceremony. Types are inferred where possible, so scripts stay short while the IDE can still report errors as you type. Oliver set this against JavaScript.
- Full Java interoperability. F3 code could “import java classes, create new Java objects, call their methods, and implement Java interfaces,” so every existing Java library was available.
Oliver was openly against using XML as a programming language. In a December 2006 post he called himself “not a fan of XML,” while acknowledging HTML+CSS as “the most useful tool available for composing styled text.” That position separated F3 from the XML-based UI languages of the time, such as XAML, XUL and OpenLaszlo’s LZX.
Key Features
Declarative object literals
This is the first example in Oliver’s November 2006 post. It draws a rounded rectangle on an F3 canvas:
| |
The same post showed gradient fills, image filters (Glow, Noise) and SVG-style Pattern texture fills. These were the 2D features that his SVG-to-F3 translator relied on.
Binding, triggers and the rest of the language
The May 2007 JavaFX Script reference documents the interpreted language that F3 had become. It defines the language as “declarative and statically typed” with “first-class functions, declarative syntax, list-comprehensions, and incremental dependency-based evaluation.” The main features were:
| Feature | What it did |
|---|---|
bind / bind lazy | An attribute initializer that stays up to date as its inputs change, either immediately or only when read. The reference compares these to “cells in a spreadsheet that contain formulas” |
trigger on ... | SQL-like triggers that run on object creation, or on insert, delete or replace of an attribute value. These replaced constructors and setters |
function vs operation | function bodies were a pure functional subset (variable declarations and a return). operation was a full procedure with loops, try and so on |
| Cardinality | Types could be marked ? (optional), + (one or more) or * (zero or more). Multi-valued attributes were arrays |
inverse | Declared two-way relationships between attributes, which the interpreter kept consistent automatically |
select / foreach | List comprehensions with from ... in ... where clauses |
insert / delete | Statements that modify arrays in place (insert x into, before, after) |
[a..b], [a,b..c] | Range expressions for arithmetic series |
format as | String, number and date formatting through Java’s formatter classes |
do / do later | Run code on a background thread, or queue it on the Swing event thread |
This is the binding example from that reference, cut down:
| |
Oliver’s December 2006 posts showed some less common operators. order by was a binary operator in which . referred to the current element “as in XPath”, so [1, 2, 3] order by -. yielded [3, 2, 1]. Reflection was written with brackets, as in foo[bar] = 2. The # “stringify” operator turned an object reference into a URL, and ? turned it back. That let HTML hyperlinks call back into the running application.
Evolution
F3’s history after 2007 is mostly the history of JavaFX Script. The main stages are:
| Period | Form | Implementation |
|---|---|---|
| Nov 2006 – May 2007 | F3, internal Sun project, shown on Oliver’s weblog | Interpreter (Java), NetBeans and Eclipse plugins |
| May 2007 – mid-2008 | JavaFX Script, open-sourced as OpenJFX | Interpreter, while a compiler was developed from July 2007 |
| Dec 2008 – 2010 | JavaFX Script in JavaFX 1.x | Compiler (javafxc), GPL |
| Sept 2010 | Oracle announces JavaFX Script will be discontinued | Community fork Visage announced by Stephen Chin |
| Oct 2011 | JavaFX 2.0 ships as a pure Java API | JavaFX Script no longer supported |
| Apr 2012 – Aug 2015 | F3 revival, published on GitHub in 2015 | Fork of the GPL JavaFX compiler |
The F3 revival (2012–2015)
The F3 name returned in 2012. The unktomi/form-follows-function repository on GitHub, described as “F3 Programming Language”, begins with an “initial import” on 8 April 2012. Its README says it is “a work in progress - resurrecting the F3 programming language.” Commits are attributed to a christopher.d.oliver address, so the revival appears to be Oliver’s own work, although the README does not name him. The commit history predates the GitHub repository itself, which was created in March 2015. The code is a renamed fork of Sun’s JavaFX compiler: the source headers still read “Copyright 2008-2009 Sun Microsystems”, the license is GPL version 2, and the tools are named f3, f3c and f3doc.
The revived language went well beyond the 2006 design. The README lists “Lazy and reactive self-adjusting computation with mutation,” “Higher order functions. Higher order generics. Implicit values a la Scala,” and a syntax with keywords such as is, of, from, to and the. The repository also has binding modules for libraries such as JBox2D, JBullet, FMOD, Assimp and Awesomium. Of the 478 commits, 74 date from 2012, 244 from 2013, 157 from 2014 and 3 from 2015. The last one, on 30 August 2015, ported the code to Java 8.
Current Relevance
F3 is a historical language. There is no maintained implementation. The original interpreter was never released under the F3 name. The java.net project pages and Sun’s blogs.sun.com are offline, although the Internet Archive has preserved Oliver’s 2006 posts and the 2007 language reference. The 2012–2015 revival is still on GitHub as source code with Ant build files, but it has been inactive since 2015.
JavaFX itself is still actively developed as a Java library under OpenJFX. Its connection to F3 is historical rather than technical, since JavaFX Script was dropped in 2011.
Why It Matters
- It was the start of JavaFX. F3 was the language Sun chose for its main rich-client effort of the late 2000s, and the platform that came from it is still in use.
- It combined reactive binding with static typing. F3 joined declarative UI trees, compile-time type checking and spreadsheet-like
bindin one language for a mainstream platform. Declarative component trees with automatic updates later became the standard approach in UI frameworks, though this page does not claim that F3 directly influenced any particular one. - It started as a one-person project. One engineer showed most of the language and tools on a personal blog before there was a product plan. In his own account he did so by accident.
Sources and Verification Notes
- Oliver’s posts of 8 November, 12 December, 14 December and 19 December 2006 were read in full from Internet Archive copies of blogs.sun.com/chrisoliver. All quotations from Oliver are taken from those copies.
- The May 2007 JavaFX Script Programming Language reference (openjfx.dev.java.net) was read from an archived copy.
- The JavaOne date and the “rebranding of the internal Sun F3 project” wording come from InfoQ (8 May 2007). The compiler release comes from InfoWorld (20 July 2007).
- The Artima pickup is dated 10 November 2006 on Artima’s forum thread 184337. Haase’s quote and title (“Sun Java chief client architect”) are from the InfoWorld article of 20 July 2007.
- The 2012–2015 revival dates, per-year commit counts, license and copyright headers were checked directly in the Git history of
unktomi/form-follows-function. - The JavaFX 1.0 date (4 December 2008), the September 2010 discontinuation, the Visage announcement and the October 2011 JavaFX 2.0 release come from Wikipedia’s JavaFX Script article and the sources it cites. They were not re-checked against Sun or Oracle primary documents.
- The encyclopedia’s master list gives F3 as 2007, which is the year of the JavaFX Script rename. This page uses 2006 because Oliver’s public description of F3 is dated 8 November 2006. When he started work on F3 is not documented.
Timeline
Notable Uses & Legacy
Sun Microsystems' JavaFX platform
F3 became the language of JavaFX. Sun renamed it JavaFX Script at JavaOne 2007 and built JavaFX 1.0 (December 2008) around it. JavaFX was Sun's answer to Adobe Flash/Flex and Microsoft Silverlight.
Flash, DHTML and OpenLaszlo replicas
Oliver's first F3 post showed F3 copies of existing Flash and DHTML programs. He said each took about two days to write, though he called the second one incomplete. One copy reused the design and SWF assets of the OpenLaszlo Amazon demo, and a commenter from the OpenLaszlo side asked him to give proper credit.
Exhibit-style data browser
In December 2006 Oliver wrote a partial F3 version of an Exhibit example. Exhibit was an AJAX data-visualization tool from MIT Libraries. He used the demo to show F3's reflection and query operators and said the filtering and sorting took three lines.
XHTML/CSS editor on Flying Saucer
A December 2006 prototype wrapped the Flying Saucer Java XHTML renderer as an F3 widget. It validated XHTML and CSS as you typed, using the W3C CSS validator, and could embed live F3 Swing widgets in the page through an HTML object tag.