What is Rexx?

Rexx is a procedural programming language that allows programs and algorithms to be written in a clear and structured way. It is easy to use by experts and casual users alike. Rexx has been designed to make easy the manipulation of the kinds of symbolic objects that people normally deal with such as words and numbers. Although Rexx has the capability to issue commands to its host environment and to call programs and functions written in other languages, Rexx is also designed to be independent of its supporting system software when such commands are kept to a minimum.

General Programming using Rexx

Rexx provides powerful character and arithmetical abilities in a simple framework. It can be used to write simple programs with a minimum of overhead, but it can also be used to write robust large programs. It can be used for many of the programs for which BASIC would otherwise be used, and its layout may look somewhat similar to that of a structured BASIC program. Note, however, that Rexx is not BASIC!

A simple program in Rexx looks like this.

/* Count to ten and add the numbers up */
sum = 0
do count = 1 to 10
say count
sum = sum + count
say "The sum of these numbers is" sum"."

Macro Programming using Rexx

Many applications are programmable by means of macros. Unfortunately, in the Unix world, almost every application has a different macro language. Since Rexx is essentially a character manipulation language, it could provide the macro language for all these applications, providing an easy-to-use and consistent interface across all applications. The best examples of such systems are on CMS (IBM's mainframe operating system which was the birthplace of Rexx) and on the Amiga. However, IBM's OS/2 is catching up, and now that Rexx is freely available on Unix it cannot be long before applications start to appear which have Rexx as their macro language. Two products already exist. They are the Workstation Group's Uni-XEDIT and Mark Hessling's THE (a link to which is displayed on my Rexx title page).

Rexx treats any instruction that it doesn't immediately recognise as an expression which it evaluates and passes to the host environment as a command. A simple XEDIT macro in Rexx looks like this.

/* this XEDIT macro centres the line containing the cursor. */
width = 72 /* Width within which to centre the line */
"extract /cursor /curline" /* location of cursor and current line # */
if cursor.3=-1 /* if cursor is not on a line... */
then "emsg Cursor not in a data line" /* then give an error message */
else do
restore=curline.2-cursor.1 /* how far cursor is from current */
":"||cursor.3 /* make cursor line current */
"extract /curline" /* get the current line */
"replace" centre(strip(curline.3),width) /* centre the current line */
restore /* restore old current line */

Rexx History

Rexx became reality on March 20th, 1979. Why is that day considered Rexx's birthday? According to Mike Cowlishaw, "'twas the day I woke up at 3am with a clear idea of what was needed, and by the end of the day had the initial specification off around the world for comment."

For many years the definitive web site for Rexx information was Mike Cowlishaw's Rexx Page. To ensure that this piece of Rexx history was not lost, in 2005, Mike graciously donated the contents of his web site to RexxLA.

Information about the REXX Standardization can be found here.