|
|
 | |  | |
 |  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. Mike Cowlishaw mfc@uk.ibm.com |
|