https://opensource.com/article/22/10/rexx-scripting-language Skip to main content Supported by Red Hat User account menu * Log in * RSS Home Supported by Red Hat Main navigation * Articles * Resources + What is open source? o The open source way + Projects and applications + Organizations + Open source alternatives o Alternatives to Acrobat o Alternatives to AutoCAD o Alternatives to Dreamweaver o Alternatives to Gmail o Alternatives to MATLAB o Alternatives to Minecraft o Alternatives to Google Photos o Alternatives to Photoshop o Alternatives to Skype o Alternatives to Slack o Alternatives to Trello o More... + Linux * Downloads * Frequently Asked Questions Search [ ] [Go] Why you should consider Rexx for scripting Rexx is arguably the first general-purpose scripting language. It's powerful yet easy to use. By Howard Fosdick October 17, 2022 | 7 Comments | %t min read ( ) [Save] 4 readers like this. Green graph of measurements Image by: Internet Archive Book Images. Modified by Opensource.com. CC BY-SA 4.0 How do you design a programming language to be powerful yet still easy to use? Rexx offers one example. This article describes how Rexx reconciles these two seemingly contradictory goals. History of Rexx programming language Several decades ago, computers were shifting from batch to interactive processing. Developers required a scripting or "glue" language to tie systems together. The tool needed to do everything from supporting application development to issuing operating system commands to functioning as a macro language. Mike Cowlishaw, IBM Fellow, created a solution in a language he named Rexx. It is widely considered the first general-purpose scripting language. Rexx was so easy to use and powerful that it quickly permeated all of IBM's software. Today, Rexx is the bundled scripting language on all of IBM's commercial operating systems (z/OS, z/VM, z/VSE, and IBM i). It's no surprise that in the 1990s, IBM bundled Rexx with PC-DOS and then OS/2. Rexx popped up in Windows in the XP Resource Kit (before Microsoft decided to lock in customers with its proprietary scripting languages, VBScript and PowerShell). Rexx also emerged as the scripting language for the popular Amiga PC. Open source Rexx With Rexx spreading across platforms, standardization was needed. The American National Standards Institute (ANSI) stepped forward in 1996. That opened the floodgates. Open source Rexx interpreters started appearing. Today, more than a half dozen interpreters run on every imaginable platform and operating system, along with many open source tools. Two Rexx variants deserve mention. Open Object Rexx is a compatible superset of procedural or "classic" Rexx. ooRexx is message-based and provides all the classes, objects, and methods one could hope for. For example, it supports multiple inheritance and mixin classes. Paralleling the rise in Java's popularity, Mike Cowlishaw invented NetRexx. NetRexx is a Rexx variant that fully integrates with everything Java (including its object model) and runs on the Java virtual machine. ooRexx went open source in 2004; NetRexx in 2011. Today the Rexx Language Association enhances and supports both products. The RexxLA also supports Regina, the most popular classic Rexx interpreter, and BSF4ooRexx, a tool that fully integrates ooRexx with Java. Everything Rexx is open source. Layered design So, back to the initial conundrum. How does a programming language combine power with ease of use? One part of the solution is a layered architecture. Operators and a minimal set of instructions form the core of the classic Rexx language: Rexx layered design Image by: (Howard Fosdick, CC BY-SA 4.0) Surrounding the core are the language's 70-odd built-in functions: * Arithmetic * Comparison * Conversion * Formatting * String manipulation * Miscellaneous Additional power is added in the form of external function libraries. You can invoke external functions from within Rexx programs as if they were built in. Simply make them accessible by proper reference at the top of your script. Function libraries are available for everything: GUIs, databases, web services, OS services, system commands, graphics, access methods, advanced math, display control, and more. The result is a highly-capable open source ecosystem. Finally, recall that Open Object Rexx is a superset of classic Rexx. So you could use procedural Rexx and then transition your skills and code to object programming by moving to ooRexx. In a sense, ooRexx is yet another Rexx extension, this time into object-oriented programming. Skip to bottom of list Programming and development Red Hat Developers Blog Programming cheat sheets Try for free: Red Hat Learning Subscription eBook: An introduction to programming with Bash Bash shell scripting cheat sheet eBook: Modernizing Enterprise Java An open source developer's guide to building applications Register for your free Red Hat account Rexx is human-oriented language Rexx glues all its instructions, functions, and external libraries together in a consistent, dead-simple syntax. It doesn't rely on special characters, arcane syntax, or reserved words. It's case-insensitive and free-form. This approach shifts the burden of programming from programmer to machine to the greatest degree possible. The result is a comparatively easy language to learn, code, remember, and maintain. Rexx is intended as a human-oriented language. Rexx implements the principle of least astonishment, the idea that systems should work in ways that people assume or expect. For example, Rexx's default decimal arithmetic--with precision you control--means you aren't surprised by rounding errors. Another example: All variables contain strings. If the strings represent valid numbers, one can perform arithmetic operations with them. This simple concept of dynamic typing makes all data visible and simplifies tracing and debugging. Rexx capitalizes on the advantages of interpreters to simplify program development. Tracing facilities allow developers to direct and witness program execution in various ways. For example, one can single-step through code, inspect variable values, change them during execution, and more. Rexx also raises common error conditions that the programmer can easily trap. This feature makes for more standardized, reliable code. Arrays Rexx's approach to arrays (or tables) is a good example of how it combines simplicity with power. Like all Rexx variables, you don't have to declare them in advance. They automatically expand to the size of available memory. This feature relieves programmers of the burden of memory management. To form an array, a so-called compound variable stitches together a stem variable with one or more subscripts, as in these examples: my_array.1 my_table.i.j my_list.index_value my_list.string_value my_tree.branch_one my_tree.branch_one.branch_two Subscripts can represent numeric values, as you may be accustomed to in standard table processing. Alternatively, they can contain strings. String subscripts allow you to build associative arrays using the same simple syntax as common tables. Some refer to associative arrays as key-value pairs or content addressable memory. Allowing array contents to be accessed by arbitrary strings rather than simply numeric values opens up an entirely new world of algorithmic solutions. With this flexible but consistent syntax, you can build almost any data structure: Lists, two- or three- or n-dimensional tables, key-value pairs, balanced trees, unbalanced trees, dense tables, sparse tables, records, rows, and more. The beauty is in simplicity. It's all based on the notion of compound variables. Wrap up In the future, I'll walk through some Rexx program examples. One real-world example will show how a short script using associative arrays reduced the runtime of a legacy program from several hours down to less than a minute. You can join the Rexx Language Association for free. For free Rexx downloads, tools, tutorials, and more, visit RexxInfo.org. What to read next Tags Programming Howard Fosdick User profile image. Howard Fosdick is an independent consultant who works hands-on as a DBA/SA. He's written several technical books, many articles, and is a popular conference speaker. More about me 7 Comments These comments are closed. Avatar pdecker | October 17, 2022 ( ) [Save] No readers like this yet. I used Rexx on an IBM mainframe a little over 30 years ago. One of the editors we used was Xedit. There was a PC variant of Xedit called Kedit. I still use that editor today. Its macro language was a subset of Rexx they called Kexx. An awesome scripting language. Kedit was from Mansfield Software and they sold it up until last year (2021) I think. Avatar Howard Fosdick | October 19, 2022 ( ) [Save] No readers like this yet. Yes, I remember using Mansfield Rexx on an IBM PC in the 80s. Kedit was a really good implementation. In reply to I used Rexx on an IBM... by pdecker Avatar Larry S | October 19, 2022 ( ) [Save] No readers like this yet. I am very happy to see you back writing about Rexx. I am even happier to see your rexx.info site active again. I have been programming in REXX since 1994 on VM/SP and am happily coding today on Windows and Linux using ooRexx. Rexx is alive and well. Awesome article. Avatar Howard Fosdick | October 22, 2022 ( ) [Save] No readers like this yet. Hi Larry, Thank you for your comment. I probably should have mentioned in the article that the most active forum for Rexx is run by the Rexx LA and is at https://groups.io/g/ rexxla-members. It's a useful place to get Rexx questions answered. Cheers. In reply to I am very happy to see you... by Larry S Avatar Bill Trautman | October 27, 2022 ( ) [Save] No readers like this yet. Rexx is a great language. glad to see a current article out there. I would highlight there is ObjRexx out there (object oriented flavor of Rexx). A great companion was the Pipelines tool on Z/VM. Would like to find a current option like that available for Linux. Yes, Unix has piped data but the John Hartman Pipelines tool was pipes on steroids. Avatar Marc | November 5, 2022 ( ) [Save] No readers like this yet. Hi Bill, take a look at NetRexx. It has a Pipelines implementation. In reply to Rexx is a great language. ... by Lhasadad Avatar Jeff H | November 5, 2022 ( ) [Save] No readers like this yet. Bill, you are in luck. RexxLA has, within NetRexx, Pipelines. It is modeled on the CMS version, but there are differences: CMS uses a single processing stream, the Java VM is multi. Different character sets. Some additional stages in each. Some different options in stages. User written stages in NetRexx. See "Pipelines for NetRexx QuickStart Guide," at https://netrexx.org/documentation.nsp It also documents all the available builtin stages in both versions, and the differences. As a Java VM language, it will run most anywhere, including Linux. In reply to Rexx is a great language. ... by Lhasadad Related Content Pair programming C vs. Go: Comparing programming languages Programming keyboard. Learn Tcl/Tk and Wish with this simple game An introduction to GNU Screen BASIC vs. FORTRAN 77: Comparing programming blasts from the past Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License. About This Site The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Opensource.com aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. Red Hat and the Red Hat logo are trademarks of Red Hat, Inc., registered in the United States and other countries. A note on advertising: Opensource.com does not sell advertising on the site or in any of its newsletters. Home Copyright (c)2021 Red Hat, Inc. Legal * Privacy Policy * Terms of use *