Rexx advantages and disadvantages
[Copyright © IBM Corporation, 1994. All rights reserved.]
Rexx is a programming language which was developed for its users
rather than for the convenience of its implementers -- those who
implement its compilers and interpreters. For example, it hides the
underlying mechanisms of hardware from the programmer, except where it
is absolutely necessary and appropriate to expose them.
Further, in the first five years of its life the core of the language
was defined and implemented by a single person (based on feedback from
hundreds of early users) and was constrained by an explicit design
philosophy. This has led to a language which is coherent and does
what its users want it to do, and which has a sound base for future
evolution.
This design approach gives Rexx several advantages over older
languages:
- Rexx programs can be made very readable, since there is a minimum of
required punctuation, special characters, or notations. For example,
this is a complete, runnable Rexx program:
/* This program, hello.cmd, displays a greeting */
say "Hello World!"
- Rexx has only one data type, the character string, so no
declarations are needed. This makes writing programs in the language
both attractive and productive, as the programmer doesn't have to
worry about underlying hardware representations. Rexx operators are
optimized for common string operations such as concatenation, and
are supported by powerful parsing and word instructions and functions.
- Rexx arithmetic is defined as decimal arithmetic, with precision
selected by the programmer rather than by the underlying hardware, as
in:
/* Test some arithmetic */
numeric digits 40
say "One seventh is" 1/7
which would display:
One seventh is 0.1428571428571428571428571428571428571429
Exponential notation is supported in both scientific form and in the
multiple-of-three form usual in engineering or financial applications.
Results of arithmetic operations therefore match users' expectations
far better than results from the binary arithmetic used by most other
languages.
- Rexx puts no inherent limits on the size of strings (including
those that represent numbers). Again, this removes many of the
headaches that often plague programmers.
- Rexx is a relatively small language. This makes it approachable and
easy to learn. Even the Object Rexx under development only adds a very
few new constructs to the core language.
- Rexx was specifically designed to be a general-purpose scripting and
extension ("macro" or "glue") language. That is, it lets users easily
tailor and enhance advanced software systems. Like most human written
languages, Rexx is based on simple character strings. It also has
special mechanisms for rapid environment switching and simple error
handling that are especially suited to this use.
- Rexx has no globally reserved words. This allows robust programs to
be written that will not be invalidated by future additions to the set
of language instructions. Not only does this mean that programmers do
not need to learn the keywords that they do not use, but this is also
extraordinarily important when using the language for application
extension.
Software vendors can distribute macros written in Rexx which, even
though they are processed in source form, can remain almost immune to
changes in the Rexx language itself. This benefits the user, since
installing a new level of Rexx (which is usually part of the
underlying operating system) is unlikely to break the macros provided
with an application or written by the user. It also benefits the
software vendor, since much less support and fewer updates will be
needed.
- The dynamic nature of the Rexx language makes it especially suitable
for interpretation. Interpreted languages allow rapid iteration during
development and very low time overhead per program written. This means
many programs are written in Rexx that otherwise might never have been
written at all.
- Rexx is very system-independent. This gives it the advantages of
portability and wide application. This means that people need to
learn fewer programming languages; there is no longer the need for a
new command programming language for every application and operating
system.
- Finally, Rexx has a number of unusual features, such as associative
arrays and dynamic variable scoping, that make many algorithms much
easier to design and implement.
These advantages have led to the rapid acceptance of Rexx as a
language for procedure automation, application extension, and
scripting. Its users cover the whole spectrum of programmers, from
secretaries or workstation users who just wish to customize their
environment or a spreadsheet in a flexible way, through to professional
programmers writing or prototyping whole subsystems of software in Rexx.
There are relatively few disadvantages in
using Rexx.
Mike Cowlishaw
mfc@vnet.ibm.com