Rexx: What You Need to Know
Автор: Howard Fosdick
Two of today’s hottest software trends are scripting and open source software. Their convergence has led to booming popularity for a number of free scripting languages, including Perl, Python, Tcl/Tk, PHP, Ruby, and others. One of the first scripting languages, Rexx, is also resurging due to these trends. This versatile language runs on virtually all computers, from handhelds on up to mainframes (where it predominates). Rexx is best known for being easy to code yet still very powerful.
You’ll often run into Rexx in IT shops, so gaining a reading knowledge of the language is handy. Rexx is also a useful free tool to add to your coding toolbox. Having a powerful language you can code from memory for virtually any platform is very useful in today’s ever-changing IT environment.
This article presents the FAQs on Rexx, focusing on what you need to know to get started: basics about the language and where to download the language, tutorials, and free tools. My next article will provide a quick Rexx coding tutorial.
What Is Rexx?
Rexx was one of the first full-featured scripting languages. It was invented by Michael Cowlishaw of IBM in the 1980s. Cowlishaw solicited input from users and developers to create an easy-to-code language; then he applied these findings to the development of a "power" language.
Rexx presents a programming philosophy distinct from that of the languages descended from the UNIX tradition (such as Perl or Korn). It argues that power can be based on simplicity rather than syntactical complexity. My article "Rexx: Power Through Simplicity" explores this idea through scripting examples and describes some of the techniques Rexx uses to combine power and coding ease.
Who Uses Rexx?
Rexx runs on all platforms and operating systems—handhelds, laptops, PCs, servers, even mainframes. Originally, Rexx started life as an "IBM language," and so it predominates on all IBM mainframes, the IBM iSeries (i5/OS and OS/400), and OS/2.
Rexx branched out into much broader use when it gained an international ANSI standard in 1996. Today, nine free Rexx interpreters run on virtually all platforms.
Many Rexx users run the language on Windows, UNIX, and Linux. Microsoft bundled Rexx in its Windows Resource Kits until the company decided on a more proprietary approach with Windows Script Host and VBScript, but TechNet makes available more than 120 sample Rexx scripts for Windows.
While there’s no way to track how many users and developers employ any of the free scripting languages, Rexx is usually considered to be "in the middle of the pack" in terms of popularity. It likely has hundreds of thousands of users and is especially popular in Europe and at IT sites that have an IBM heritage.
Advantages of Rexx
Rexx is a full-featured, general-purpose scripting language similar to Perl, Tcl/Tk, Python, or Ruby. Any application you can develop in any of these languages can probably be developed in any of the others.
High-end developers like Rexx because its easy, syntax-free nature makes possible quick coding of very large applications. Reliabililty soars in an "easy" language because developers have fewer linguistic concerns. A simple, readable language also facilitates maintenance.
Those who like Rexx prefer a language that offers these advantages:
- Easy coding from memory
- Plenty of power
- Good for developing large, high-reliability systems
- Easy to maintain
- Cross-platform capability
- Usable as a skill in various environments
Disadvantages of Rexx
Rexx has the same downsides as any scripting language. If you need to write a high-volume transaction-processing program, you’ll probably use a compiled language (such as C/C++ or maybe Java) to optimize machine performance. Like most scripting languages, Rexx doesn’t support machine-level coding very well, so if you want to write an operating system, languages such as C and C++ are better.
How Quickly Can You Learn Rexx?
If you know some other language, you can learn Rexx fast. (After all, this was one of its design criteria.) Gaining a reading knowledge of the language is simple. Rexx is English-like and has virtually no "punctuation" or syntax. Like C, Rexx has a tiny instruction set, surrounded by a large built-in function library. Object-oriented scripting follows the same principles as in other object-oriented languages.
Support and Tools
Rexx has three or four active online forums in English, plus others in French, German, Russian, and Japanese. Its support level is similar to that of other open source scripting languages. Support contracts are available from several companies if your shop isn’t comfortable working strictly in the open source world. Of course, when it comes bundled with an operating system, Rexx is covered under the vendor’s support contract. Rexx also has an international users group called the Rexx Language Association.
Rexx offers hundreds of free tools. There is a free tool or interface to perform almost any task in the language.
Rexx comes in three varieties:
- Standard or classic Rexx is the procedural language originally developed at IBM. Six free classic Rexx interpreters are available for download, and I’ve already mentioned that standard Rexx is bundled with several operating systems.
- Object-oriented Rexx is a true superset of classic Rexx. It includes classes, messaging, single and multiple inheritance, encapsulation and data hiding, polymorphism or operator-overloading, and all the standard features of any fully object-oriented programming language. Object-oriented Rexx also has a large class library. Two free object-oriented Rexx interpeters are available.
- NetRexx is a Rexx variant designed to bring the language’s ease of use to the Java environment. NetRexx scripts use Java classes and can provide classes used from Java programs. You can develop applets, applications, servlets, classes, and beans in NetRexx. NetRexx differs from all other Rexx interpreters in that it’s nonstandard—it’s best termed a "Rexx-like" language. A NetRexx intepreter is available that runs under any Java Virtual Machine (JVM).
Why are so many Rexx interpreters available? Rexx isn’t owned or controlled by any single vendor or group; it’s standards-driven. Given the usefulness of the language, it’s natural that several groups and individuals have created Rexx interpreters. The advantage is that you can select the Rexx interpreter that best meets your needs. You might choose one optimized for performance, or extended for a particular operating system, or tailored for your handheld. The choice is up to you.
Downloading Rexx and Tools
You can download any free Rexx interpreter or tool from RexxInfo.org. The web site also provides access to free tutorials, articles, sample code, and complete reference materials for all Rexx interpreters.
Howard Fosdick is the author of Rexx Programmer’s Reference (Wrox, 2005), a comprehensive sourcebook on the language. It includes a tutorial, complete reference guide, and many example programs. The book covers both object-oriented and procedural Rexx scripting.