The Revolution will be programmed, Part III

16.10.2009
In (which was online only) I continued my exploration of a cool programming system called , focusing on the tool's object-oriented, event-driven architecture. This week we'll look at the product's English-like language, a style referred to as by some cynics.

Here's a thing about Revolution scripting language; it is, indeed, kind of "wordy." Want to put a rounded-up value into a field shown in the user interface?

put round(22.3) into field "Number"

You can also use the "the" form when using a function such as date that takes no or just one parameter. Thus the following lines are equivalent:

put date() into field "field1" put the date into field "field1"

You can also "get" values from functions or variables. This command, along with a number of others, such as such as convert (which reformats dates and times), read from file, and ask and answer (which both display dialog boxes), stores the result in a special variable called "it". For example:

on mouseUp answer "Go where?" with "Backward" or "Forward" if it is "Backward" then go back else go next end mouseUp

Revolution has some interesting language features of which "chunking" is one of the most powerful. Chunking provides an easily specified and understandable way of breaking text into sections. Revolution's chunking lets you extract or edit a character, word, line, item or tokens.

The first three chunk types are obvious. Items are defined by being delimited by any character you specify, while token chunks are delimited by any of a range of punctuation marks (these are useful for parsing things like scripts and URLs). Here's an example of extracting a word chunk consisting of the first three words from a user interface text field:

put word 1 to 3 of field "text" into myVariable

Revolution also has some features that make designing user interfaces remarkably easy. One of these is the geometry manager, which specifies how objects should be scaled and positioned when a user resizes a window. This is a really clever feature because it provides a practical methodology for maintaining the user experience at varying screen resolutions.

Revolution is extensible through libraries and, for example, the system includes an XML library for reading, editing and creating XML data. This library is OK but not the best choice from a functionality and documentation viewpoint (it is one of the few areas where Revolution is weak on explanation).

There are two ways to overcome these problems: The first is to use the excellent from Sons of Thunder Software. The second is to use the chunking features of Revolution scripting -- somewhat easier than XML libraries but less flexible.

While Revolution is on the wordy side it is also quite easy to follow with little of the obscure syntactical "techiness" that makes many other modern languages hard to learn. Revolution also lends itself admirably to rapid iterative design processes such as user experience engineering.

What's amazing is that Revolution scripting works so well cross-platform and the publisher provides a lot of guidance on how to make applications function correctly on all of the supported platforms.

I've focused on client side programming with Revolution but there's a whole other side to Runtime Revolution: It can produce code for deployment as Web content (with the RevWeb browser and can be used for server side programming.

Runtime Revolution comes in four versions: Revolution Media ($49); Revolution Studio ($249), which adds database access and XML libraries; and Revolution Enterprise ($499), which, among features such as CGI functionality, adds premium support.

I love Runtime Revolution. It is one of the most exciting development products I've reviewed and its potential as an IT tool or rather, toolkit, is enormous.