| Re .0: -< History & Description of Arexx, please >-
ARexx is the Amiga implementation of a command language known as Rexx.
The standard shell script language (CLI) is extended to allow for the
setting/testing of local variables and to include numeric computation
and string manipulation functions.
Though it was written and distributed by one person (William Hawes, of
Conman and WShell fame), it has become a de-facto standard for serious
Amiga software. AmigaDOS 2.0 now includes ARexx as a standard feature.
The ARexx package is available at nominal cost for users of earlier
versions of AmigaDOS. Included in ARexx is PIPE: support, which
enables WShell to implement the tee and | (pipe) operators to control
standard output in the U*ix fashion. ARexx macros are also usable at
the command level from WShell (Bill Hawes did a good job of integrating
his various efforts).
An important feature of ARexx is its support of "ports" for the control
of applications. This makes it possible for a script to start an
application and then to converse with it in order to produce some
desired result. SuperPlan and SuperBase use this technique to pass
data back and forth. ProWrite uses its ARexx port for "macros".
Distant Suns uses its ARexx port to make it easy to create animations
of a sequence of star fields. The uses are nearly endless.
It doesn't surprise me that someone would take advantage of the power
of ARexx to implement an "application". That doesn't put ARexx on a
par with C for software implemenation, but it means that simple jobs
can be done WITHOUT resorting to C.
|
| It's a slow day (can't you tell from the SCSI postings?), so...
REXX stands for Restructered EXtended eXecutor (or something like that). It
was written to replace the "script interpreter" that was used on VM/CMS
before it came about. Until very recently, the language has been the vision
of one man - Cowlishaw.
The goals were to make programming for non-programmers simple, while
providing enough power to make the resulting tool attractive to programmers.
In that, he largely succeeded. Non-technical people don't feel intimidated
in writing macros, etc. in Rexx. Programmers find it powerfull enough that
they write real applications in it.
The thing that really sets Rexx apart from other languages is the notion of
a "host" to which it can easily send "commands". Any statement in the
language that isn't one of the recognized types of statements is evaluated
as a string expression, and the resulting string is sent to the host as
a command. On VM/CMS, this usually meant the application from which the
macro was started, or one of another small number of applications.
Enter Bill Hawes, trying to build a work environment on the Amiga. He realized
that in the Amiga multitasking environment, this kind of thing could be
very usefull, so he ported Rexx to the Amiga. He made a Rexx HOST be a
standard Exec message port; all it takes is code that understands RexxMsgs
to read the port.
Rexx as a language isn't very spectacular. It's loosely modelled after
PL/I, meaning you have if/then/else for branches, and do/end for both
statement grouping and loops. Rexx is typeless, in that values are
automatically converted to a type appropriate for the operation being
applied to it, and you get errors if the conversion doesn't happen (i.e. -
trying to convert "Ultrix" to a number to add it).
String manipulation is a strong suite. Building strings from variables
and constants is simple. Many parsing tasks can be handled by a command
specifically for that purpose, provide standard parsing faciilties if
the parse command isn't adequate (not SNOBOL or Icon, though). This
makes it quite nice for string data transformation/manipulation even without
the ability to get data direct from applications.
The other unusual feature is that it supports associative arrays as the
only type of array, with "." as the index element. These arrays can even
be nested, so that one level of index can select an array, and a second can
select the value from that array. For example, a structure containg people
might containe name, age, and address parts. So, a queery might look like
say "User name? "
pull name
say "Component? "
pull type
say Value is people.name.type
Missing features in the language:
Call by value function arguments. There's no way for functions to operate
on multiple arrays. Corrected in the latest version of Rexx, but not in
ARexx yet.
No way to get a list of keys used in an associative array. Makes doing some
of the standard examples of their use harder than they should be.
Lots of features from other languages and more modern disciplines, but
it's not clear that being designed without those is a flaw.
Providing a good ARexx port makes an application _much_ more powerfull. MFF+
_expects_ arexx to be used to data among databases. Mg uses ARexx to provide
a GNU Emacs like "edit server" facility, and I just used those hooks plus
toolmanager to provide an "editor icon" for WB 2.0 and mg.
The ability to control and interconnect applications at the level of writing
shell or DCL scripts is an incredible facility. I don't know of anyone who's
come anywhere near the limits on what can be done with this.
<mike
|