ARexx
William S. Hawes's 1987 implementation of IBM's REXX for the Amiga — a small, typeless scripting language whose ARexx ports let one program drive another, making it the de facto macro and glue language of the Amiga and, from AmigaOS 2.0, a standard part of the operating system.
Created by William S. Hawes
ARexx is an implementation of IBM’s REXX language for the Commodore Amiga. William S. Hawes wrote it in 1987 and sold it himself from a post-office box in Maynard, Massachusetts. As a language it is plain REXX: typeless strings, no declarations, English-like instructions and powerful PARSE templates. What made it important was the Amiga-specific plumbing Hawes built around it. Any application could open an ARexx port, a named message port that accepts command strings. An ARexx script could then drive that application, pass results to a second program and hand them on to a third. That turned a multitasking home computer into a machine where a paint program, a database and a word processor could be scripted together, years before AppleScript (1993) brought a comparable idea to the Macintosh. The Amiga community adopted it as the standard macro language, and Commodore made it part of the operating system with AmigaOS 2.0 in 1990.
History & Origins
REXX comes to a multitasking home computer
REXX was created by Mike Cowlishaw at IBM in 1979 for the VM/CMS mainframe environment. In 1985 Prentice-Hall published his book The REXX Language: A Practical Approach to Programming, which served as the language definition. Zamara and Sullivan’s Using ARexx on the Amiga describes the setting that followed. A version of REXX had appeared for PC-DOS in 1985. In 1987 IBM named REXX the Procedures Language for its Systems Application Architecture. The Amiga, launched in 1985, had pre-emptive multitasking and a message-passing operating system. In their words, “the stage was set for an Amiga version of REXX.”
The first chapter of the ARexx manual states the relationship directly: ARexx “is an implementation of the REXX language described by M. F. Cowlishaw … and follows the language definition closely.”
A one-person product
The ARexx User’s Reference Manual, Version 1.0, is copyright 1987 by William S. Hawes. It lists his own mail-order address, and site licences were available on request. Its “About …” note describes how the product was made:
ARexx was developed on an Amiga 1000 computer with 512K bytes of memory and two floppy disk drives. The language prototype was developed in C using Lattice C, and the production version was written in assembly-language using the Metacomco Assembler. The documentation was created using the TxEd editor, and was set in TeX using AmigaTeX. This is a 100% Amiga product.
Zamara and Sullivan note that Hawes “developed the entire ARexx system, wrote the manual and distributed and supported the product.” They also say the package remained available both from Hawes directly and through normal retail outlets. Hawes wrote other Amiga system software too, including the ConMan console handler. Some ARexx features, such as counting queued console lines, depended on ConMan.
Version 1.0 was modest in its requirements. It needed an Amiga with at least 256K of memory, ran under V1.1 or V1.2 of the operating system, and used the system’s double-precision IEEE math library.
From add-on to operating-system component
Few users owned ARexx at first. Zamara and Sullivan say developers nonetheless “supported it in their products as an investment” in a future where scripts could glue applications together. As more programs gained ARexx ports it became, in their words, “the de facto standard on the Amiga.” Commodore then made it “an official part of the operating system with the release of the 2.0 version.” On a Workbench 2.0 system, RexxMast lives in the System drawer and runs automatically from the Startup-Sequence. The command utilities live in a Rexxc directory, and rexxsyslib.library and rexxsupport.library are in LIBS:. ARexx was never in ROM, but from that point developers could assume it was installed.
Hawes also took part in formal standardisation. ANSI formed technical committee X3J18 in November 1990 to develop a REXX standard, and the committee first met in January 1991. The published list of contributors to the resulting standard, ANSI X3.274-1996, includes Bill Hawes.
Design Philosophy
Hawes wrote ARexx for three kinds of user, and the manual’s opening chapter addresses each in turn:
- Novices got an “easy-to-learn yet powerful language” with source-level tracing to “take some of the mystery out of how programs work.”
- Power users could “build fully integrated software packages, combining different applications programs into an environment tailored to their needs.”
- Developers could make their programs scriptable cheaply and “let the end user add the frills and custom features.”
The manual compares its goal to Intuition, the Amiga’s GUI layer. Intuition gave applications a common graphical interface, and ARexx would give them a common procedural interface. In its “Future Directions” section Hawes wrote that “the advantages of having a rich variety of software products sharing a common user interface and a common procedural interface cannot be overstated,” and called this “the underlying promise of the Amiga’s multitasking capability.”
He also wanted ARexx to behave well in a multitasking system with little memory. Each ARexx program runs as its own task. The whole interpreter is a shared library, so only one copy of its code is ever loaded, and it returns memory to the system as soon as it no longer needs it. Writing about version 1.15 in 1991, Zamara and Sullivan put the loaded system at under 40 KB of RAM. For comparison, they noted that Commodore’s AmigaVision program was over 600 KB. They credit that small footprint with helping ARexx gain acceptance, since it has to stay resident all the time.
Key Features
Classic REXX at the core
An ARexx program starts with a comment, which is how the interpreter recognises it. Instructions are English words, and every value is a string that is checked for numeric validity only when used in arithmetic. The 1.0 manual’s first examples:
| |
| |
| |
Standard REXX features carry over. Compound variables (stems such as name.i) act as associative arrays, and PARSE templates split strings by words, patterns or column positions. INTERPRET executes a string as code, and TRACE offers several levels of interactive, source-level debugging.
Hosts, ports and commands
ARexx’s main addition is the command interface. Any clause that is not an instruction or assignment is evaluated as an expression and sent as a command string to the current host, which is the named ARexx port of some running program. ADDRESS selects the host. OPTIONS RESULTS tells the interpreter to ask the host for a result string, which comes back in the special variable RESULT. The return code comes back in RC.
| |
The command set belongs to each application, not to ARexx. A paint program might accept LOADIMAGE and a comms program DIAL, while ARexx just delivers the strings and collects replies. Programs could also run ARexx scripts as their own macros. The manual recommends giving such scripts an application-specific file extension, and ARexx searches a system-wide REXX: directory for them. This is how one script could pull records from a database, compute over them in a spreadsheet and lay out the results in a word processor.
ARexx could also address the AmigaDOS shell. The 1.0 manual shows address command being used to write a script file to the RAM disk and open a new CLI window to run it.
Amiga-specific extensions
Appendix B of the 1.0 manual lists where ARexx departs from Cowlishaw’s definition:
| Extension | Purpose |
|---|---|
BREAK | Exit from the scope of any DO or INTERPRET |
ECHO | Synonym for SAY |
SHELL | Synonym for ADDRESS |
SIGNAL ON BREAK_C … BREAK_F | Trap the Ctrl-C to Ctrl-F break signals sent by AmigaDOS |
SIGNAL ON IOERR | Trap errors detected by the I/O system |
| Generalised templates | Variable positional tokens and multiple templates in all PARSE forms |
The resident process also keeps some shared resources. The Clip List is a set of named strings visible to all ARexx programs. The Library List holds external function libraries, which can add new built-in functions or act as bridges to other software. SHOW() queries these lists, so a script can check whether a host port or library is available before using it.
Resident process and utilities
ARexx programs are started by a background resident process, RexxMast, which must be running first. A small set of shell commands comes with it: RX to run a script, HI to halt all running programs, TS/TE to start and end interactive tracing, TCO/TCC to open and close a global tracing console, and RXSET/RXC to manage the Clip List and close the resident process. By version 1.15 the set also included WaitForPort, which waits for a named host port to appear, so a script could start an application and wait until its port was ready.
Limits in version 1.0
The 1.0 manual documents its implementation limits:
- Strings and symbol names up to 65,535 bytes
- Clauses up to 800 characters after comments and extra blanks are removed
- Compound symbols with up to 50 nodes
- Up to 15 arguments to built-in and external functions
- Subexpressions nested up to 32 levels deep
It also admits one significant omission from the REXX definition. Arbitrary-precision arithmetic was not implemented, so arithmetic was limited to “about 14 digits of precision.” NUMERIC FUZZ was missing, and only scientific exponential notation was available. Hawes promised “the full numeric capabilities” in a later release.
Evolution
Hawes updated ARexx through the late 1980s and early 1990s, although few of the intermediate releases can be dated precisely from surviving sources. Zamara and Sullivan’s book, written against version 1.15 in 1991, shows some of the changes since 1.0:
OPTIONSgained aNOkeyword in version 1.10, so options such asRESULTScould be switched off individually.NUMERIC FUZZhad been added, though the authors warn that in 1.15 its effect on numeric comparisons “is not always fully consistent.”ERRORTEXTcovered error numbers 1 to 48.WaitForPorthad joined the command utilities.
Commodore’s adoption for AmigaOS 2.0 in 1990 was the decisive change. After that, ARexx was a component that shipped with every new Amiga, not a product users bought. According to Wikipedia, this later ARexx follows the official REXX language closely.
After Commodore’s collapse, ARexx remained 68000 assembly code, and each Amiga successor dealt with that differently:
- AmigaOS 4 (Hyperion) still ships ARexx and documents it in a full manual. The manual adds chapters on sound, printing, serial and parallel ports and network resources, and describes Workbench as an ARexx host.
- AROS, the open-source AmigaOS reimplementation, built its replacement from Regina. In 2002 Staf Verhaegen imported Regina 3.0 and added message-port support, a RexxMast and
rexxsupport.libraryfunctions such asSTATEFandSHOWDIR. - MorphOS installs only a dummy
rexxsyslib.library. The MorphOS Library explains how users can replace it with a third-party 68krexxsyslib.libraryto get a full ARexx environment. The nativeRXCmdshell command and Lua’sipcmodule can still send commands to ARexx ports without it.
Current Relevance
ARexx is historical in the sense that its author no longer develops it and no new standalone releases appear. It is not extinct, though. AmigaOS 4 still ships and documents it, and AROS and MorphOS keep the ARexx port protocol alive through Regina-based and Lua-based alternatives. Many Amiga applications written since the late 1980s expose ARexx ports, and retro-computing users keep writing ARexx scripts for them on real hardware, emulators and modern Amiga-compatible systems. Aminet, the main Amiga software archive, still carries ARexx scripts, tutorials and reference material.
For people who know REXX from IBM mainframes, OS/2 or Regina, ARexx code is instantly readable. The core language is the same, and the Amiga additions are mostly in how commands reach other programs.
Why It Matters
ARexx is one of the clearest early examples of a system-wide scripting language for a personal computer. It was more than an application macro language or a command shell. It gave any application a standard way to become programmable, gave users one language to control all of them, and used a message-passing transport that the multitasking Amiga already had. Zamara and Sullivan called Hawes’s “creative adaptation of the IBM script language REXX to the multitasking Amiga environment … one of the decisive actions that shaped Amiga history.”
It also shows how far a single developer’s product could travel. ARexx began as a one-person, mail-order product written in assembly on a floppy-based Amiga 1000. It became a standard part of the operating system, and its author went on to contribute to the ANSI REXX standard. The ARexx port idea, where applications publish named command sets and a small interpreter scripts them together, has outlived the original 68000 interpreter. On AROS and MorphOS the same ports are driven today by Regina and Lua.
Timeline
Notable Uses & Legacy
AmigaOS System Scripting
From AmigaOS 2.0 (1990) ARexx ships on the Workbench disk, with RexxMast started from the Startup-Sequence. Hyperion's AmigaOS 4 documentation still includes a full ARexx manual and documents Workbench itself as an ARexx host named WORKBENCH, with commands for opening windows, manipulating icons and adding menu items
Commodore AmigaVision
Commodore's AmigaVision multimedia authoring tool, shipped with the Amiga 3000, exposes the ARexx host address AV.REXX so scripts can exchange data with a presentation's variables, and its 'flows' can run ARexx scripts or command external ARexx hosts
AMOS Professional
Europress's AMOS Professional BASIC documents an AREXX interface. It can launch RexxMast, open an ARexx port and exchange messages with an ARexx-compatible text editor, so a program listing can be edited externally and reloaded
Productivity and Creative Applications
Zamara and Sullivan's 1991 survey covers the ARexx interfaces of Gold Disk's HyperBook, ShowMaker and Home Office Advantage, Superbase Professional 4, Art Department Professional and Inovatronics' CanDo. Users could run macros from menus, spreadsheet cells, hypermedia hot spots or points in a presentation
MorphOS Lua Bridge
MorphOS ships only a dummy rexxsyslib.library, but its native Lua includes an ipc module whose functions (ipc.address, ipc.rx, ipc.waitforport) send commands to existing ARexx ports. Decades of application ARexx interfaces therefore stay scriptable without the original interpreter