Collaborator-8-3-CTA-banner

7 Reasons that Rexx Still Matters

Rexx-img-lg

You might think of the dynamic language Rexx with nostalgia, but without a sense of urgency to program in it. René Vincent Jansen offers several convincing reasons that it ought to be in your programming toolbox.

Every time I mention Rexx on Slashdot or another techie site, people roll their eyes. They think that Rexx — the first widely used scripting language — is no longer relevant. I disagree, and in this article I explain why.

First: If you haven’t encountered Rexx before, you may need an update. Though Mike Cowlishaw invented it at IBM in 1979, there are nine free and open source Rexx implementations. It’s supported on virtually any operating system, though it got the most attention, initially, on IBM platforms including mainframes and IBM OS/2.

Among the main elements that make Rexx such a pleasure to program in:

  • It is a small language that can do everything.
  • It is case insensitive where that matters.
  • It has built-in TRACE and PARSE statements that are unsurpassed.

So how can Rexx be useful today, when so many other languages – such as Python, PHP, and Perl – are better known and more popular? Let me explain.

1. Rexx is a major glue language that ties together all important mainframe processing.

There is no denying that Rexx, the venerable granddaddy of scripting languages, had its popularity peak around 1995. Mentions of Rexx on Slashdot draw reactions from people who used it and liked it but for some reason feel compelled to announce that they are past Rexx now. This means, more often than not, that they lost the access to the mainframe platform they once used it on, went through a withdrawal period, and found replacement languages. It also means that the new love could not entirely replace the memories.

Rexx was originally, and still is, a mainframe language. It originated around 1980 on VM, and was published by IBM, at first reluctantly, as a result of a groundswell of popular demand by the technical staff of major accounts. It replaced a language called exec-2, which consisted mainly of ampersands. Rexx’s author, Mike Cowlishaw, was initially in trouble, but was later recognized as an IBM fellow. Rexx later spread to all IBM’s operating systems such as MVS, OS/2, and OS/400.

Typically, Rexx, as a glue language, is used by staff who are not supposed to do any programming, such as systems programmers and infrastructure and middleware management groups. (Perhaps that makes Rexx the first DevOps language, too.) As such, Rexx applications tend to stay under the radar, but if we were to take them away, it would surely mean the end of the world, with a greater measure of certainty than Camping or the Mayas can offer us. I have seen, recently, how major parts of commercial applications are sidestepped and swapped for Rexx glue, because It Just Works (which should be a Rexx trademark – with apologies to whoever owns the phrase now). So Rexx is the largest unknown application language. Bruce Eckel mentioned this in his Thinking in Java.

For mainframes, a commercial Rexx compiler produces native object code. It also enables promotion of applications to production status without having it executing from source code (and to squeeze out that last drop of performance). It is no great secret that the excellent Rexx compiler, produced from Haifa research by the Vienna labs, is a profitable product. On the mainframe (that important environment for your financial well-being), there is really no alternative.

2. Rexx has evolved into a major object-oriented language with an OO-version for the Java Virtual Machine.

In its original form, the Classic variant that still runs the mainframe, Rexx dated from the era of functional decomposition. If that’s all you know about, you may be surprised to learn that Rexx is also a far more modern programming environment.

There are two object-oriented follow-ons. One is a design by committee which is SmallTalk inspired, and had a stack-based VM before Java, that has all the dynamism that would make Ruby’s mouth water. (But that is an anachronism, since Ruby’s gestation was still far in the future when Object Rexx was designed by Simon Nash and his colleagues at IBM Hursley.) Next in innovative and dynamic Object Orientation, ooRexx has perfect backward compatibility with Classic Rexx as its greatest asset. This implementation was born on OS/2, and in the public eye its reputation has undeservedly has suffered by that OS’s untimely demise. It interfaced perfectly to SOM, the equally lamented better component model.

The other update to Rexx is a one-man product by the father of Rexx himself. Started as an experiment to determine if running Rexx on the Java Virtual Machine (JVM) was possible, it became the first alternative language for the JVM. That version is now a mature product, bootstrapped in itself, which the performance runs rings around other alternative VM languages.

The reason for this is simple: NetRexx is implemented as a (platform independent) translator from Rexx to Java source code. This JVM version has, in its 16 years of existence, leveraged the impressive progress in the javac compiler and the hotspot and j9 VMs – and all others. NetRexx is a fresh start, corrects some elements which Mike Cowlishaw was unhappy with (all comparisons are now case insensitive and the overloaded ‘do’ statement is split into ‘do’ and ‘loop’ – retconned into Object Rexx now also). It is, as was established on Sun’s JVM Language Summit in 2008, the only alternative JVM language that has stood at the base of an implementation of a class in the Java Class Library itself: BigDecimal.

3. Rexx is still human-oriented.

A very important language design goal has always been that the interpreters and compilers should be easy on the user. In other words, the language should not be complicated because the compiler writer would then have an easier task. This has translated into a “I think this should work” probability that is high and an astonishment factor that is low.

In every flavor of Rexx, all arithmetic is decimal based. It does not suffer “computer” rounding errors that make you look dumb. Furthermore, the decimal precision is unlimited – within reason, memory, and processing cycles of course.

4. While Rexx evolves, it never breaks your old code.

It never ceased to amaze me how many companies went bust because the step between VB n and VB n+1 was too much of an investment, or to hear people speak of “legacy Java code” in 1997. This just will not happen in Rexx. No new reserved words were introduced that trip up the variable names that you chose years ago. NetRexx, for example, does not have any reserved words at all (although I can advise against calling your variable ”end” if you want to shorten your programs by using loops).

5. Rexx has an ISO-standard, and implementations for every platform imaginable.

Few programming languages can boast an ISO standard. It means there is an important yardstick against which to measure implementations, and that shows in the quality of the interpreters and compilers available. Regina, for example, one of the first open source implementations, runs on an impressive array of machines, and on operating systems even I have never heard of.

6. Rexx is open source.

I have seen the future, and it is open source.

Oddly enough, and I am showing my age here, when I started in this profession, software, even IBM’s crown jewels, was open source, at least for customers, who would get the source on tape or microfiche without asking. Personally, I remember this as a time that technical staff, even of competing companies, helped each other in a way that was beneficial to all, not to mention fun.

For this day and age, the fact that IBM has made good on its promises to open source Object Rexx and NetRexx (the former in 2005, the latter only recently, in June 2011) means for all Rexx users, fans, and aficionados that its future is secured, and investment is safe. This means in its turn, that its future is starting now. To get involved in open source Rexx, have a look at Open Object Rexx and NetRexx. Regina is an ISO-compliant Classic Rexx for all relevant platforms.

7. The future of Rexx is on mobile platforms.

Rexx is beautifully suited to mobile devices, due to its small footprint and its extreme portability. Several implementations already are on Android for Rexx and NetRexx. For example, there’s a NetRexx IDE on Android devices.

The performance that is inherent to tight code conceived on smaller machines means this bright future is on mobile, the mainframe in your pocket. Chances are, you are running NetRexx code already on your Android device without really knowing it, just like on the mainframes that are enabling modern-day life.

There is a Rexx in your future, whether you like it or not.

For transparency: SQC editorial director Esther Schindler is the co-author of a book on REXX, Down to Earth Rexx (in its first edition), and still has a fondness for the language. She cannot say No to any request to mention it.

See also:

peercodereview-best-kept-secrets-wp-cta

subscribe-to-our-blog

  • http://twitter.com/cbemerine CB

    I have used Exec and Exec 2 so loved REXX with OS/2 years ago. REXX is excellent for scripting, whatever the reason.  
     
    REXX was very useful in testing (especially regression testing) way before there were any ‘formal’ testing tools. What a wonderful idea, to install REXX and ooREXX on smart embedded devices (handhelds/phones, tablets) in addition to netbooks, laptops and desktops. Thanks for pointing out the open source and object oriented capabilities!  
     
    There is no reason why any ‘smart’ device should not allow their owner to install the software they want and need. For me PHP is one of those (want/needs) and now REXX will be added to a very short list of must haves.  
     
    If the next release of a hardware device does not have at least as many apps running on it as the last release, its really not very smart and probably best to be avoided (not purchased).

  • http://TheAmericanProgrammer.com Gabe Gargiulo

    Excellent article! I could never let go of REXX either. I recently updated and published my REXX book “The REXX Language on TSO” available now at Amazon.com

  • http://wcf.com Dave Gomberg

    I have written nothing but REXX for the last 17 years. I now code mostly in KEXX (the macro language for the KEDIT editor, runs under Windows). I am looking forward to Android and ooREXX. 
     
    Maybe we should publish a second edition of Modern Programming Using REXX for the Android platform??? 
     
    What do you think, Gabe???

  • Thomas Lukasik

    I used Rexx heavily for about a year (on OS/2) as a contract programmer at a major insurer. I’d never seen or heard of it before that gig, yet was able to pick it up quickly and get the job done – and don’t recall anything negative about that whole experience – so Rexx must have something going for it.  
     
    TJL

  • Andy

    REXX has been paying my bills for the past 20 years! 
    It’s a secret weapon in my toolbelt, makes me able to do a lot of things so much faster than other programmers – yet putting it on a resume does nothing, since few people know about. 
     
    KEXX is the primary flavor I use. Sometimes I also dabble in Brexx and ooRexx.

  • http://theamericanprogrammer.com gabe gargiulo

    A book “Modern Programming Using REXX for the Android” sounds like a good idea! Let’s keep REXX alive!

  • http://theamericanprogrammer.com gabe gargiulo

    A book on REXX under Android sounds like a good idea! I just finished my book The REXX Language on TSO and am ready to write another.

  • Dave

    Great article. I programmed apps in Rexx on OS/2 for years, and loved it. I also used to use it on many occasions to reformat large volumes of data (case changing, converting to/from csv, reordering fields).  
    I left the tech support field to pursue process management, but I’m happily back, coding Rexx in TSO. It got my juices flowing, and I’ll be pursuing it on Windows and Android for fun!

  • ziggy2003

    Easy to pick up but not very popular…

  • Amiga ARexx

    Hey, no mention of Amiga ARexx? Rexx was the standard bundled scripting language for AmigaOS 2.0 and above. AROS, an open source Amiga clone, uses Regina in its place.

    http://en.wikipedia.org/wiki/ARexx

  • arexx

    I am also very surprised Arexx was not mentioned for the Amiga — which has used it extensively to tie programs together!