Jump to content

OoREXX

From Alfawiki
Adapted from the English Wikipedia article OoREXX, available under CC BY-SA 4.0Updated 9 August 20251 source
ooRexx
Company typeOpen-source software
IndustryProgramming language
PredecessorObject REXX, Rexx
Founded1988
FounderSimon C. Nash, Rick McGuire
Headquarters
International
OwnerRexx Language Association (RexxLA)
Websitesourceforge.net/projects/oorexx/

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

Derived from the traditional Rexx language, ooRexx preserves all original syntax and features while introducing comprehensive object-oriented functionality and improvements. It is engineered for straightforward learning, practical use, and easy maintenance. Conforming to the ANSI X3.274-1996 standard, ooRexx ensures compatibility across platforms with other Rexx variants. Programs written in classic Rexx generally operate on ooRexx without requiring changes.

History

The inception of Object REXX traces back to 1988 with IBM’s "Oryx" initiative, spearheaded by Simon C. Nash, which merged classic Rexx with Smalltalk’s object-oriented model to integrate OOP benefits while retaining backward compatibility.[1] Under the guidance of Rick McGuire, the first Object REXX prototype emerged in 1992. By 1994, IBM declared Object REXX as the successor to classic Rexx for OS/2’s standard interpreter.

Object REXX debuted within OS/2 Warp 4 in 1996 and was subsequently released for Windows 95/NT and Linux in 1997, followed by AIX in 1999, then zLinux and Solaris in 2000. The most recent significant Windows update occurred in 2001.

IBM ceased Object REXX development in October 2004 and transferred its source code along with licensing rights—excluding SOM and WPS components—to the non-profit Rexx Language Association (RexxLA). The OS/2 version retained support for SOM/WPS frameworks vital to OS/2’s Workplace Shell environment, which continues to be utilized by successors such as eComStation and ArcaOS.

In 2005, RexxLA launched ooRexx as free open-source software under the Common Public License. The initial release reorganized IBM’s codebase for better clarity; subsequent C++ rewrites introduced a redesigned architecture and native interface. This evolution enabled ooRexx version 4.0.0 to support 64-bit platforms by 2009. RexxLA remains active in advancing ooRexx alongside classic Rexx and NetRexx, hosting annual global symposia to engage the language community.

Releases

The following table outlines significant features and updates across major Object REXX and ooRexx interpreter versions. All versions of ooRexx along with their documentation are freely accessible on Sourceforge. For Arch Linux users, both current stable and development builds can be found through the Arch User Repository. Starting from version 5.0.0, portable interpreter editions require no installation steps; an unofficial OS/2 port is also available. The "net-oo-rexx" package bundles include the latest portable ooRexx interpreter, Netrexx, a Netrexx shell, the Java bridge with related components, an ooRexx shell, plus additional utilities.

For IntelliJ IDEA, the ooRexxPlugin offers features such as syntax highlighting, error detection, code completion, and Javadoc-style documentation through annotations. Since 2012, Vim supports syntax highlighting tailored for ooRexx version 4.0 capabilities. The RexxCPS benchmark assesses interpreter performance by counting Rexx 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 programming model alongside control flow constructs like SELECT, DO, IF-THEN-ELSE
  • Supported procedure/function invocations, stems, compound variables
  • Included array processing, arithmetic operations, built-in functions
  • Provided interfaces to DB2, TCP/IP sockets, and C language applications
Template:Version 1997-02-28
  • Initial release targeting Windows platforms
  • Development Edition introduced dialogue libraries, an editor, and an integrated tokeniser
Template:Version 1999-04-09
  • First AIX V4.1.5 compatible release
  • Added FTP library support
Template:Version 2001-04-21
  • Extended compatibility to Windows 98, Me, 2000, NT
  • Incorporated OLE/ActiveX integration, Windows Script Host (WSH), Unicode functions
  • Introduced native RxMath library
Template:Version 2005-03-30
  • Marked first open-source edition
  • Supported 28 keyword instructions, four directives; included 29 classes with methods and 75 built-in functions
  • Added extension class for regular expressions plus ooDialog version 3.0.0
  • Improved PDF documentation quality
Template:Version 2006-08-21
  • Various improvements implemented; separated ooDialog documentation provided
Template:Version 2006-11-23
  • Expanded platform support to Linux, Windows, AIX, Solaris
  • Enhanced RexxUtil with additional methods/functions; introduced CircularQueue class
Template:Version 2007-09-17
  • Added MacOS compatibility
  • New methods introduced for MutableBuffer, String, Object
  • Integrated OpenOffice interface support
Template:Version 2008-01-22
  • Delivered multiple enhancements across various components
Template:Version 2009-09-30
  • Introduced compatibility with 64-bit Linux, AIX, Windows environments
  • Discontinued WSH engine support; enhanced C++ API capabilities
  • Added new classes including Buffer, IdentityTable, Orderable, Package, Pointer, RexxContext, Routine, WeakReference, SocketClass
  • Expanded method sets for core classes and ooDialog; included sample programs; provided separate Windows extension documentation
Template:Version 2011-09-28
  • Added RxUnixSys library alongside ooSQLite extension
  • Improved TCP/IP socket handling and enhanced ooDialog support
  • Introduced new File class; extended capabilities of DateTime
  • Included extensions for CSV parsing, MIME processing, SMTP handling; separate documentation for Rexx and Unix extensions available
Template:Version 2014-02-23
  • Implemented over forty-three improvements including advanced tracing features
  • Released standalone installer for ooDialog; added new classes/methods
  • Introduced systemd compatibility; ensured Linux Standard Base compliance
  • Extended collection and buffer methods; separate documentation provided for ooSQLite
Template:Version 2022-12-22
  • Delivered eighty-six new features along with seventy-six enhancements
  • Introduced classes such as AlarmNotification, Json, MessageNotification, RexxInfo, StringTable, Validate
  • Broadened method sets in key classes including networking modules (RxFtp)
  • Separate manuals provided for ooRexxUnit testing framework, orxnCurses library, C/C++ APIs, and build environment
Template:Version 2025-05-02
  • Rolled out thirty-six enhancements including improvements to the Json class
  • Added oleinfo scripts facilitating streamlined automation on Windows platforms
  • Introduced TraceObject class enabling multi-threaded program tracing capabilities


Design philosophy

ooRexx adheres to the fundamental Rexx approach, emphasizing a user-friendly programming language designed for simplicity in learning, coding, recalling, and upkeep. This goal is met by maintaining a concise language structure and following the principle of least astonishment. Its syntax is highly readable, case-insensitive, free-form, requires minimal punctuation, and employs clear English-like commands. As a dynamic programming language, ooRexx provides adaptability that allows developers to concentrate on coding without being hindered by language limitations.

Consistent with the "documentation before implementation" concept, ooRexx offers thorough documentation aligned with the IBM Style Guide, featuring syntax charts and practical examples.

Instructions

ooRexx preserves the traditional Rexx categories of instructions: assignment, keyword, and command types. To ensure compactness, it supports only thirty keyword instructions. Unlike many other languages, no keywords are reserved; thus, terms such as DO, SAY, END, and IF can serve as variable identifiers, avoiding the need to remember reserved words. Assignments are made using the equal sign (=) and also allow compound operators like +=, -=, and *=. Keyword instructions including ARG, PARSE, PULL, and USE operate similarly to assignment statements.

Instructions that do not fall under assignment or keyword types are classified as command instructions; these send strings directly to the operating system and set a return code variable (RC). The ADDRESS instruction enables directing commands toward specific environments such as Bourne shell, Bash, Z-Shell, Cmd.exe, or editors like ISPF and 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>

In addition to the original three instruction categories from classic Rexx, ooRexx introduces directive instructions identified by double colons (::). These directives—examples include ::ANNOTATE, ::CLASS, ::METHOD, and ::REQUIRES—must be placed at the conclusion of the program. Once loaded and syntax-checked, these directives establish the execution environment before other code runs. They define elements such as routines, classes, methods, attributes, or execution settings like arithmetic precision.

The ::REQUIRES directive enhances modularity by allowing inclusion of other Rexx programs (packages) or external native libraries. It grants access to all routines and classes flagged as PUBLIC within the referenced package. Typically, external packages use the .cls file extension (for example, ::requires "csvstream.cls"). A number of such external packages are bundled with the ooRexx interpreter.

Free-form

ooRexx utilizes a free-form syntax that permits flexible arrangement of code elements. Prior to running, the interpreter condenses consecutive unquoted whitespace into a single space, while text enclosed in quotation marks remains intact. Concatenation is performed either explicitly with double vertical bars (||) or implicitly by placing terms adjacent or separated by spaces. Clauses may extend across several lines by using a comma (,) or a minus sign (-) as line continuation markers, and multiple clauses can be placed on one line separated by semicolons (;). This approach minimizes syntactic rules and lowers the intrinsic cognitive load, making the language easier to learn.<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 keeping with traditional Rexx, ooRexx is case-insensitive. The interpreter converts all characters outside of quotation marks to uppercase and disregards case differences in commands, variables, and language constructs. Only literal strings within quotes preserve their original casing. This feature simplifies learning and helps avoid syntax mistakes.<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 concept of "Everything is a String," ooRexx treats all data types—including arrays and streams—as objects accessed through methods rather than functions. String variables refer to string objects without requiring declarations, streamlining development compared to strongly typed languages. These string objects can hold any characters or numeric values, allowing arithmetic operations via string methods. Moreover, string variables can contain executable code evaluated dynamically using the INTERPRET instruction.<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 messaging model found in Alan Kay's Smalltalk, ooRexx considers everything an object capable of receiving messages. This message-passing mechanism assists newcomers in grasping object-oriented programming principles. Unlike Smalltalk, ooRexx employs an explicit message operator—the tilde (~)—with the target object on the left side; this operation yields a result. Messages can be chained using double tildes (~~), which return the receiver object itself instead of the method’s output.

Default behaviors of most methods are customizable through options that can be fully spelled out or abbreviated and are case-insensitive, enhancing code clarity and ease of use. For instance, the strip method removes both leading and trailing spaces by default but can be tailored with parameters such as "leading" or "l". Unlike traditional nested functions in classic Rexx, ooRexx supports chaining messages, which improves statement readability.<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 fully retains the capabilities of traditional Rexx and adheres to the ANSI Rexx standard (X3.274-1996). However, it diverges from the standard's optional elements by omitting certain symbol characters such as @, #, $, and ¢. While classic Rexx interprets b. = a. as assigning a default value, ooRexx treats this as creating an alias instead. Moreover, ooRexx introduces support for -- to denote comments and uses - to continue lines, features not specified in the ANSI standard.

Most scripts written in classic Rexx execute without modification on ooRexx, which simplifies a phased transition to object-oriented programming without discarding existing codebases. Certain platform-dependent limitations remain, such as the lack of support for PARSE EXTERNAL on z/VM. Additionally, assignments that are empty in classic Rexx like x = ; must be written with empty strings in ooRexx (e.g., x = "";).

Customization

ooRexx offers broad customization options, including the ability to extend built-in functions and classes, introduce new command environments and startup options, or generate tailored builds.

To override built-in functions, one can append a label matching the function name at the end of the program or employ a ::routine directive. This mechanism enables altering or replacing default function behaviors to better fit specific organizational requirements.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> say Date() /* example output: 16 JUN 2025 */ exit

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

Routine newDate
 newDate = date()~upper       /* invokes date() BIF with uppercase letters   */
 return newDate

</syntaxhighlight>

Starting with ooRexx 5.0.0, namespaces facilitate subclassing built-in classes, empowering developers to expand functionality seamlessly. For instance, introducing an ArrayInClose method into the stream class automates the process of opening, reading from, and closing streams within that class.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> Say .stream~new("someFile.txt")~ArrayInClose

Class stream subclass rexx:stream /* define subclass of stream */
 ::Method ArrayInClose                     /* add new method to stream class   */
   self~open                               /* open the stream                  */
   FileContent = self~ArrayIn              /* read file content                */
   self~close                              /* close the stream                 */
   return FileContent                      /* return the data                  */

</syntaxhighlight>

The UNKNOWN method provides objects with the ability to manage unrecognized messages dynamically. This feature is extensively utilized by the Java Bridge for transparent invocation of Java methods.<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        /* output example: Method was: SOMEMETHOD     */
   say ArgArr                          /* output example: First, Second, Third       */

</syntaxhighlight>

Features

ooRexx incorporates fundamental object-oriented programming capabilities, including subclassing, polymorphism, data encapsulation, and supports multiple inheritance through the use of mixin classes. The interpreter is bundled with the rexxc tool, which compiles ooRexx scripts into optionally base64-encoded, source-free files that enable quicker startup by bypassing the initial parsing and compilation phases.

Parsing

The PARSE instruction facilitates streamlined string analysis and simultaneous variable assignment. Input sources can be designated using keywords such as ARG (for arguments), VAR (for variables), PULL (for data queues or standard input), or VALUE (for expressions). When VALUE is selected, the WITH keyword marks the end of the expression, followed by a parsing template consisting of variables, position indicators, or delimiters, which may be combined. Optionally, the string can undergo case conversion before parsing.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> str = "Person: Rick McGuire" parse var str a ":" b c say b c /* output: Rick McGuire */ </syntaxhighlight>

Procedure and function

In ooRexx, the ::ROUTINE directive defines standalone procedures and functions outside class scopes. Differing from the legacy PROCEDURE, routines include an automatic RETURN. Procedures are invoked using the CALL statement, whereas routines that return values are called like functions with parentheses enclosing arguments. While string parameters are parsed via PARSE ARG, other object types require USE ARG. The STRICT keyword enforces exact argument count compliance.<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

A new class is declared with the ::CLASS directive followed by its identifier. Object-oriented features are enhanced through options such as METACLASS, SUBCLASS, MIXINCLASS, ABSTRACT, and INHERIT. The ::METHOD directive attaches a method to the most recently defined class. Object variable accessors are created using the ::ATTRIBUTE directive. Additionally, the EXPOSE command allows an object variable to be directly accessible within a method.<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> d = .dog~new("Bella") /* instantiate a dog object */ d~bark /* invoke bark method */ say d~name /* output: Bella */

class dog /* define class */
attribute name /* create accessor */
method init /* constructor method */
 Expose name                   /* expose object variable   */
 use arg name                  /* assign "Bella" to name   */
method bark /* method definition */
 Expose name
 say Name "goes woof!"         /* output: Bella goes woof! */

</syntaxhighlight>

Error handling

The SIGNAL command controls the activation and deactivation of specific condition traps such as ERROR, FAILURE, SYNTAX, or HALT. For conditions that do not fall under these particular traps, the ANY trap serves as a catch-all, intercepting exceptions like LOSTDIGITS, NOMETHOD, NOSTRING, NOTREADY, or NOVALUE.

To obtain information about the currently trapped condition, the built-in CONDITION function provides access to attributes such as the condition’s name, status, descriptive message, and associated object details.

<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 condition details   */
 say "Error code is" ConditionObject~Code    /* output example: Error code is 41.1 */
 say ConditionObject~ErrorText                /* output example: Bad arithmetic conversion. */

</syntaxhighlight>

Furthermore, the CALL instruction can trigger routines while managing condition traps by specifying them with ON or OFF, for instance, CALL ON HALT. These calls do not clear the control stack, permitting normal flow to continue once the handler completes.

Multi-threading

ooRexx facilitates object-oriented concurrency by enabling objects to execute methods independently and interact through messaging. Multiple objects may operate simultaneously and coordinate their actions via message passing. The keyword REPLY allows a method to return early while continuing execution on a new thread, supporting asynchronous behavior. Methods can be marked with the keyword GUARD to indicate they are unprotected, allowing concurrent execution alongside other methods within the same class. Additionally, the START method handles message processing on separate threads, enhancing concurrent operation capabilities.

Tracing

Debugging in ooRexx is supported through the TRACE statement and the TRACE() function, which enable control over verbosity levels and interactive debugging during runtime. The introduction of the TraceObject class in version 5.1.0 improved tracing capabilities for multi-threaded environments by simplifying detection of guarded and blocked methods.

Trace output detail can be tailored using options such as "Thread", "Standard", "Full", or "Profiling". For example, selecting the "Full" option reveals information including instance IDs, thread identifiers, invocation numbers, guard status, lock counts, and wait states.

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

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> trace off /* disable prolog tracing */ .TraceObject~option = "Full" /* configure full trace mode */ .TraceObject~collector = .array~new o = .Test~new /* instantiate object */ say "starting worker asynchronously ..." o~start("do") /* launch method in new thread */ say "about to wait for worker to end ..." o~wait /* synchronize with worker */ say "waiting is over"

class Test
method init /* constructor */
 expose lock                                   /* expose attribute            */
 lock = .true                                  /* initialize lock state       */
method wait unguarded
 expose lock                                   /* expose attribute            */
 guard on when lock = .false                   
method do /* perform task */
 expose lock                                   /* expose attribute            */
 t = random(1,999)/1000
 say "do: working for" t "secs"
 call sysSleep t
 say "do: ending work"
 lock = .false                                 /* release lock                */
options trace results

</syntaxhighlight>

Built-in functions and classes

ooRexx preserves compatibility with traditional Rexx by providing 82 built-in functions in version 5.1.0. These include functions for manipulating characters, performing conversions, and retrieving information, many of which internally utilize methods from the String class. Additionally, the RexxUtil dynamic link library extends functionality with 29 cross-platform functions, alongside 25 Windows-specific and four Unix-specific functions designed for managing system files, directories, classes, and objects.

Aligned with its object-oriented architecture, ooRexx 5.1.0 offers 58 built-in classes categorized into Fundamental, Stream, Collection, and Utility groups.

Fundamental classes

The Fundamental classes serve as the base for all other classes. At the top of the hierarchy is the Object class, which provides essential methods and properties to every instantiated object. The Class meta-class governs class attributes and oversees instance creation related to each ::CLASS declaration. The Method and Routine classes are responsible for generating method or routine objects respectively. String operations such as concatenation, splitting, arithmetic calculations, and conversions are handled by the String class. The Package class manages routines, classes, methods created within a package, and external dependencies specified through ::REQUIRES. To facilitate asynchronous communication enabling concurrent method execution, the Message class is provided.

Stream classes

Stream classes facilitate interaction with external entities like files, queues, serial ports, and devices. The Stream class acts as a mixin subclass combining features from InputOutputStream, InputStream, and OutputStream. It offers capabilities to open streams, read from or write to them, close streams explicitly, flush buffers, adjust file positions, and obtain stream-related details. The OPEN method initializes stream access; ARRAYIN reads data into arrays; while CLOSE ensures streams are properly closed prior to garbage collection.

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

say FileContent /* outputs content */</syntaxhighlight>

Collection classes

Collections represent objects that hold multiple elements accessible via indexes using either the AT or bracket notation []. Primary collection classes include MapCollection, SetCollection, and OrderedCollection—each designed to support distinct collection types.

MapCollection serves as a mixin defining behavior for collections mapping keys to values. Derived classes such as Directory, StringTable, IdentityTable, Properties, Table, Relation, and Stem inherit these methods. Both Directory and StringTable maintain unique string keys; IdentityTable associates each element with a unique identifier. Properties facilitates storing and loading properties from files. Unlike Table—which forbids duplicate keys—Relation permits multiple entries sharing identical keys of any type.

A Stem object is automatically instantiated when dealing with compound variables formed by a stem followed by a tail separated by a dot (.). The stem must begin with a letter; the tail can be any character sequence. Numeric tails enable array-like functionality including support for multidimensional arrays.

<syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">fruits.1 = "Apple" fruits.4 = "Orange" say fruits.4 say fruits.[1]</syntaxhighlight>

SetCollections are specialized MapCollections where keys and values are identical objects. In a Set, keys are unique; in contrast, a Bag allows keys to repeat.

OrderedCollection is a mixin tailored for collections maintaining an inherent order such as List, Queue, CircularQueue, and Array. Lists permit insertion at arbitrary positions while preserving stable indexing. Queues allow removal from the front (head) and insertion at either head or tail positions. CircularQueues have fixed capacity and overwrite oldest entries when full.

Arrays are sequences indexed by integers supporting element encoding as strings through the MAKESTRING method.

<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 classes encompass 31 different implementations designed to streamline frequent operations. The MutableBuffer class enhances the efficiency of string manipulations by preventing the creation of new objects during concatenation. The File class provides capabilities to enumerate directory contents and obtain detailed file attributes.

For handling dates and times, the DateTime and TimeSpan classes offer formatting options as well as arithmetic functionalities. Sorting support for native types such as File and DateTime is facilitated by comparator classes. Enumeration over collections of items and their indices is made possible through the Supplier class and its derivative, StreamSupplier. Validation of argument data types and numerical boundaries is managed by the Validate class. The VariableReference class keeps track of references, whereas WeakReference allows creation of references that are not strongly pinned.

The RegularExpression class improves the clarity of pattern definitions by supporting symbolic placeholders (for instance, [:alpha:]) representing common character groups.

Additional classes supply contextual and environmental details: RexxContext pertains to code execution context, RexxInfo provides information about the language and platform, and StackFrame offers execution state specifics. 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 multithreaded synchronization utilizes EventSemaphore and MutexSemaphore. Message forwarding to target objects is handled by the Monitor class, and access to external Rexx data queues is enabled by the RexxQueue class.

External packages and libraries

Programs can incorporate external libraries using the ::REQUIRES directive combined with the LIBRARY option, generally targeting specialized functional areas.

Supplied with interpreter

The Rexx extension library offers classes capable of reading from and writing to comma-separated values (CSV) files as well as processing JavaScript Object Notation data formats. The “hostemenu” library partially simulates a TSO/CMS environment. Native TCP/IP protocol support is provided by the RxSock library, while RxFtp enables FTP protocol interactions. Advanced mathematical computations—including square roots, exponentials, logarithms, trigonometric functions, and power operations—are available through the RxMath library.

On Windows platforms, ooRexx includes the ooDialog framework for building Windows dialogs and graphical user interfaces, accompanied by example programs illustrating its usage. For POSIX-compliant systems, text-based user interface development is facilitated by the orxnCurses class library leveraging the ncurses toolkit. The RxUnixSys library supplies functions for managing processes, threads, users, groups, files, and file systems across most Unix environments. Many of these libraries maintain compatibility with other Rexx implementations.

Not supplied with interpreter

Several additional packages require separate installation. Included in the Net-oo-rexx collection are Regex for regular expression support, Log4rexx providing a logging framework, and Oorexxshell offering an interactive shell for ooRexx.

Mod_Rexx is an Apache 2.4 module available on Windows, AIX, and Linux that enables handling all Apache request phases using ooRexx scripts. The Rexx Parser package constructs an abstract syntax tree parser for Rexx and ooRexx scripts to classify script components; this parser is extended by Rexx Highlighter to generate syntax-highlighted output in HTML, ANSI colors, LuaTex, and LaTeX. The Rexx XML parser supports parsing XML documents into an in-memory structure accessible via a DOM-like interface.

Inspired by JUnit, ooRexxUnit serves as a testing framework that runs ooRexx test cases to validate application behavior against specifications.

Bridges

In contrast to Object REXX, ooRexx has discontinued built-in classes for SOM and WPS support, instead offering application programming interfaces (APIs) that facilitate interaction with code developed in C or C++. A separate external library provides a two-way Java bridge, enabling seamless communication between ooRexx and Java environments. Furthermore, specialized classes are available for working with SQL databases and automating Windows applications. An experimental bridge to Python was unveiled during the 36th Rexx Symposium.

C/C++ APIs

ooRexx supplies APIs designed to extend Rexx capabilities through C programs and vice versa. These APIs allow developers to implement handlers for subcommands, create external functions to augment ooRexx's function set, and define system functions that modify interpreter operations.

Starting with ooRexx version 4.0.0, C++ APIs enable bidirectional integration between C++ applications and ooRexx. Method and function handlers written in C++ are compiled into dynamic link libraries on Windows or shared libraries on Unix-like platforms. These external libraries can be loaded using the ::REQUIRES directive or the EXTERNAL keyword within ::ROUTINE, ::METHOD, or ::ATTRIBUTE declarations.

Java

BSF4ooRexx, constructed using the C++ APIs and built upon the Bean Scripting Framework, offers a bidirectional bridge to Java, enabling interaction between ooRexx scripts and Java objects. Activating this bridge involves requiring the ooRexx package BSF.CLS, which provides public routines, classes, and the environment variable .BSF4REXX. This facilitates integration with technologies such as AWT, Swing, JavaFX, JDBC, and Java 2D.

Leveraging BSF4ooRexx, support for Universal Network Objects (UNO), utilized by OpenOffice and LibreOffice, is available through the UNO.CLS package. The CLR.CLS package combined with Jini4Net enables interoperability with the .NET framework. Linux systems can utilize D-Bus middleware for interprocess communication via the DBUS.CLS package.

The JDOR.CLS package provides a command handler that employs Java2D classes (AWT) for graphical rendering. Building upon JDOR, the experimental JDORFX.CLS package supports 3D graphics rendering by utilizing JavaFX 3D classes.

SQL

The ooSQLite class serves as an interface to SQLite, a compact, serverless, zero-configuration transactional SQL database engine. It supports various SQL database variants without requiring script modifications; however, it does not offer multi-threading capabilities.

For broader database support, an external Rexx/SQL package grants access to multiple vendor SQL databases through Open Database Connectivity (ODBC). To surpass ODBC limitations and ensure thread safety, the Rexx MySQL library provides a C-based wrapper that introduces MySQL database support.

Windows automation

The Windows extension incorporates the Windows Script Host (WSH) Scripting Engine to facilitate automation tasks and includes support for Object Linking and Embedding/ActiveX (OLE) via the OLEObject. OLE Automation—based on Microsoft's Component Object Model (COM)—allows invoking application functions, querying and modifying properties, and handling component events.

ooRexx offers sample scripts demonstrating OLE automation with applications such as Access, Word, Excel, OpenOffice/LibreOffice, ActiveDirectory, and WMI. Additionally, a utility is provided to discover available OLE objects.

Beyond OLE capabilities, the Windows extension supports interaction with the Windows program manager, system event log, clipboard contents, and registry settings. It also enables querying and manipulating windows along with their 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 new worksheet */ Worksheet~cells(1,1)~Value = “First Cell” /* set cell value */ </syntaxhighlight>

See also

Further reading

External links

  1. ↑ Initial objectives encompassed universal object treatment, encapsulation, messaging, concurrency, class structures, and inheritance.