[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

5006.0. "History & Description of Arexx, please" by TRUCKS::BUSSINK_E (It's Nothing Personal) Fri Aug 30 1991 15:49

    Okay, I know there are already files about Arexx, and I do understand
    that it allows the Amy to do transformation on files, but that's all I
    know. Could someone possibly explain the goal of Arexx and why to use
    it. Is it easy ? well what I want to find is an History of Arexx & an
    good description. In the ~6 previous notes, there was only programming
    discution about Arexx. Could someone explain the good/bad about it, and
    if I shall try to learn Arexx instead of C ?
    
    							Erik
T.RTitleUserPersonal
Name
DateLines
5006.1ARexx is a Command LanguageULTRA::KINDELBill Kindel @ LTN1Fri Aug 30 1991 17:3429
    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.
5006.2TENAYA::MWMFri Aug 30 1991 18:3774
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
5006.3CRBOSS::QUIRICISat Aug 31 1991 11:313
    I don't think AREXX is compiled; so it's probably slow?
    
    Ken
5006.4slow but!!!SALEM::LEIMBERGERTue Sep 03 1991 07:386
    Speed is not as much of a problem as one would think. This has to do
    with the basic nature of AREXX. Most commands are submitted, will go
    off and do there thing while you do yours. Once the msg is recieved
    it is most often executed by another program at it's speed. Their is
    an ad for a compiler in the mags.
    								bill