Many of our favorite applications are Web applications, ones where the user interface (UI) resides within a Web browser. Æjaks is a toolkit that expands the advantages of Web apps.
Web applications have well-known and important advantages, including:
- no need, in general, for installation, which leads to
- opportunities to manage all enhancements and accounting on the server side, and
- user-interface conventions such as hyperlinks which are widely known if weak.
Basic Web applications also have several disadvantages.
Where the Web Lets Us Down
Among these disadvantages are:
- dependence on a "live" 'Net connection;
- a relatively impoverished graphical user interface (GUI) model which generally lacks such capabilities as a canvas, or interfaces to other desktop applications including drag-and-drop functionality; and
- "pull" GUI interaction based on updating a "page" or screen at a time in response to a user selection.
Ajax addresses the third of these areas; for the last decade, Ajax has been the main base technology for "Rich Internet Application" (RIA) development in which the application can update part of the display an end-user sees, without having to refresh the whole screen and without waiting on the user to push a button. The same modern browsers which support Ajax in its reliance on the XMLHttpRequest object, also honor such parts of HTML5 as canvas.
"Raw" Ajax is clumsy to program, though, generally requiring coding in a combination of JavaScript, Java, CSS, DHTML, and perhaps other languages, with accomodation for browser differences. Because of this difficulty, Ajax is often wrapped in such toolkits as Java-coded Echo2. This is a demonstration of features, including
- configurable window management,
- translucency and other customized appearances,
- resizable SplitPanes and other modern widgetry,
- selection effects,
- table styling,
- layout geometry components, and
- "push", (displayed in Figure 1).
that Echo2 makes possible for a Java RIA developer without JavaScript or HTML coding.

Figure 1: Push, demonstrated in Echo2.
Æjaks Refines Echo2 Refines Ajax Refines Web
Even that wasn't good enough for Tom Poindexter, though. While Poindexter is best known as one of the first programmers to bind general-purpose scripting languages to relational database management systems (RDBMSs) almost twenty years ago, his own focus has moved on to Web applications. To support his efforts, he invented Æjaks as a higher-level language which, among other things, exposes all of Echo2, as well as a database access library. For his project, he chose the motto, "Because a simple to use interface should also be simple to program."
Æjaks is based on Tcl, so any familiarity with Tcl, or special-purpose libraries written in it, applies to Æjaks immediately. Among the example programs his 1.1 release includes is clock.tcl, which we paraphrase slightly here:
# clock.tcl - sample program by Geoffrey Wu
# shows off using TaskQueue, and Tcl "every" package
# ...
Pack [Column .info]
Pack [Label .info.txt -text "Sample clock in a WindowPane." \
-font {sans plain 16} ] -insets 10
Pack [Button .info.start -width 8em -icon $clockIcon \
-text "Show Clock" -command {startClock} ] -insets 10
Pack [Button .info.exit -width 4em -icon $exitIcon \
-text Exit -command {wrapup; . exitApp /} ] -insets 10
proc showClock {} {
set clockIcon resource:/images/icons/nuvola/22x22/apps/clock.png
set w [WindowPane .tQueue -title "Clock" -width 300 -height 80 \
-icon $clockIcon \
-minimumWidth 200 -minimumHeight 80 -onclose {wrapup}]
Pack $w
proc wrapup {} {
every::cancel *
TaskQueue remove
}
Pack [Row $w.r]
Label $w.r.display -text "[clock format [clock second]]"
Pack $w.r.display -insets 10
TaskQueue create
TaskQueue setpollinginterval 1000
every::schedule 1000 [list \
TaskQueue add "$w.r.display configure -text \[clock format \[clock second\]\] " \
]
}
proc startClock {} {
# only start clock if it is not already displayed
if {[info command .tQueue] eq ""} {
showClock
}
}
# start up the clock for the first time
showClock
The resulting on-screen display (shown in Figure 2) is not impressive on its own; we're all familiar with far flashier Web-based effects. Notice, though, how it's achieved: the time is pushed from the server, and updates smoothly in the browser. It's also achieved much more succinctly than in "native" Echo2, whose Java source tends to bloat with such fragments as
button.setForeground(...
button.setBackground(...
button.setWidth(new Extent(...
button.addActionListener(...

Figure 2: A clock function, pushed out from the server.
Layout in this sample program is done with a clever Pack geometry manager, rather than HTML. Understand carefully what this means: Æjaks work essentially takes no advantage of any HTML and CSS skills you have or can contract. On the other hand, Pack and its teammates allow for sophisticated and far more dynamic effects than HTML and CSS: Æjaks makes "intelligent" data-driven displays easy.
Because Æjaks is server-based, it does not currently have any answer for the first disadvantage listed above of Web applications: Æjaks applications only work while connected, and do not support an off-line mode. This is commonly true of Ajax toolkits; off-line modes remain largely the province of more proprietary frameworks including Microsoft Sync, Adobe AIR, and open-sourced Google Gears.
Conclusion
It's a challenge to explain Æjaks' advantages in a brief review: its greatest benefits have to do with dynamic and subtle effects difficult to capture in static images and words. The good news, though, is that it's easy to experience Æjaks for yourself, because Poindexter has packaged 1.1 to work "out of the box" with essentially no installation or configuration required. It's easy to download, unpack, launch, and begin experimenting with working Æjaks demonstrations.
Æjaks isn't a dramatic break with the past in the way Ajax is; Ajax gives Web programmers qualitatively greater capabilities, while Æjaks only refines the foundation Ajax has established. Within this domain, though, Æjaks is quite pleasant to program. It's a good way to develop powerful and maintainable Ajax-based Web applications.
Kathryn and Cameron run their own consultancy, Phaseit, Inc., specializing in high-reliability and high-performance applications managed by high-level languages. They write about scripting languages and related topics in their "Regular Expressions" columns, which have explored "push" since before the invention of Ajax.
