Jump to content

Object REXX

From Alfawiki
ooRexx
Company typeOpen-source programming language
IndustrySoftware development
PredecessorObject REXX, classic Rexx
Founded1988
FounderIBM (Simon C. Nash project lead)
Headquarters
International
Area served
Worldwide
OwnerRexx Language Association (RexxLA)
Websitesourceforge.net/projects/oorexx/

Object REXX represents a versatile, high-level, interpreted programming language that is object-oriented and class-based. Currently recognized as ooRexx ("Open Object Rexx"), it serves as the actively maintained open-source continuation of Object REXX.

Building upon the foundation of the traditional Rexx language, ooRexx preserves all original syntax and functions while incorporating comprehensive object-oriented programming features along with other improvements. Crafted to be straightforward to learn, operate, and maintain, ooRexx adheres to the ANSI X3.274-1996 standard, facilitating compatibility across various Rexx environments. Programs written in classic Rexx generally execute on ooRexx without requiring adjustments.

Another object-oriented Rexx variant, known as Rexx Object Oriented (“roo!”), was created by Kilowatt Software but is no longer under active development.

History

In 1988, IBM initiated the "Oryx" project led by Simon C. Nash to merge the classic Rexx language with Smalltalk's object model. The objective was to introduce object-oriented programming advantages to Rexx while maintaining its usability and backward compatibility. Initial efforts concentrated on fundamental OOP concepts such as universal object treatment, encapsulation, message passing, concurrency, classes, and inheritance.

The first prototype of Object REXX emerged in 1992 under Rick McGuire’s leadership. By 1994, IBM declared that Object REXX would supersede classic Rexx as the default interpreter in forthcoming OS/2 releases. The official launch of Object REXX occurred in 1996 with OS/2 Warp 4, featuring integration with IBM System Object Model (SOM) and Workplace Shell (WPS). Subsequent versions were made available for Windows 95/NT and Linux in 1997; AIX followed in 1999; zLinux and Solaris in 2000; with the final significant update for Windows platforms released in 2001.

On October 12, 2004, IBM ceased further development of Object REXX and transferred the source code along with licensing rights—excluding SOM and WPS components—to the non-profit Rexx Language Association (RexxLA). Although IBM ended SOM development in 1997, SOM remains vital for OS/2 systems; OS/2 editions of Object REXX continue to include SOM/WPS support found in OS/2 successors like eComStation and ArcaOS.

In 2005, the RexxLA launched ooRexx as a free open-source project under the Common Public License. The initial release of ooRexx 3.0.0 involved extensive code restructuring for enhanced clarity; later iterations rewrote the core entirely in C++ with a redesigned architecture and native interface overseen by Rick McGuire. This redevelopment enabled ooRexx 4.0.0 to support 64-bit architectures by 2009. RexxLA remains active in advancing ooRexx alongside classic Rexx and NetRexx while hosting yearly global symposia to foster community engagement.

Releases

The following table summarizes key features and modifications across major versions of Object REXX and ooRexx interpreters. All releases of ooRexx along with their documentation are freely accessible on Sourceforge. For Arch Linux users, both stable and development builds can be obtained via the Arch User Repository. Since version 5.0.0, portable interpreter builds require no installation process; an unofficial OS/2 port is also available. The "net-oo-rexx" package bundles the latest portable ooRexx release along with Netrexx, a Netrexx shell, Java bridging components and packages from Object Rexx, an ooRexx shell, plus additional utilities.

For users of IntelliJ IDEA, the ooRexxPlugin offers features such as syntax highlighting, code completion assistance, syntax validation, and Javadoc-style documentation through annotations. Since 2012, Vim editors have incorporated syntax highlighting compatible with ooRexx version 4.0 capabilities. The RexxCPS tool benchmarks interpreter speed by measuring clauses processed per second.

Major Releases Release Date Notable Features and Changes
Template:Version 1996-09-25
  • Debut official release bundled with OS/2 Warp 4
  • Introduced object-oriented constructs including SELECT statements, DO loops, IF-THEN-ELSE branching
  • Supported procedure/function invocation, stems, compound variables
  • Array management, arithmetic operations, built-in functions available
  • Provided interfaces for DB2, TCP/IP socket communication, and integration with C programs
Template:Version 1997-02-28
  • Initial Windows platform distributions launched
  • Development Edition featured dialogue libraries, editor tools, built-in tokeniser
Template:Version 1999-04-09
  • First release for AIX V4.1.5
  • Added FTP library functionality
Template:Version 2001-04-21
  • Extended support for Windows 98, Me, 2000, NT environments
  • Incorporated OLE/ActiveX objects, Windows Script Host engine integration, Unicode functionality
  • Introduced RxMath native library
Template:Version 2005-03-30
  • Marked first open-source edition release
  • Included support for 28 keyword instructions, four directives, a set of 29 classes with methods, plus 75 built-in functions
  • Added regular expressions extension class alongside ooDialog version 3.0.0
  • Enhanced PDF documentation quality
Template:Version 2006-08-21
  • Various improvements introduced; provided separate documentation for ooDialog
Template:Version 2006-11-23
  • Extended platform support to Linux, Windows, AIX, Solaris
  • Added new methods/functions within RexxUtil library; introduced CircularQueue class
Template:Version 2007-09-17
  • MacOS platform support included
  • Enhanced MutableBuffer, String, Object classes; integrated OpenOffice interface
Template:Version 2008-01-22
  • General improvements implemented
Template:Version 2009-09-30
  • Added compatibility with 64-bit Linux, AIX, Windows systems
  • Removed Windows Script Host engine support; improved C++ API design
  • Introduced new classes including Buffer, IdentityTable, Orderable, Package, Pointer, RexxContext, Routine, WeakReference, SocketClass
  • Expanded methods across multiple core classes; enhanced ooDialog features and extended Windows documentation
Template:Version 2011-09-28
  • Introduced RxUnixSys library and ooSQLite extension package
  • Improved TCP/IP socket handling and ooDialog integration; added File class and DateTime methods
  • Added extensions supporting CSV processing as well as MIME and SMTP protocols; separated documentation for Rexx core and Unix extensions
Template:Version 2014-02-23
  • Delivered over forty-three enhancements including advanced tracing capabilities
  • Released standalone installer for ooDialog; added systemd support; ensured Linux Standard Base compliance
  • Added new methods to Relation, OrderedCollections, Array, String classes; provided dedicated documentation for ooSQLite extension
Template:Version 2022-12-22
  • Incorporated eighty-six new features plus seventy-six improvements
  • Introduced new classes such as AlarmNotification, Json handling class, MessageNotification, RexxInfo utility class, StringTable collection class, Validate class
  • Expanded core class methods including enhancements to RxFtp
  • Released separate documentation sets covering ooRexxUnit testing framework, orxnCurses library functionalities as well as C/C++ APIs and build environment details
Template:Version Expected: 2025-05-02
  • Delivered thirty-six improvements including updates to Json handling class
  • Added oleinfo scripts facilitating Windows automation tasks
  • Introduced TraceObject class designed for tracing multi-threaded applications


Design philosophy

ooRexx follows the traditional Rexx design approach, emphasizing a human-centric programming language that prioritizes ease of learning, coding, recall, and maintenance. This is accomplished by maintaining a compact language core and adhering to the principle of least astonishment. The syntax is designed to be readable, case-insensitive, and free-form, requiring minimal punctuation while employing clear English-like commands. As a dynamic programming language, ooRexx provides developers with the versatility to concentrate on application logic rather than language limitations.

In line with classic Rexx's "documentation before implementation" concept, ooRexx offers thorough documentation consistent with the IBM Style Guide, featuring syntax diagrams and practical examples.

Instructions

The instruction set in ooRexx consists of assignment instructions, keyword instructions, and command instructions. To keep the language streamlined, it includes only thirty keyword instructions. Unlike many other languages, no keywords are reserved; thus, terms such as DO, SAY, END, and IF can also serve as variable identifiers, minimizing the need to memorize reserved words. Assignments utilize the equal sign (=) and support eleven operators for compound assignments like += and *=. Keyword instructions including ARG, PARSE, PULL, and USE behave similarly to assignment operations.

Instructions that do not fall under assignments or keyword instructions must be either string literals or valid expressions interpreted as command instructions. These commands are executed by the operating system, with their exit status stored in the variable RC. The ADDRESS instruction allows redirection of commands to particular environments such as Bourne shell, Bash (Unix shell), Z shell, Cmd.exe, as well as various editors including ISPF, TSO EDIT, and adaptations of XEDIT.

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> a = "hello world" /* assignment instruction */ do i = 1 to 2 /* keyword instruction "DO" */

 say "round #" i":" a      /* keyword instruction "SAY"        */

end /* keyword instruction "END" */ "echo Hello World" /* command to operating system */ say "RC:" rc /* command's numeric return code */ </syntaxhighlight>

Beyond the three traditional Rexx instruction categories, ooRexx introduces directive instructions positioned at the conclusion of programs. Following program loading and syntax validation, directives establish the execution environment prior to running other instructions. They can define routines, classes, methods, attributes, or settings such as arithmetic precision. Directives are easily identifiable by their prefix of two colons (::).

To enhance code reusability, the ::REQUIRES directive imports other Rexx programs (packages) or external native libraries. This grants immediate access to all routines and classes marked as PUBLIC within the imported package. External packages commonly use the .cls file extension (for example, ::requires "csvstream.cls", ::requires "json.cls"). Some of these external packages are included with the ooRexx interpreter itself.

Free-form

ooRexx adopts a free-form syntax that disregards the placement of code, providing extensive flexibility. Prior to running, the interpreter condenses sequences of unquoted whitespace into a single space, while text enclosed within quotation marks remains intact. Concatenation can be performed explicitly using two vertical bars (||) or implicitly by placing terms adjacent or separated. Clauses may extend across several lines by employing a comma (,) or minus sign (-) as line continuation markers, and multiple clauses can also be written on a single line separated by semicolons (;). This free-form design minimizes syntactical restrictions and facilitates learning by lowering the mental effort required.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">say "Hello World!" /* output: Hello World! */ say " This" 'is' - /* trailing dash for continuation */

       "REXX"   || "!"     /* output:    This is REXX!         */</syntaxhighlight>

Case-insensitive

In line with traditional Rexx, ooRexx is a case-insensitive language. The interpreter converts all characters outside of quotation marks to uppercase and disregards case differences in commands, variable identifiers, and other components. Only the content inside quotes preserves its original case. This behavior decreases syntax errors and simplifies the learning curve.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> a = "This is" rexx! Say A /* output: This is REXX! */ SAY a /* output: This is REXX! */ </syntaxhighlight>

Everything is an Object

Departing from classic Rexx’s "Everything is a String" philosophy, ooRexx treats all entities—including arrays and streams—as objects manipulated through methods rather than standalone functions. String variables point to string objects without requiring explicit declarations, reducing programmer overhead compared to strongly typed languages. These strings can contain any number of characters or digits, allowing numeric operations via string methods. Moreover, string variables may hold executable code fragments that are run using the INTERPRET command.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> a = 2 /* string with numerical value */ a = a || '0' /* resulting string: 20 */

str = "do i = 1 to "a"; say i; end" /* string contains loop instruction */ interpret str /* interpret string: counts to 20 */ </syntaxhighlight>

Message paradigm

Following the example of Alan Kay's Smalltalk, ooRexx treats every element as an object capable of receiving messages, which supports newcomers in grasping object-oriented programming principles. Unlike Smalltalk, ooRexx employs an explicit message operator—the tilde (~)—where the receiver appears on the left side and the outcome of the operation is returned. Sending messages activates corresponding methods that manipulate the receiver object. For chaining messages, double tildes (~~) are used; these return the receiver itself instead of the method’s result.

Most methods permit behavior customization through options that can be fully spelled out or abbreviated and are case-insensitive, improving code clarity and easing comprehension. For instance, strip removes leading and trailing spaces by default but can be tailored with parameters such as "leading" or "l". Unlike nested function calls in classic Rexx, ooRexx supports chaining messages for more readable expressions.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> a = " I am ooRexx!" say a /* output: I am ooRexx! */ say a~Strip("Leading") /* output: I am ooRexx! */ say a~strip("l")~reverse /* output: !xxeRoo ma I */ </syntaxhighlight>

Compatibility

ooRexx preserves the entirety of traditional Rexx functionalities and adheres to the ANSI Rexx specification (X3.274-1996). In contrast to the optional elements of this standard, ooRexx does not support symbols such as @, #, $, or ¢. While classic Rexx assigns default values in statements like b. = a., ooRexx instead establishes aliases. Additionally, ooRexx recognizes -- for comments and - for continuing lines, features that are not defined within the ANSI standard.

Most scripts written in classic Rexx execute on ooRexx without modification, which facilitates a smooth transition toward object-oriented programming while safeguarding existing code assets. However, certain platform-dependent functionalities (for example, Rexx’s PARSE EXTERNAL on z/VM) are not supported. Furthermore, unlike classic Rexx which permits empty assignments such as x = ;, ooRexx mandates the use of quotation marks, requiring assignments like x = "";.

Customization

ooRexx offers extensive customization capabilities, including the ability to extend built-in classes and functions, incorporate new command environments, define invocation switches, or produce tailored builds.

Users can override built-in functions by appending a label with the same name as the function at the end of their program or by utilizing a ::routine directive. This mechanism enables altering or substituting the original function’s behavior. For example: <syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> say Date() /* e.g., 16 JUN 2025 */ exit

Date: return newDate() /* label directs to "newDate" routine */

Routine newDate
 newDate = date()~upper       /* invokes built-in date(), converts to uppercase */
 return newDate

</syntaxhighlight>

Starting with ooRexx 5.0.0, namespaces facilitate subclassing of built-in classes. This enhancement allows developers to augment classes by adding methods such as ArrayInClose to the stream class, enabling file operations like opening, reading, and closing within a single method call: <syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> Say .stream~new("someFile.txt")~ArrayInClose

Class stream subclass rexx:stream /* subclassing stream */
 ::Method ArrayInClose                     /* method added to stream */
   self~open                               /* open stream            */
   FileContent = self~ArrayIn              /* read contents          */
   self~close                              /* close stream           */
   return FileContent                      /* return read data       */

</syntaxhighlight>

The UNKNOWN method empowers objects to respond to undefined messages by accepting both the invoked method name and an array of arguments. This feature is fundamental to the Java Bridge, which grants access to all Java methods seamlessly: <syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> PackageObj = .Package~new PackageObj~SomeMethod("First", "Second", "Third")

Class Package
 ::Method Init
 ::Method Unknown
   Use arg MethodName, ArgArr
   say "Method was:" MethodName        /* outputs: Method was: SOMEMETHOD     */
   say ArgArr                          /* outputs: First, Second, Third       */

</syntaxhighlight>

Features

ooRexx incorporates essential object-oriented programming capabilities, including subclassing, polymorphism, data encapsulation, and multiple inheritance through the use of mixin classes. The interpreter provides the rexxc tool, which compiles ooRexx scripts into source-free files encoded with base64. These compiled files offer quicker startup times by bypassing the initial parsing and compilation phases.

Parsing

The PARSE command facilitates streamlined string parsing combined with variable assignment in a single operation. It can process input from sources such as ARG (command-line arguments), VAR (variables), PULL (input queues or standard input), and VALUE (expressions). When handling VALUE, the keyword WITH is used to specify the boundaries of expressions preceding the parsing pattern, which may include variables, positions, or delimiters. Additionally, options for case conversion can be applied prior to parsing.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> str = "Person: Rick McGuire" parse var str a ":" b c say b c </syntaxhighlight>

Procedure and function

In ooRexx, the ::ROUTINE directive allows defining procedures and functions independently of classes. Differing from the traditional PROCEDURE, routines implicitly return a value. Procedures are invoked using the CALL statement, while functions are called by their routine name followed by parentheses enclosing arguments. For string parameters, PARSE ARG is suitable; however, for other object types, USE ARG must be employed. The STRICT keyword ensures that the number of arguments matches exactly.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> call DoSomething table = .stem~new table[1] = 2; table[2] = 4 say indsum{table,1.2) say dirsum(2,4)

Routine DoSomething
 say "I did something!"                
Routine dirsum
 parse arg first, second               
 return first+second
Routine indsum
 use strict arg table, first, second   
 Sum = table{first} + table[second]    
 return Sum                            

</syntaxhighlight>

Class and Method

To declare a new class, ooRexx uses the ::CLASS directive followed by the class name. This directive supports options such as METACLASS, SUBCLASS, MIXINCLASS, ABSTRACT, and INHERIT, which enable various object-oriented programming features. Methods within a class are defined using the ::METHOD directive associated with the most recently declared class. The ::ATTRIBUTE directive generates accessor methods to get or set object variables. Furthermore, the EXPOSE statement permits direct access to an object’s variable within a method.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> d = .dog~new("Bella") /* create and assign a dog */ d~bark /* send bark message */ say d~name /* output: Bella */

class dog /* class directive */
attribute name /* attribute directive */
method init /* object initiation method */
 Expose name                   /* exposes name of dog      */
 use arg name                  /* assigns "Bella" to name  */
method bark /* method directive */
 Expose name
 say Name "goes woof!"         /* output: Bella goes woof! */

</syntaxhighlight>

Error handling

The SIGNAL keyword governs the interception of conditions such as ERROR, FAILURE, SYNTAX, and HALT, allowing these traps to be toggled ON or OFF. A universal trap, ANY, captures any conditions not explicitly handled. Other specific traps include LOSTDIGITS, NOMETHOD, NOSTRING, NOTREADY, and NOVALUE.

To obtain details about the active trapped condition—such as its name, status, descriptive message, and associated objects—the built-in CONDITION function is used.

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> Signal on Syntax /* enable SYNTAX trap */

Say 1 + "AString" /* invalid arithmetic operation */

Exit

SYNTAX:

 ConditionObject = Condition(Object)         /* retrieve further details     */
 say "Error code is" ConditionObject~Code    /* output: Error code is 41.1   */
 say ConditionObject~ErrorText                /* output: Bad arithmetic conversion. */

</syntaxhighlight>

Moreover, the CALL instruction can trigger routines that manage condition trapping through commands such as CALL ON HALT or CALL OFF HALT. These commands do not clear the control stack, enabling normal program flow once the handler completes.

Multi-threading

ooRexx facilitates object-based concurrent execution, where objects independently run their methods and communicate by exchanging messages. Multiple objects can operate simultaneously, synchronizing through message passing. Concurrency is activated using the REPLY keyword, which allows a method to return early while continuing execution on a separate thread. The GUARD keyword designates methods as unguarded, permitting them to run concurrently alongside other class methods. Additionally, the START method enables message processing in new threads, further supporting concurrent operations.

Tracing

Maintaining traditional Rexx debugging capabilities, ooRexx offers the TRACE statement and the TRACE() function for runtime control over trace output and interactive debugging sessions. The introduction of the TraceObject class in version 5.1.0 enhances tracing in multi-threaded environments by simplifying detection of guarded or blocked methods.

Trace levels provided include "Thread", "Standard", "Full", and "Profiling". Selecting the "Full" level produces comprehensive runtime information such as instance identifiers, thread IDs, invocation numbers, guard states, lock counts, and wait conditions.

The ooRexx debugger, which is part of the "net-oo-rexx" package, extends tracing functionality with a graphical user interface (GUI) accessible through the Java bridge, enabling cross-platform debugging support.

Built-in functions and classes

ooRexx preserves compatibility with traditional Rexx by providing 82 built-in functions in version 5.1.0 that cover character processing, data conversion, and informational tasks—many of which are implemented via the String class. The RexxUtil dynamic link library adds further capabilities through 29 cross-platform functions along with 25 Windows-specific and four Unix-specific functions that manage system files, directories, classes, and objects.

Reflecting its object-oriented architecture, ooRexx delivers most functionality through 58 built-in classes organized into Fundamental, Stream, Collection, and Utility groups.

Core classes

Core classes form the foundation upon which all other classes are built. At the top of the class hierarchy lies the Object class, which provides essential methods and properties available universally. The Class (a meta class) oversees the management of class characteristics and the instantiation of objects; each use of the ::CLASS directive results in the creation of a class object instance. The Method and Routine classes are responsible for generating objects representing methods or routines. The String class facilitates various string manipulations such as logical operations, concatenation, copying, joining, splitting, reversing, arithmetic operations, and type conversion. The Package class handles the organization of routines, classes, methods, and external dependencies declared with ::REQUIRES. For concurrent execution, the Message class allows asynchronous message dispatching to invoke methods.

Stream classes

Stream classes enable communication with external entities including files, queues, serial ports, and hardware devices. The Stream class is a subclass that combines features from InputOutputStream, InputStream, and OutputStream. It provides functionality for opening streams, reading and writing data, closing streams, flushing buffers, setting file paths, and obtaining information about streams. For instance, invoking the OPEN method activates a stream; ARRAYIN reads data into an array structure; while CLOSE explicitly terminates the stream before it is cleaned up by garbage collection.

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">StreamObj = .stream~new("someFile.txt") /* instantiate stream object */ StreamObj~open /* open stream */ FileContent = StreamObj~ArrayIn /* read data into array */ StreamObj~close /* close stream */

say FileContent /* display contents */</syntaxhighlight>

Collection classes

Collections are objects designed to hold multiple elements accessible via indexed references using either AT or bracket notation []. The primary collection types include MapCollection, SetCollection, and OrderedCollection, each providing tailored operations for managing grouped data.

MapCollection acts as a mixin offering methods for collections that associate keys with values. Classes such as Directory, StringTable, IdentityTable, Properties, Table, Relation, and Stem derive their functionality from MapCollection. Both Directory and StringTable maintain unique string keys; IdentityTable links one element per key. The Properties class supports saving to and loading from property files. In contrast to Table—which enforces unique keys—Relation permits multiple entries sharing identical keys of any type.

A Stem object is generated automatically when working with compound variables (stem.tail). The stem portion starts with a letter while the tail can be any character sequence. Numeric tails allow simulating arrays or multidimensional arrays, providing versatile data structuring.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">fruits.1 = "Apple" fruits.4 = "Orange" say fruits.4 say fruits.[1] </syntaxhighlight>

SetCollections specialize MapCollections where each element’s key is identical to its value. Within a Set, keys are unique; however, in a Bag, duplicates are permitted.

OrderedCollection serves as a mixin for collections that maintain an intrinsic order among elements. Examples include List, Queue, CircularQueue, and Array. A List supports insertion at arbitrary positions while preserving stable indices. Queues allow element removal from the front and insertion at either end. CircularQueue has a fixed capacity where new additions overwrite the oldest entries in a cyclic manner.

The Array class models sequences indexed by integers and features a MAKESTRING method that converts elements into string form.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> ArrayObj = .array~of("One", "Two", "Three") say ArrayObj~at(2) say ArrayObj~makeString(,"; ") </syntaxhighlight>

Utility classes

The utility class collection encompasses 31 implementations designed to simplify frequent operations. The MutableBuffer class enhances the efficiency of string manipulations by eliminating the need to create new objects during concatenation. Directory file listings and file metadata retrieval are facilitated by the File class.

Classes DateTime and TimeSpan provide capabilities for obtaining, formatting, and performing calculations with dates and times. Sorting support for built-in data types such as File and DateTime is offered through comparator classes. The Supplier class, along with its derivative StreamSupplier, allows indexed enumeration over collections of items. Argument validation, including type and range checks, is handled by the Validate class. Object referencing is managed by VariableReference, while WeakReference creates references that do not pin objects in memory.

The RegularExpression class improves pattern clarity by permitting symbolic character groupings (for example, [:alpha:] to represent alphabetic characters) instead of complex character sets.

Additional utility classes provide contextual information about the running environment (RexxContext), platform and language details (RexxInfo), and execution stack information (StackFrame). Integration with native C/C++ APIs is supported through the Buffer and Pointer classes. Notification mechanisms are implemented via the Alarm and Ticker classes, while thread synchronization employs the EventSemaphore and MutexSemaphore. Message forwarding to designated targets is managed by the Monitor class, and the RexxQueue class offers object-like interfaces to external Rexx data queues.

External packages and libraries

Programs can incorporate external libraries tailored for specialized tasks by using the ::REQUIRES directive combined with the LIBRARY option.

Supplied with interpreter

The Rexx extension library provides classes for handling comma-separated values (CSV) files as well as processing JavaScript Object Notation data formats. Included is the “hostemenu” library, which partially replicates a TSO/CMS environment. Network protocol integration is supported through RxSock, a native library enabling TCP/IP functionality, while RxFtp facilitates FTP operations. Advanced mathematical computations—such as square root, exponentiation, logarithms, trigonometric functions, and power calculations—are available via RxMath.

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> Say rxcalcsin(1) /* output: 0.0174524064 */

requires 'rxmath' LIBRARY /* load a native library */

</syntaxhighlight>

On Windows platforms, ooRexx includes the ooDialog framework for building Windows dialog boxes and graphical user interfaces, accompanied by sample programs illustrating its use. For systems compatible with POSIX, orxnCurses enables text-based UI development utilizing the ncurses library. The RxUnixSys library offers functions to interact with processes, threads, users, groups, files, and file systems across most Unix environments. Many of these libraries maintain compatibility with other Rexx implementations.

Interpreter Not Included

Certain components must be manually downloaded and installed. Within the Net-oo-rexx collection, the Regex module manages regular expression processing, Log4rexx serves as a logging framework, and Oorexxshell offers an interactive shell environment for ooRexx.

The Mod_Rexx module functions as an extension for Apache 2.4 across Windows, AIX, and Linux platforms, allowing Apache requests to be fully handled through ooRexx. The Rexx Parser package provides an abstract syntax tree parser designed for Rexx and ooRexx scripts, organizing the elements of the code. Complementing this, the Rexx Highlighter package builds upon the parser to generate syntax-highlighted output in formats such as HTML, ANSI color codes, LuaTeX, and LaTeX. Additionally, the Rexx XML parser supports parsing XML documents into an in-memory structure accessible via a DOM-style interface.

Inspired by JUnit, ooRexxUnit is a testing framework that runs ooRexx test scripts to validate application requirements.

Integration Bridges

Although ooRexx no longer bundles classes supporting SOM and WPS as found in Object REXX, it offers application programming interfaces (APIs) to facilitate integration with C and C++. A separate library provides a two-way bridge for interaction between ooRexx and Java. Additional class libraries enable SQL database connectivity as well as automation of Windows applications. At the 36th Rexx Symposium, a prototype bridge connecting to Python was demonstrated.

C/C++ Interfaces

ooRexx incorporates APIs that allow extension of Rexx through C programs and vice versa. These enable creation of subcommand handlers, external functions to expand the ooRexx function library, and system functions to tailor interpreter operations.

With the release of ooRexx 4.0.0, C++ APIs were introduced that permit mutual extension between C++ programs and ooRexx. These extensions are packaged as dynamic link libraries on Windows or shared libraries on Unix-like systems and can be loaded using the ::REQUIRES directive or the EXTERNAL keyword within ::ROUTINE, ::METHOD, or ::ATTRIBUTE declarations.

Java Integration

Leveraging the C++ APIs, BSF4ooRexx was created as a bidirectional Java bridge built upon the Bean Scripting Framework. This bridge facilitates smooth interaction between ooRexx and Java objects in both directions. It is activated by requiring the ooRexx package BSF.CLS, which supplies public routines, classes, and the environment symbol .BSF4REXX. Use cases include working with AWT, Swing, JavaFX, JDBC, and Java 2D. <syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">/* instantiate Java object */ frame=.bsf~new("javax.swing.JFrame", "Hello, my beloved world - from ooRexx!") frame~setSize(410,20) frame~visible=.true call SysSleep 10

requires "BSF.CLS"</syntaxhighlight>

Building on BSF4ooRexx’s capabilities, support for interaction with Universal Network Objects (UNO) used in OpenOffice.org and LibreOffice is provided through the UNO.CLS package. The CLR.CLS package combined with Jini4Net offers integration with the .NET Framework. Communication with Linux processes via the D-Bus middleware is enabled by the DBUS.CLS package.

The JDOR.CLS package includes a command handler utilizing Java2D classes (based on AWT) for graphical rendering. An experimental extension named JDORFX.CLS supports 3D rendering through JavaFX 3D classes.

SQL

The ooSQLite class provides an interface to SQLite, a compact, serverless, zero-configuration, transactional SQL database engine. It allows seamless interaction with various SQL database types without needing modifications to the scripts, although it does not support multi-threading.

Access to multiple vendors' SQL databases is facilitated by the external Rexx/SQL package through Open Database Connectivity (ODBC). To extend capabilities beyond a limited ODBC subset and guarantee thread safety, the Rexx MySQL library offers a C-language wrapper that introduces MySQL compatibility.

Windows automation

The Windows extension incorporates the Windows Script Host (WSH) Scripting Engine for automating tasks and supports Object Linking and Embedding/ActiveX (OLE) via the OLEObject. OLE Automation, created by Microsoft, provides inter-process communication using a subset of the Component Object Model (COM), enabling function calls, attribute manipulation, and event management within applications.

ooRexx includes sample code illustrating OLE integration with applications such as Access, Word, Excel, OpenOffice/LibreOffice, ActiveDirectory, WMI, among others. A tool for discovering available OLE objects is also provided.

In addition to OLE support, the Windows extension offers capabilities to interact with the Windows program manager, system event logs, clipboard, and registry. It further allows querying and modifying windows, menus, and submenus.

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> exc = .OLEObject~new("Excel.Application") /* instantiate Excel object */ exc~visible = .true /* display Excel window */ Worksheet = exc~Workbooks~Add~Worksheets[1] /* add a new worksheet */ Worksheet~cells(1,1)~Value = “First Cell” /* set cell content */ </syntaxhighlight>