Вы находитесь на странице: 1из 10

The design of the REXX

language
by M. F. Cowlishaw

One way of classifying computer languages is by two (consciously or otherwise) to be easy to compile or
classes: languages needing skilled programmers, and easy to interpret, it is designed(with the help of
personal languages usedby an expanding population
of general users. REstructured extended executor feedback from hundreds of users) to be easy to use.
(REXX) isa flexible personal language designed with
particular attention to feedback from its users. It has Three major factors affect the usability of a language.
proved to be effective and easyto use, yet it issuffi- First, the basic concepts of a language affect its
ciently general and powerfulto fulfil theneeds of many
demanding professional applications. REXX is system syntax, grammar, and consistency. Second, the his-
and hardware independent,so that it has been possi- tory and development of a language determine its
ble to integrate it experimentally into several operating function, usability, and completeness. Third, but
systems. Here REXX isused for such purposes as com- quite independently, the implementation of a lan-
mand and macro programming, prototyping, educa- guage affects its acceptability, portability, and distri-
tion, and personal programming. This paper introduces
REXX and describes the basic design principles that bution. This paper introduces REXX and then dis-
were followed in developing it. cusses basic concepts and developmental history as
applied to the design of the REXX language.

There are several experimental implementations of


the REXX languagewithin IBM for both large and
small machines. One of these, by the author, has
C omputer languages may be classified in many
ways. One way, for example, is to divide them
into two usability classes: those for data processing
become a part of the Virtual Machine/System Prod-
uct (VMISP), as the System Product Interpreter for
the Conversational Monitor System (CMS). The most
professionals and those for the rest ofthe users. Most complete published documentation of the language
languages currently available(suchas FORTRAN,
may be found in Reference 1.
COBOL, and c) have been designedas tools for profes-
sionals and require a significant amount of training
before they can be used effectively. A few languages What kind of language is REXX?
(notably BASIC and LOGO) have been designed with REXX is a new language that allows programs and
more general users in mind. As a result, these lan- algorithms to be written in a clear and structured
guages have found wide application in the field of way. Its primary design goal was that it should be
personal computers. BASIC especially is widely used, genuinely easyto use both by computer professionals
but itwas originally designed for simpler applica- and by the more casual general users. A language
tions. The popularity of BASIC continues, and there that is designed to be easy to use must be adept at
have been many attempts to improve its structure
and syntax. This has resulted in many different dia-
Copyright 1984by International Business Machines Corporation.
lects of the language. Copyinginprintedformforprivate use ispermittedwithout
payment of royalty provided that (1) each reproduction is done
REstructured extended executor (REXX) is a new without alteration and (2) the Journal reference and IBM copyright
language designed for the general user yet suitable notice are included on the first page. The title and abstract, but
no
other portions,of this paper may be copied or distributed royalty
for many professional applications. REXX borrows freewithoutfurtherpermissionbycomputer-basedandother
significantly from earlier languages, but it differs in information-servicesystems.Permissionto republish anyother
one fundamental respect. Instead of being designed portion of this paper must be obtained from the Editor.

326 COWLISHAW IBM SYSTEMS JOURNAL, VOL 23. NO 4, 1984


manipulating the kinds of symbolic objects that peo- Within IBM, many REXX EXECS for the Conversational
ple normally deal with: words, numbers, names, and Monitor System (CMS) have been written. Many of
so on. Most of the features in REXX are included to these EXECS embody hundreds and even thousands
make this kind of symbolic manipulation easy. REXX of lines. Product models consisting of over 20 000
is also designed to be highly systemindependent, but lines of REXX have been reported, and at least one
it has the capability of issuing both commands and IBM location now reports applications involving over
conventional interlanguage calls to its host environ- one million lines of code written in R E X X . ’ ~
ment.
Macros. Many applications are programmable by
The REXX language structure covers several applica- means of macros. In the dataprocessing world,there
tion areas that traditionally have been serviced by is a different macro language for almost every type
fundamentally different types of programming lan- of application. There are macro languages for edi-
guage. tors, assemblers, interactive systems, text processors,
and, of course, for other languages. The work of
Personal programming. REXX provides considerable Stephen~on’~ and others has highlighted similarities
function with powerful character and mathematical between these applications and the need for a com-
abilities in a simple framework. Short programs may mon language. Because REXX is essentially a charac-
ter-manipulation language, it can provide the macro
facility for all these applications.

Macro languages often have unusual qualities and


syntax that restrict their use to skilled programmers.
REXX has a more conventional syntax. It is also a
Command program interpretersare flexible language.Thus, itallows the same jobs to be
increasing in importance in modern done in less time by less skilled personnel.
operating systems. Prototyping. The currentinterpreter implementation
of REXX can be highly interactive. Therefore, as
might be expected, developing programs in REXX is
very fast. This productivity advantage, together with
the ease of interfacing REXX to system utilities for
display and for data input and output, makes the
be written with minimum overhead, yetfacilities language verysuitable for modeling applications and
exist to allow the writing of robust large programs. products. It has also proved to be useful for setting
The language is well suited to interpretation and is up experimental systems for usability and human
therefore rather suitable for the applications for factors studies.
which such languages as BASIC and LOGO are cur-
rently sed.^,^ REXX has proved to be an easy lan- The design of REXX is such that the same language
guage to learn and toteach. can be effectively and efficiently used for many dif-
ferent applications that would otherwise require the
Tailoring user commands. Command program inter- learning of several languages.
preters are increasing in importance in modem op-
erating systems. Nearly all operating systems include The REXX language
some form of EXEC,SHELL, or BAT languages4” In
many cases such a language is so embedded into the REXX is a language that issuperficially similar to
operating system thatit is unlikely to be ofuse earlier languages. However, every aspect of REXX has
outside its primary environment, as for example been critically reviewed and usually differs from
Mxec.* There is, however, a clear trend toward pro- other languages in ways that make REXX more suited
viding command programming languages that are to general users. REXX was designed as an entirely
both powerful and capable of more general sage.^"^ new language, without the requirement to be com-
REXX cames this principle further by being a lan- patible with any earlier language. This has allowed
guage that is designed primarily for generality but important improvements to be included. The follow-
also for suitability as a command programming lan- ing description is intended as anintroduction to the
guage. language. Becausemany of the subtleties of REXX are

IBM SYSTEMS XXIRNAL. VOL 23, NO 4, 1964


best appreciated with use, the reader is urged to use tion concatenates the string 'Hello' to the variable
the language. ANSWER with a blank between them. The blank is
here a valid operator that means concatenate with
Language summary.The REXX language is composed blank. The string "!" is then directly concatenated to
of a rather small number of instructions and options, the result builtup so far. These simpleconcatenation
yet it is powerful. Where a desired function is not operators make it very easy to build up strings and
built in, it can be added easily by using one of the commands, and these operators may be freely mixed
with arithmetic operations.

In REXX, any string or symbol may be a number.


Numbers are all real numbers and may be specified
in exponential notation if desired. An implementa-
All the operators act upon stringsof tion may use appropriately efficient internal repre-
sentations, of course. The arithmetic operations in
characters of any length. REXX are completely defined,so that different imple-
mentations must always give the same results.

The NUMERICinstruction may be used to select the


arbitrary precision of calculations, which, forexam-
ple,maycalculatewith 1000 or more significant
several mechanisms for external interfacing. The digits. The same instruction may also be used to set
following summary introduces most of the features the fuzz to be used for comparisons, and the expo-
of REXX. Full details may befound in Reference 1. nential notation (scientific or engineering) that REXX
is to use to present results. The term fuzz refers to
REXX provides a conventional selection of control the number of significant digits of error permitted
ConStrUCtS that include IF-THEN-ELSE, SELECT-WHEN- when making a numerical comparison.
OTHERWISE-END, and several varietiesof DO-END for
grouping and repetition. These constructs are similar Variables all hold strings of characters and cannot
to those of PL/I, but with several enhancements and have aliases under any circumstances. The simple
simplifications. The DO looping construct can be compound variable mechanism allows the useof
used to step a variable TO some limit, FOR a specified multidimensional arrays that have the property of
number of iterations, and WHILE or UNTIL some being indexed by arbitrary character strings. These
condition is satisfied. DO FOREVER is also provided. are, in effect,content-addressabledata structures and
Loop executionmay be modified by LEAVE and permit lists and trees to be built quite simply. Groups
ITERATE instructions that significantlyreduce the of variables (arrays) with a common stem to their
complexity of many programs. A SIGNAL instruction names can be set, reset, or manipulated by references
is provided forabnormal outward transfer of control, to that stem alone.
such as error exits and computed branching.
The example JUSTONEshown in Figure2 is a routine
REXX expressions are general in that any operator that removes all duplicate words from a string of
combinations may be used, provided of course that words. Figure2 also shows some of the built-in string
the data values are valid for those operations. There parsing available with the PARSE instruction. This
are nine arithmetic operators (including integer di- instruction provides a fast and simple way ofdecom-
vision, remainder, and exponentiation), three con- posing strings of characters (or data acquired from
catenation operators, eight comparative operators the user or external environment) using a primitive
(including some that test for exact equality),
and four form of pattern matching. A string maybe split into
logical operators. All the operators act upon strings parts using various forms of patterns and then as-
of characters of any length, and the strings are typi- signed to variables by words or as a whole.
cally limited only by the amount of virtual storage
available. A variety of internal and external calling mecha-
nisms are defined. The most primitive calling mech-
Figure 1 shows a sample program, called HELLO, that anism is the command, which issimilar to a message
illustrates both expressions and a conditional instruc- in the Smalltalk-80 ~ystem,'~ and in which an in-
tion. Theexpression on the last SAY (display) instruc- struction that consists of just an expression is eval-

328 COWLISHAW IBM SYSTEMS XXIRNAL, VOC 23,NO 4. 1984


Figure 1 A sample program, called HELLO, illustrating expressions and a conditional instruction

/* A s h o r t program gt or e e t a new user. */


d i /*
s p lFa iyr s t prompt: a */
say 'Please type your name and then press ENTER:'

parse p u l l answer /* Get t h er e p l yi n t o ANSWER */

/* Ifn o t h i n g was typed, then use a fixed greeting, */


/* otherwise echo t h e name p o l i t e l y . */
i f answer=" thensay'HelloStranger!'

e l s e say 'Hello'answer'!'

uated. The resulting string of characters is passed to is usefulfor some kinds of interactive or interpretive
the currently selected external environment, which environments, and can be used to build the almost
might be an operating system, an editor, or any other trivial instant calculator program, called SAY, shown
functional object. The REXX programmer can also in Figure 3.
invoke functions and subroutines that may be inter-
nal to the program, built in (part of the language), The language defines an extensive debugging or trac-
or external to the program. Within an internal rou- ing facility, though it is recognized that some imple-
tine, variables may be shared with the caller or mentations may be unable to supportthe whole
protected, that is, they may be local to the routine. package. The tracing options allow various levels
If protected, selected variables or groups of variables and subsets of instructions tobe traced (commands,
belonging to thecaller may be exposed to theroutine labels, all, and so on) and the display of various levels
for read/write access. of expression evaluation results, either intermediate-
calculation results or the final results. Furthermore,
Certain types of exception handling are supported. for a suitable implementation, thelanguage describes
A simple mechanism associatedwith the SIGNAL an interactive debug option in which the execution
instruction allows the trapping of run-time errors, of the program may be halted selectively. Once exe-
halt conditions (external interrupts), command er- cution has paused, the user may then type in any
rors (errors resulting from external commands), and REXX instruction string (to display/alter variables,
the use of uninitialized variables. No method of and so on), step to the next pause, or re-execute the
return from an exception is provided in the current last clause traced.
language definition.
Fundamental language concepts
The INTERPRET instruction, which is intended to be
supported by interpreters only, allows any string of Language design is alwayssubtly affected by uncon-
REXX instructions to be interpreted dynamically. It scious biases and by historical precedent. To mini-

IBM SYSTEMS JOURNAL, VOC 23. NO 4, 1984


Figure 2 The routine, called JUSTONE, removes all duplicate words from a string of words

/* This routine removes duplicate words from a string, and */


/* illustrates the use of a compound variable
(HADWORD) that */
/* is arbitrary
indexed
by
(words).
data */
Justone:
procedure /* make
all
variables
private */
parse arg wordlist */
/* get the list of words
hadword.=O /* show all possible words
as new */
outlist=I1 */
/* initialize the output list
do while wordlist-=I1 /* loop so long as we have some data
*/
/* split WORDLIST into the firstword and the remainder */
parse var wordlist word wordlist
if hadword.word then iterate /* loop again if already had
*/
hadword. word=l /* remember that we have had this word */
outlist=outlist word /* and add this word to output list */
end
return
outlist /* finally
return
result
the */

mize the effect of bias, a number of concepts have Readability in this sense seems to be a rather subjec-
been chosen and used as guidelines for the design of tive quality, but the general principle followed in
the REXX language. Discussed here are the major REXX is that the tokens that form a program can be
concepts that were consciously followed during the written much as one might write them in English,
design ofREXX. Each topic merits a paper of its own, French, German, and so forth. Although the seman-
and many of these topics are well discussed in the tics of REXX is of course more formal than that of a
literature. Unfortunately, these few paragraphs can natural language, REXX is lexicallysimilar to normal
be only summaries of fuller discussions and thoughts text.
on the ideas.
The structure of the syntax means that the language
Readability. If there is one concept that has domi- readily adapts itself to a varietyof programming
nated the evolution of REXX syntax it is readability, styles and layouts. This helps satisfy user preferences
which is usedhere in the sense of perceived legibility. and allows a familiarity of syntax that also increases

330 COWLISHAW I34 SYSTEMS JOURNAL, VOL 23, NO 4, 1984


readability. Good readability leads to enhanced un- hasbecome a fashionable attribute forlanguages
derstandability, thus yieldingfewer errors during over the last ten years. In this author’s opinion, the
both the writing of a program and the reading for greatest advantage of strong typing is for the inter-
debug or maintenance. Important readability factors faces between program modules.Errors within mod-
here are the following: ules that would be detected by strong typing (and
would not be detected fromcontext) are much rarer
There is deliberate support throughout the lan- and in the majority of cases do not justify the added
guage formixed upper- and lower-caseletters, program complexity.
both for processingdata and for the program itself.
The essentially free format of the language and REXX, therefore, treats types as naturally as possible.
the way blanks around tokens are treated allow The meaning of a constant depends entirely on its
the user to lay out the program in the way he feels usage. All data are defined in the form of the sym-
is most readable. bolic notation (strings of characters) that a user
Punctuation is required only when absolutely nec- would normally writeto represent the data. Since no
essary to remove ambiguity (though it may often internal or machine representation is exposed inthe
be added according to personal preference,so long language, the need for many data types is reduced.
as it is syntactically correct).This relatively toler- There are, for example, no fundamentally different
ant syntax noticeably reduces frustration during concepts of integer and real. There is just the single
use of the language, as compared with experience concept of number. Since all data have a defined
with such languages as Pascal. symbolic representation, the programmer can always
9 Modem concepts of structured programming are inspect values, such as, for example, the intermediate
available in REXX and can lead to programs that results of an expression evaluation. This means that
are easier to read than they might otherwise be. numeric computations and all other operations can
Structured programming facilities also make REXX be precisely defined and therefore act consistently
a good language for teaching the concepts of struc- and predictably.
tured programming. The current language definition doesnot exclude the
Loose binding between lines and program source future addition of a data-typing mechanism for those
ensures that even though programs are affected by applications that require it, though at present there
line ends, they arenot irrevocably so. A user may seems to be little call for this.The mechanism would
spread a statement over several lines or put it on be in the form of ASSERT-like instructions that assign
just one line. Statement separators are optional, data typechecking to variables during execution
except where more than one statement is placed flow. An optional restriction, similar to the existing
on a line, again allowingthe programmer to adjust trap for uninitialized variables, could be defined to
the language to his style. provide enforced assertion for all variables.
Naturaldatatyping. Strong typing, in which the Emphasis onsymbolic manipulation. From the user’s
values a variable may take are tightly constrained, point of view, the data that REXX manipulates are in

IBM SYSTEMS JOVRNAL. VOL 23. No 4. 1984 COWLISHAW 331


the form of strings of characters. Itis highlydesirable gramming and maintenance easier when onlya dis-
for the user to be able to manage data as naturally play device is being used.
as he would manipulate words on a page or in an
editor. The language therefore hasa rich set of char- The GOTO statement is a necessary casualty of dy-
acter manipulation operators and functions. namic scoping. In a truly dynamically scoped lan-
guage, a GOTO cannot be used as an error exit from
Concatenation is treated specially in REXX. In addi- a loop. If it were, the loop wouldneverbecome
tion to a conventional concatenate operator (I I),
there is a new blank operator that concatenates two
data strings together witha blank between. Further-
more, if two syntactically distinct terms, such as a
string and a variable name, are abutted, the data Implicit declarationstake place
stringsare concatenated directly.These operators
make it especiallyeasy to build up complex data during execution.
items and strings and may at any time be combined
with the other operators available to the REXX pro-
grammer. To illustrate this point, consider the SAY
instruction, which consists of the keyword SAY fol-
~ ~ ~~~ ~~ ~

lowed by any expression. In the following example inactive. Some interpreted languages detect control
of the instruction SAY,if the variable N has the value jumping outside the body of the loop and terminate
‘6’, the loop if this occurs. These languagesare therefore
relying on static scoping. REXX instead provides the
SAY N* 100/50‘%’ ARE REJECTS abnormal transfer-of-control instruction SIGNAL that
terminates allactive control structures when it is
displays the string executed. Notethat it is not just a synonym for GOTO
because it cannot be used to transfer control within
12% ARE REJECTS
a loop. Alternativeinstructions are provided forthis
Concatenation has a lower priority than arithmetic purpose.
operators. The order of evaluation of the expression
is therefore first the multiplication, followed by the Nothing to declare. Consistent with the philosophy
division, then the direct concatenation, and finally of simplicity, REXX provides no mechanism for de-
the two concatenate-with-blank operations. claring variables. Variables may of course be docu-
mented and initialized at the start of a program, and
Dynamic scoping. Most languages, especially those this covers the primary advantages of declarations.
designed to be compiled, rely on static scoping. That The other, data typing, is discussed earlier in this
is, the physical position of
a statement in the program paper. Implicit declarations do take place during
sourcemay alter its meaning.Languages that are execution, but the only true declarations in the REXX
interpreted or that have intelligent compilers gener- language are the markers or labels identifyingpoints
ally have dynamic scoping. Here, the meaning of a in the program that may be used as the targets of
statement isaffectedonly by the statements that signals or internal routine calls.
have already been executed, rather than those that
precede it in the program source. System independence. The REXX language is inde-
pendent of both system and hardware. REXX pro-
Purely dynamic scoping is a characteristic of the grams, though, must be able to interact with their
REXX language. Dynamic scoping implies that REXX environment, and such interactions necessarily have
may be efficientlyinterpreted because only minimal system-dependent attributes. However, these system
look-ahead is necessary. It also implies that a com- dependencies are clearly bounded, and the rest of
piler is more difficult to implement. Therefore, the the languagehas no such dependencies. In some
semantics includes restrictions that considerably ease instances, this leads to added expense in implemen-
the task of the compiler writer. Of greater importance tation and language usage, but the advantages are
is the fact that with dynamic scoping a person read- obvious and well worth the penalties.
ing the program need only be aware of the program
above the point at which he is studying. Not only As an example, string-of-characters comparison is
does this aid comprehension, but it also makes pro- normally independent of leadingand trailing blanks.

332 COWUSHAW IEM SYSTEMS JCURNAL. VOL 23, NO 4, 1984


The string “ Yes ” means the same as “Yes” in most often had to be rethought to make the language a
applications. However, the influence of underlying more usable tool.
hardware has subtly affected this kind of decision, so
that many languages allow only trailing blanks but Originally, REXX allowed almost all options on in-
not leading blanks. By contrast, REXX permits both structions to be variable-even the names of func-
leading and trailing blanks during general compari- tions were variable. Many users, however,stumbled
sons. into pitfalls that were side effects of this powerful
generality. For example, the TRACE instruction allows
Limited-span syntactic units. The fundamental unit its options to be abbreviatedto a single letter, because
of syntax in the REXX language is the clause, which it must be typed often during debugging sessions.
is a piece of program textterminated by a semicolon, Users therefore often used the instruction TRACE I.
usually implied by the end of a line. The span of When I had been used as a variable, perhaps as a
syntactic units is therefore small, usually one line or loop counter, the TRACE I instruction could become
less. This means that the parser can rapidly detect TRACE lo-a correct but unexpected action. There-
errors in syntax, which in turn means that error fore, the TRACE instruction was changed to treat the
messages can be both precise and concise. symbol as a constant to protect users against such
things happening. As a result, the language became
It is difficultto provide good diagnostics
in languages more complex. A VALUE option on TRACE allows
with large fundamental syntactic units, such as Pas- variability for the experienced user. Similarly, there
cal. A small error can often have a major and un- is a fine line to tread between concise (terse) syntax
expected effect on the parser. and usability.
Dealing with reality.The REXX language is a tool for Adaptability. Wherever possible,the REXX language
use by real people to do real work. Any tool must, allows for the extension of instructions and other
above all, bereliable. In the caseof a language, language constructs. For example, there is a large set
reliability means that it should do what the user of characters available forfuture extensions, because
expects.User expectations are generallybased on only a restrictedsetisallowedfor the names of
prior experience, including the use of various pro- variables (symbols). Similarly,the rules for keyword
gramming and natural languages, and onthe human recognition allowinstructions to be added whenever
ability to abstract and generalize concepts. required without compromising the integrity of ex-
isting programs that are written in the appropriate
It isdifficult to defineexactlyhow to meetuser style. There are no globally reserved words, though
expectations, but it helps to ask the question: Could a number of words are reserved within the local
there be a high astonishmentfactor associated with context of a single clause.
the new feature? If a feature is accidentally misap-
plied by the user and causes what appears to him to A language must be adaptable because it certainly
be an unpredictable result, that feature has a high willbeused for applications not foreseen by the
astonishment factor and is therefore undesirable. If designer. Although it has proved to be effective as a
a necessary feature has a high astonishment factor, command programming and personallanguage,
it may be necessary to redesign the feature. REXX may prove to be inadequate in unforeseeable
future applications. Thus room for expansion and
Another important attribute of a reliable software change is included to make the language more adapt-
tool is consistency. A consistent language is by defi- able.
nition predictable, and it is often elegant. The danger
here is to assume that because a rule is consistent Keep the language small. Every suggested addition
and easily described,it is therefore simple for a user to the language has been considered on the basis of
to understand. Unfortunately, some of the most its likely number of users. My intention was to keep
elegant of rules can lead to effects that are completely the language as small as possible, so that users can
alien to the intuition and expectations of a user. The rapidly grasp most of the language. This self-imposed
user is a human being, not a computer. guidelinehas had a number ofbeneficialresults,
among which are the following:
Consistency applied for its own sake can easily lead
to rules that are either too restrictive or too powerful The language appears less formidable to a new
for general useby human beings. Thus, during its user.
design, I found that simple rulesfor REXX syntax Documentation is smaller and simpler.

IBM SYSTEMS JOURNAL VOL 23. NO 4. 1984


The experienceduser can beaware of all the neously and communicated among themselves and
facilities ofthe language, and so has the whole tool with the designer entirely electronically. The discus-
at his disposalto achieve a goal. sions of the committee grew to be hundreds of
There are few exceptions, special cases,and rarely thousands of lines, and these and the similar quantity
used embellishments. of mail from the users were all kept forlater review.
The language is easier to implement.
As time passed, it became clear that changes in the
No defined size or shape limits. The language does languagewerenecessary.Using the network, the
not define limits on the size or shape of any of its designer could interactively explain and discuss the
tokens or data, although there may be implementa- changes that were required, some ofwhichwere
tion restrictions. It does, however, define the mini- incompatible with the then-current versionof the
mum requirements that must besatisfiedby an language. The decision to make an incompatible
implementation. Wherever an implementation re- change was never taken lightly, but-because
striction has to be applied, the language rules rec- changescould be made relativelyeasily and ex-
ommend that it be of such a magnitude that few if plained to users in detail-the language was able to
any users are affectedby the restriction. evolve much further than would have been the case
Where implementation limits are necessary, the lan- if upward compatibility only were considered. Sev-
guage encourages the implementer to use familiar eral other important concepts guided the process of
and memorable values for the limits. For example, enhancing the language.
250 is preferable to 255, 500 is preferable to 512,
and so on. It is unnecessary to force artifacts of the Documentation before implementation. Each major
binary system onto a population that uses only the section of the REXX language was documented and
decimal system. Onlya tiny minority of future pro- circulatedfor reviewbefore its implementation.
grammers will deal with binary representations of These sections were in the form of complete refer-
quantities. ence documentation that in due course became part
of the language referencemanual. At the same time,
and before implementation, sample programs were
Language design concepts written to explore the usability of each proposednew
The REXX language was designed over the four-year feature.
period from 1979 through 1982, at the IBM United
Kingdom Laboratories Limited at Hursley, England, The benefits of this approach were marked:
and at the IBM Thomas J. Watson Research Center
at Yorktown Heights, New York. The process was The majority of usability problems were discov-
first to design and document a basic REXX language. ered before they became embedded in the language
This initial informal specificationwas then circulated or before any implementation of the language
for review and critique. On the basis of advice re- included them.
ceived, I revised the initial informal description, The writing of documentation was found to be
which became the basis for a specification and im- the most effective way of spotting inconsistencies,
plementation. REXX was firstimplemented under the ambiguities, or incompleteness in a design.
Conversational Monitor System(CMS),whichsup- Thedesigner did not consider implementation
ported the concept of interpreted programs that details until the documentation was complete, so
could be directly invoked by users. as to minimize the implementation’s influence
upon the language.
The most important factor in the development of Reference documentation written after implemen-
REXX began to take effect when the first interpreter tation is much more likely to be inaccurate or
was distributed over the IBM communication net- incomplete than that written before implementa-
work known as VNET. (This network links over 1400 tion. After the documentation has been written,
mainframe computers in forty countries.) From the the author is likely to know the implementation
beginning, many hundreds of people were using the too well to write an objective description.
language. All theseusers,from temporary staff to
professional programmers, were able to provide im- User feedback. User feedback was fundamental to
mediatefeedback to the designer on their prefer- the process of evolution of the REXX language. Al-
ences, needs, and suggestions for change. An infor- though users can often be incorrect in their sugges-
mallanguage committee then appeared sponta- tions, eventhosesuggestions that appeared to be

334 COWUSHAW IBM SYSTEMSJOURNAL, VOL 23, NO 4. 1 9 3 4


shallow were considered carefully because they were Cited references
often pointers to deficienciesin the language or 1. Virtual Machine/System Product: System Product Interpreter
documentation. As a result of the effective commu- Reference, IBM Reference Manual SC24-5239, IBM Corpo-
nications network, many details of the language and ration; available through IBM branch offices.
2. T.E. Kurtz, “BASIC,” ACM SIGPLAN Notices 13, No. 8,
documentation could be revised and circulated effi- 103-1 18 (August 1978);ACMSIGPLAN History ofprogram-
ciently. Manyif not most of the good ideas embodied mingLanguagesConference, Los Angeles,CA, June 1-3,
in the language came directly from users. It is im- 1978.
possible to overestimate the value of the direct feed- 3. B. Harvey, “Why Logo?”, Byte 7 , No. 8, 163-193 (August
1982).
back from users during the development of REXX. 4. Virtual Machine/System Product:EXEC 2 Reference, IBM
Reference Manual SC24-5219, IBM Corporation; available
through IBM branch offices.
Concluding remarks 5. S. R. Bourne, “The UNIX shell,” Bell System Technical
Journal57, No. 6, 1971-1990 (July 1978).
REXX isdesigned to be a practical and powerful
6. Wylbur Command Procedures, Computer Center, National
language, intended to provide maximum effect for Institutes of Health, Bethesda, MD 20205 (December 1980).
the minimum of effort on the part of the program- 7. IBM Personal Computer Disk Operating System, Version 2,
mer. Close attention to the details of syntax and IBM Corporation; available through authorized IBM personal
semantics hasresultedin many differences from computer dealers.
8. W. L. Ash, “Mxec: Parallel processing withan advanced macro
earlier languages, as well as many similarities. The facility,” Communications of the ACM 24, No. 8, 502-509
crucial concept, however,is that the language has (August 198 1).
beendesignedfor the user, not the implementer. 9. J. R. Mashey, “Using a command language as a high-level
This emphasis is particularly visible in the areas of programming language,” IEEE, Proceedings of theSecond
International Conference on Software Engineering, San Fran-
readability, natural data typing, and representation cisco, CA (October 13-15, 1976), pp. 169-176.
of data. In addition to being easyto learn and to use, 1’0. A.W. Colijn, “Experiments with the Kronos control lan-
the language contains sufficientlypowerful con- guage,” Software-Practice and Experience 6, No. 1, 133-136
structs that it satisfies the needs of many professional (1976).
applications. In addition to its use as a personal 1. J. Levine,“Why a Lispbased command language?”, ACM
SIGPLAN Notices 15, No. 5,49-53 (May 1980).
language, a variety of major programming tasks have 2. A.W. Colijn, “A note on the Multics command language,”
been accomplished using REXX, including product Software-Practice and Experience 11, No. 7, 741-744 (July
prototypes, macro libraries, and command program- 1981).
ming. 13. E.C. Haeckel, IBM Santa Teresa Laboratory, 555 Bailey
Avenue, P.O. Box 50020, San Jose, CA 95150, personal
communication ( 1984).
The REXX languagehasbenefitedespeciallyfrom 4. C. J. Stephenson, “On the structure and control of com-
wideusage and feedback during its development. mands,” ACMSIGOPS7, No. 4,22-26, 127-136 (1973).
The advantages of user experience and feedback have 15. Xerox Learning Research Group, “The Smalltalk-80system,”
far outweighed the problems caused by occasional Byte6, No. 8, 36-47 (August 1981).
incompatibilities. The value to language design of a Reprint Order No. G321-5228.
worldwide telecommunications network connecting
language userscannot be overestimated. Mike Cowlishaw IBM United Kingdom Limited Scientijic Centre,
Athelstan House, St. Clement Street, Winchester, Hants, SO23
9DR, England. Mr. Cowlishawjoined the IBM United Kingdom
Acknowledgments Laboratories Limited at Hursley in 1974, after receiving a B.Sc. in
electronic engineering from the University of Birmingham. From
Many hundreds of people have contributed to the then until 1980, he worked on the design of the hardware and
software of multimicroprocessor test tools. He spent any spare
development of the REXX language in one way or time exploring the concept of the human-machine interface. This
another, so it is impossible to thank them all. How- included the implementation of the Structured Editing Tool
ever, I am especially indebted to several individuals (STET), which is an editor that gives a tree-like structure to
who havespent much time discussing REXX and have programs or documentation. Other results of these spare-time
explorations are several compilers and assemblers and the first
made major contributions: P. G.Capek, C. W. Chris- version of the REXX language. In 1980, Mr. Cowlishaw joined
tensen and the REXX Language Committee, S . Davies the IBM Thomas J. Watson Research Center to work on a text
(who also designed and implemented most of the display system with real-timeformatting and on specifications for
built-in functions), M. Hack, S. Nash, C.J. Stephen- new facilities for interactive operating systems. He returned in
son, and C. H. Thompson. I also thank the manage- 198 1 to the Hursley Laboratory, where hecompleted work on the
REXX language. In 1982, Mr. Cowlishawjoined the IBM United
ment of the IBM United Kingdom Limited Scientific Kingdom Scientific Centre in Winchester to do research on image
Centre and the IBM United Kingdom Laboratories systems. His current research is concerned with color perception
Limited for the opportunity to write this paper. and the modeling of brain mechanisms.

IBM SYSTEMS JXIRNAL. VOL 2 3 , NO 4, 1984

Вам также может понравиться