Announcing Visage – The DSL for Writing UIs
steveonjava | September 27, 2010I am pleased to announce the Visage Language, a domain specific language (DSL) for writing user interfaces.
User interface developers have long been neglected and forced to deal with languages and tooling that are a poor fit for their craft. At times they are asked to write user interfaces in languages originally meant for server-side applications such as C and Java. In other instances they are required to use a markup language originally meant for representing documents or structured data such as HTML and XML. These are fine technologies for the applications in which they were originally intended, but a weak substitute for declaring and representing user interfaces.
The goal of Visage is to provide a common language for user interface developers that provides the following benefits:
- Model the UI – The code should look like the user interface with a similar structure to how the resulting application will appear.
- Data Binding – All user interfaces have a backend model, so it should be easy and painless to hook this up to the UI with bidirectional integration.
- Resilient Behavior – The last thing you want to see during a customer demo of your new application is a NullPointerException. Language constructs should have deterministic, but fault tolerant behavior in all cases.
- Rapid Development – Application development should allow rapid, iterative cycles with early feedback starting right at the compilation phase.
The way in which Visage satisfies these requirements is summarized in the following table:
| Model the UI | Data Binding | Resilient Behavior | Rapid Development | |
| Object Literals | X | X | ||
| Closures | X | X | X | |
| Data Binding | X | X | X | |
| Bijective Binding | X | X | X | |
| Null-Safe Semantics | X | X | ||
| Strong Type Checking | X | |||
| Compiled Language | X |
So what does a Visage application look like? Here is Hello World in the Visage language:
Stage {
title: "Hello World"
Scene {
Text {
"Hello World"
}
}
}
This code should look familiar to readers of my blog. It is based on the JavaFX Script language with a few (proposed) syntactic additions.
For those of you who don’t know the history of JavaFX Script, it was originally designed by Christopher Oliver and called F3 for Form Follows Function. With the acquisition of SeeBeyond by Sun, this technology became the cornerstone of JavaFX and was open sourced in 2007 at JavaOne. Oracle purchased Sun and just this past week at JavaOne 2010 announced that they are going to continue with the JavaFX Platform, but replace the JavaFX Script language with Java APIs. We are adopting the JavaFX Compiler for use in the Visage project, and plan to continue evolving it.
Here are some of the goals of the Visage project:
- Provide a JavaFX Java API Binding – One of the most innovative parts of the JavaFX platform was the language, and it is what all JavaFX applications are written in today. Our number 1 project goal is to make sure that developers can continue to write declarative code and easily port over their existing applications.
- Enhance the Visage Language – The language syntax remains largely unchanged since the 1.0 release of JavaFX. We plan on making numerous improvements that will be beneficial to UI programmers and make common patterns easier to code.
- Support for Other Platforms – For the Visage language to thrive, it has to be a general purpose UI programming language. Some other platforms that are in great need of a UI DSL include HTML5, Flex, and Android.
- Language Standardization – We would like to see the Visage language be made an official standard with possibly multiple implementations.
If you are interested in following the project or helping out, please join the Google Groups:
http://groups.google.com/group/visage-users
http://groups.google.com/group/visage-dev















