The XML command-line system separates the user interface of a command from the operations of a command. All commands read and write XML data without being aware of the user-interface (shell). For example, the DIR command generates XML data containing information about files and folders on the local computer system. The DIR command does not have to build structured text listings; it only has to generate XML that conforms to a standard file-listing schema. The resulting XML can be piped (redirected) to other commands that know how to do something with the file listing data.
The piping mechanism is an important feature. The XML from the DIR command could be passed to a hypothetical ZIP command that reads the XML and generates a ZIP file. The ZIP command could in turn generate another file listing in XML format -- this one only containing information about the new ZIP file. That XML data could be piped to other commands and so on...
The shell is the user-interface responsible for displaying XML that is not consumed by some other command. For example, if the file listing from a DIR command is not piped anywhere, the shell intercepts the XML and generates a suitable user interface. A simple shell (like CMD.EXE) merely dumps the raw XML data to the screen. A more sophisticated shell like GCL builds a graphical listing.
A command can be written in any language as long as the executable (or script) can be loaded by the shell, and as long as the command exclusively uses the standard I/O streams. The standard input stream represents the keyboard or the incoming text from another program. The standard output stream represents the computer monitor or a device that will be accepting the output (such as a printer). The concept has been around for decades and is therefore widely supported by virtually all programming environments. In fact, it usually the default for input and output when writing a console application.
The graphical shell itself is more complicated. This implementation uses XSL to transform output XML into HTML, which is then rendered by an embedded web browser control. This allows for quick research (as well as themes using CSS) but unfortunately restricts the software to Microsoft Windows systems. A future version is likely to use XAML or another cross-system presentation layer.
However, since commands are separated from their UI, there is nothing to stop an end-user from running multiple shells on the same computer. A XAML shell might provide a graphically-intense environment for high-end computers, while a colorful console (text-only) shell might provide better performance on lower-end computers (or compatibility over serial and telnet connections). The same commands work on both shells; in fact, they are the exact same executables. Only the independent shell is different.
The XML command-line system (and the GCL shell) are in the early research phases. The code will be released under the GPL license in May 2007. Please contact the author at dave@thoughtproject.com if you are interested in participating in the project. The engine is being implemented with C# under .NET 2.0; most commands are being implemented in .NET as well. A few are being implemented in C and Pascal for demonstration purposes.
Home |
Libraries |
Snippets | Contact/About
Copyright © 2007 David Pinch except where designated otherwise.