June 2002
SashXB: Are Cross-Platform Open Source Weblications in Your Future?
By Donald K. Rosenberg
IBM Gets It
By now most developers know that IBM is backing open source, and perhaps even know that IBM is dedicated to the use and propagation of open standards, but not many people know the extent of IBM's dedication to this area, or all of the many projects IBM is funding as it walks the talk. For a high-level view of this effort, see the interview with Bob Sutor, IBM's director of e-business standards strategy at http://www-1.ibm.com/linux/news/sutor.shtml . Bob talks about the ways IBM is fitting all the pieces together: open standards, open source, Linux, Java, and Web Services.
Sash and SashXB (for Windows and Linux, respectively) are two small parts of the big picture, and IBM is involved in so many projects that at the moment it is not marketing either; it's just supporting open source development and giving the technology away. Sash seems to be about where XML was a few years ago, as Sutor describes it: "Years ago when XML was young and we were trying to convince the industry that this would be a good technology, there really wasn't any obvious or immediate revenue associated with XML." This is the classic open source model: put up something that works and see who wants to use it and improve it.
What is It and Where Does It Come From?
There are a number of handles you could grab Sash by. You could say, There a shortage of easy-to-use RAD tools on Linux, so IBM has written one. Or, IBM is giving new life to the idea of the cross-platform applet. Or, Sash is an example of the trend away from server-based applications, and back to thick clients. Or, Real e-business needs a better interface than the browser (think of those clunky travel-booking sites). In a nutshell, Sash (and SashXB, of course) enable the developer to write distributed applications that run on the user's client using the client's native interface; the Sash teams like to call these "Weblications." The project began a few years ago on Windows (note the "sash" metaphor), and was ported to Linux by seven interns in two summer projects under the IBM Extreme Blue (thus the "XB") intern program (http://www-913.ibm.com/employment/us/extremeblue/) .
When the second summer project ended in September 2001, IBM created a permanent SashXB team with two of the former interns, John Corwin and AJ Shankar, and Wing Yung (all in Cambridge, MA); they are standing by to release version 1.0 concurrently with Mozilla 1.0, which may already have happened by the time you read this. The Windows version is at http://sash.alphaworks.ibm.com/ and SashXB is at http://oss.software.ibm.com/developerworks/opensource/sashxb/ . Both versions use that little blue bird mascot, Carlos d'Parrot.
How Does It Work and What Are the Benefits?
Easy
SashXB does not require high-level programming skills because it is basically JavaScript with HTML, DHTML, and XML. The SashXB team calls it a superset of JavaScript (sometimes called SashScript on the Windows side of the family), but point out that they have not extended the language. The Weblications (Web-enabled applications) are JavaScript, and depend on some software installed on the client. There is a runtime engine (about 1MB), and the Windows and Linux platforms depend on the Internet Explorer or Mozilla browsers, respectively. Mozilla provides the JavaScript interpreter, and its Gecko rendering engine is available to SashXB if the developer chooses to take advantage of it (SashXB can do graphics on its own). A Weblication can run in a growing number of locations; for SashXB this means places such as its own window, a custom UI (Glade), or a GNOME panel. Extensions are available for a number of services, such as Vorbis, Jabber, FTP, XML, and file systems. SOAP is on the way.
Secure
Security is a major benefit of this model. Although Sash will support a sandbox mode if the developer desires it (just like Java applets), the use of interpreted rather than compiled code means that any mal code can be detected by the runtime engine and kept from running. Although this interpreted model is inherently slow (and very slow at computation), Weblications can be speeded up by calling libraries or other compiled code delivered to the client in trusted binary form. Sash can even handle the delivery and check-in of this material using built-in security measures that the developer can implement. The Sash security manager can register permissions for each Weblication to make sure that none oversteps its bounds.
Cross-Platform
Sash is adaptive to platforms in ways that you would expect—the GUI looks native in Windows and in Linux, something we are used to seeing with cross-platform Windows/Mac applications for instance. Platform differences extend to user mentality, as well. In Windows the developer may update the clients from a Web server, and the client side will simply accept this checked-in trusted (that is, properly signed) code, and alert the user only about code coming from a source other than the original developer. This method follows the Windows model: users prefer not to hear about all the housekeeping, and don't like fussing with security levels. On the SashXB side, however, the Linux user can receive notifications about all downloaded code, even that coming from the trusted developer site. This adaptation recognizes that Linux users tend to be more security-conscious and interested in system functions. While some Weblications can run on Windows or Linux with no code changes, developers who take advantage of native differences in functionality will need to adapt their Weblications to that extent in order to run them on the other platform.
SashXB tools and libraries come under the GNU Lesser General Public License (LGPL), and the system is built on open source standards and tools. It uses (for instance) Glade for UI building, the GNOME Tool Kit (GTK), FTP, and Jabber for Instant Messaging. The SashXB team are GNOME fans, but KDE users who have GNOME libraries installed on their systems will be able to use SashXB
What about PDAs and Macintosh? Not yet, but certainly possible. On the Windows side, Win CE runs on PDAs, and if IE has a Win CE version, then Sash could run there. Similarly, the Linux PDAs need only a Mozilla that will fit them, and then SashXB could run on them. A port of SashXB to Mac OS X is certainly possible, and an open source project is apparently forming with that purpose.
Out of the Sandbox and Beyond the Browser
Sash has moved beyond ASP and JSP applications to run on the client. Not only does this approach take advantage of the client's computing horsepower, the ability of Weblications to run outside a sandbox gives them access (under permission, of course) to client resources such as libraries, binaries, and data. And not just on the client--a properly set up Weblication will be able to reach resources anywhere on the network, making it useful in the new and growing field of grid computing (another interest of IBM). On the other hand, unless a Weblication is specifically designed to call on resources across the network, it should be able to run even if its host machine is not connected, a decisive advantage over the hosted-application model. Because the SashXB installer is good at sizing up the environment, it can install some of the components it needs and use others it already finds in place, saving on the size of the initial download to be brought across the network. The uninstaller is likewise environment-aware so that it will not remove components used by other Weblications.
The Strategy and the Future
IBM aims to solve many developer problems with this one tool, but it is also aiming at a user problem: the shortage of applications with attractive interfaces on the Linux platform. SashXB aims to make the writing of such applications fast and easy. This is not just a case of expanding the developer pool (anyone who can use JavaScript and HTML can access the native functionality of Linux—and Windows); it is also a matter of increasing the productivity of skilled programmers by speeding up their work.
It is now up to developers to write the future history of Sash and SashXB in the "Write Once, Run Many" approach to software and what is coming to be called Web Services. While Sash can be seen to compete with Java and with Microsoft's DotNet (.NET, which approaches the problem from the "Write Many, Run One Place" perspective), its emphasis on using native functionality makes sure that the Windows version, for instance, supports Windows COM, the Registry, and so on.
The Weblications currently available for download tend to be of the demo variety, but some have proved very popular, such as a stock ticker that sits on the desktop and provides updates of stock values. There is a networked checkers game that shows that a cross-platform GUI can have the same look and feel on both platforms without any changes to the code, and do it in just a few hundred lines. The GUI-based SashFTP client should be useful to anyone, and a tool to manage your collection of images is in the works. Sash and SashXB are already at work inside some companies.
Wired likes what it has seen (http://www.wired.com/news/linux/0,1411,51476,00.html) , and once the Linux distros pick up SashXB we can hope that many developers will start to use it for unlimited purposes.
About Donald Rosenberg: Dr. Rosenberg is president of Stromian Technologies (www.stromian.com) and author of Open Source: The Unauthorized White Papers (Wiley). He has worked with companies in the U.S. and Europe, both in open source and proprietary software. A speaker on open source business and licensing issues, he is on the advisory boards of several open source companies and a columnist for Linux Journal and ConsultingTimes.com donr@stromian.com
Note: All trademarks are the property of their respective holders.