Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Object REXX
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Extension of Rexx programming language with support for object-oriented programming}} {{Infobox programming language | logo = OoRexx.png | name = Open Object REXX (ooRexx) | paradigm = [[Multi-paradigm]]: [[Object-oriented programming|object-oriented]] ([[Class-based programming|class-based]]), [[Procedural programming|procedural]] ([[Imperative programming|imperative]]), [[Structured programming|structured]] | released = {{Start date and age|1988}} | latest release version = 5.1.0 | latest release date = {{Start date and age|2025|05|02|p=y|br=y}} | latest preview version = 5.2.0 | typing = dynamic | license = [[Common Public License|CPL]] 1.0, [[GNU General Public License|GPLv2]] | designer = Simon C. Nash (IBM) | memory management = [[Garbage collection (computer science)|Garbage collection]] | implementations = Object REXX (until 2004)<br/> ooRexx (since 2005) | influenced by = [[Rexx]], [[Smalltalk]] | influenced = [[NetRexx]] | programming language = [[C++]] | platform = [[IA-32]], [[x86-64]], [[ARM architecture|ARM]], [[s390x]] | operating system = [[Cross-platform]]: [[Linux]], [[Microsoft Windows]], [[macOS]], [[Solaris (operating system)|Solaris]], [[OpenIndiana]], [[IBM AIX|AIX]], [[FreeBSD]], [[OS/2]] | file ext = .rxs, .rex, .rexx, .cls, .orx, .rexg, .rexp | website = {{URL|https://www.rexxla.org/}} }} '''Object REXX''' is a [[High-level programming language|high-level]], [[General-purpose programming language|general-purpose]], [[Interpreter (computing)|interpreted]], [[Object-oriented programming|object-oriented]] ([[Class-based programming|class-based]]) [[programming language]]. Today it is generally referred to as ooRexx (short for "Open Object Rexx"), which is the maintained and direct open-source successor to Object REXX. It is a follow-on and a significant extension of the [[Rexx]] programming language (called here "classic Rexx"), retaining all the features and syntax while adding full object-oriented programming (OOP) capabilities and other new enhancements. Following its classic Rexx influence, ooRexx is designed to be easy to learn, use, and maintain. It is essentially compliant with the "Information Technology – Programming Language REXX" [[American National Standards Institute|ANSI]] X3.274-1996<ref name=":0">{{cite web |title=X3.274-1996 American National Standards Institute for Programming Language Rexx |url=https://rexxinfo.org/info/articles/ansi_1996_standard_j18pub.pdf}}</ref> standard and therefore ensures [[Object REXX#Cross-platform interoperability|cross-platform interoperability]] with other compliant Rexx implementations. Therefore, classic Rexx programs typically run under ooRexx without any changes. There is also Rexx Object Oriented (“roo!”), which was originally developed by Kilowatt Software and is an unmaintained object-oriented implementation of classic Rexx.<ref name="fosdick" /> == History == In 1988, the "Oryx" project at [[IBM]], under the technical direction of Simon C. Nash, experimented with merging classic Rexx with the [[object model]] of [[Smalltalk]].<ref>{{Cite web |title=7 Reasons that Rexx Still Matters |url=https://smartbear.com/en/blog/7-reasons-that-rexx-still-matters/ |access-date=2024-06-19 |website=SmartBear.com}}</ref><ref name=":1">{{Cite web |title=IBM Object REXX - EDM2 |url=http://www.edm2.com/index.php/IBM_Object_REXX |access-date=2024-06-19 |website=www.edm2.com}}</ref> The motivation behind the project was to transfer the advantages of OOP to classic Rexx while remaining compatible and thus transferring the [[usability]] of classic Rexx to OOP.<ref>{{Cite journal |last=Nash |first=Simon C. |date=1990-06-11 |title=Object Oriented REXX |url=https://www.slac.stanford.edu/pubs/slacreports/reports10/slac-r-368.pdf |journal=Proceedings of the REXX Symposium for Developers and Users |page=76-100}}</ref> Early on, the projects focused on OOP aspect such as treating [[Object REXX#Everything is an Object|everything as an object]], object-based [[Encapsulation (computer programming)|encapsulation]] and [[message passing]], object-based [[Concurrency (computer science)|concurrency]], [[Class (computer programming)|classes]] and [[Inheritance (object-oriented programming)|inheritance]].<ref>{{Cite journal |last=Nash |first=Simon C. |date=2009-05-21 |title=An Object Rexx Retrospective |url=https://www.rexxla.org/presentations/2009/objrexx-perspective.pdf |journal=Proceedings of the 20th Rexx Language Symposium}}</ref> [[File:ObjectREXX.png|alt=IBM Object REXX Logo|thumb|Object REXX (until 2004)|150x150px]] This initial work later led under the direction of Rick McGuire to the first prototype of Object REXX, which was presented in 1992. In 1994, IBM announced that Object REXX would replace classic Rexx as the standard REXX interpreter in the next version of [[OS/2]].<ref name=":1" /> In 1996, Object REXX{{efn|Including interfaces to [[IBM System Object Model|System Object Model (SOM)]] and [[Workplace Shell|Workplace Shell (WPS)]]}} was released as part of the [[OS/2 Warp 4]] operating system.<ref name="OS2">{{Cite web |title=IBM Object REXX for OS/2 - EDM2 |url=http://www.edm2.com/index.php/IBM_Object_REXX_for_OS/2 |access-date=2024-06-19 |website=www.edm2.com}}</ref> In 1997, versions for [[Windows 95]], [[Windows NT]] and [[Linux]] followed.<ref name="Win95">{{Cite web |date=1997-02-25 |title=IBM Object REXX Now Runs on Windows NT and Windows 95 |url=https://www.ibm.com/docs/en/announcements/archive/ENUSA97-0098 |publisher=IBM}}</ref><ref>{{Cite journal |last1=Schweizer |first1=Manfred |last2=Berger |first2=Uwe |date=2005-04-21 |title=From Object REXX to ooRexx |url=https://www.rexxla.org/presentations/2005/manfreds.pdf |journal=Proceedings of the 16th Rexx Language Symposium}}</ref> In 1999 an Object REXX version for [[IBM AIX|AIX]] V4.1.5 or higher was released.<ref name="AIX">{{Cite web |date=1999-03-30 |title=IBM Object REXX for AIX - Object-Oriented Scripting Language for Beginners to Advanced Programmers |url=https://www.ibm.com/docs/en/announcements/archive/ENUSZP99-0143 |publisher=IBM}}</ref> In 2000, versions for [[Linux on IBM Z|zLinux]] and [[Oracle Solaris|Sun/Solaris]] followed. For [[Windows 2000]], [[Windows Me]], [[Windows 98]] and [[Windows NT 4.0]], the last major update for Object REXX was released in 2001.<ref name = "V2R1">{{Cite web |date=2001-03-20 |title=IBM Object REXX for Windows V2R1 - Object-Oriented Programming for Beginners to Advanced Users |url=https://www.ibm.com/docs/en/announcements/archive/ENUSZP01-0207 |publisher=IBM}}</ref> [[File:Rexx3 orig size transparent.gif|alt=ooRexx logo|thumb|ooRexx (since 2005)]] On 12 October 2004, IBM announced the discontinuation of Object REXX and transferred the [[source code]] and licensing rights{{efn|Excluding the SOM and WPS packages}} to the non-profit [[Special interest group|Special Interest Group]] (SIG), the Rexx Language Association (RexxLA). The code that IBM released to open source did not include the classes for [[IBM System Object Model]] (SOM), which is known as the object framework for OS/2's [[Workplace Shell]] (WPS).<ref>[[sourceforge:p/oorexx/discussion/408479/thread/1f93f87f/|Where did SOM support go in 4.0.0?]]</ref> Although IBM discontinued the development of SOM in 1997, it is still a fundamental framework for OS/2.<ref>{{Cite web |title=SOM and Object REXX - EDM2 |url=http://www.edm2.com/index.php/SOM_and_Object_REXX |access-date=2024-12-11 |website=www.edm2.com}}</ref> The OS/2 version of Object REXX includes classes to support SOM and WPS.<ref>{{cite web |author=Willis Boughton |year=2004 |title=SOM and Object REXX |url=http://www.edm2.com/index.php/SOM_and_Object_REXX |access-date=2014-02-02 |publisher=<abbr title="Electronic Developer Magazine for OS/2">EDM/2</abbr>}}</ref><ref>{{cite book |title=Object REXX Reference |publisher=IBM |section=Accessing Workplace Shell Objects}} </ref> These are included in OS/2's initial follow-on product, [[eComStation]], and also in its current descendant, [[ArcaOS]], for which IBM's original Object REXX interpreter continues to be available.<ref>{{cite web |title=Does ArcaOS include REXX support? |url=https://www.arcanoae.com/faqwd/does-arcaos-include-rexx-support/ |access-date=2020-09-03}}</ref> In 2005, the RexxLA released ooRexx as a new incarnation of Object REXX as [[free and open-source software]] under the [[Common Public License]].<ref>{{Cite web |date=2004-10-12 |title=Software withdrawal and service discontinuance: IBM Object REXX |url=https://www.ibm.com/docs/en/announcements/archive/ENUSZP04-0453 |publisher=IBM}}</ref> This first version of ooRexx 3.0.0 has been heavily [[Code refactoring|refactored]] compared to the original IBM source code in order to increase readability. Later, the ooRexx kernel was rewritten in pure [[C++]], and a new [[Software architecture|architecture]] and native [[Interface (object-oriented programming)|interface]] were designed and implemented under the technical direction of Rick McGuire. This work enabled the RexxLA to release ooRexx 4.0.0 with support for [[64-bit computing|64-bit]] in 2009. To this day, the RexxLA continues to develop, support and maintain ooRexx as well as classic Rexx and [[NetRexx]]. Furthermore, the RexxLA organizes international annual symposia.<ref>{{Cite web |title=RexxLA - Rexx Symposia |url=https://www.rexxla.org/events/symposium.rsp |access-date=2024-05-17 |website=www.rexxla.org}}</ref> == Releases == The following table contains noteworthy features and changes of major Object REXX and ooRexx interpreter versions. All ooRexx releases and the necessary documentation are available freely on [[SourceForge|Sourceforge]].<ref>{{Cite web |title=ooRexx (Open Object Rexx) - Browse /oorexx at SourceForge.net |url=https://sourceforge.net/projects/oorexx/files/oorexx/ |access-date=2024-05-18 |website=sourceforge.net}}</ref><ref>{{Cite web |title=ooRexx (Open Object Rexx) - Browse /oorexx-docs at SourceForge.net |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/ |access-date=2024-05-18 |website=sourceforge.net}}</ref> For [[Arch Linux]] based distributions the current and the development version are available as [[Arch Linux#Arch User Repository (AUR)|Arch User Repository]]. Since version 5.0.0 there are portable versions of the interpreter that can be used without installation, and an [https://ecsoft2.org/oorexx-open-object-rexx unofficial port to OS/2] also exists. The [https://wi.wu.ac.at/rgf/rexx/tmp/net-oo-rexx-packages/ "net-oo-rexx" bundle] contains the latest portable version of ooRexx, [[NetRexx|Netrexx]], a Netrexx shell, the [[Object Rexx#Java|Java bridge and associated packages]], a shell for ooRexx and [[Object Rexx#Not supplied with interpreter|various other packages and programs]].<ref name=":12">{{Cite news |date=1 December 2024 |title=Net-oo-rexx Readme |url=https://wi.wu.ac.at/rgf/rexx/tmp/net-oo-rexx-packages/readme_net-oo-rexx.txt}}</ref> For [[IntelliJ IDEA|Intellij IDEA]], the [[sourceforge:projects/bsf4oorexx/files/Sandbox/aseik/ooRexxIDEA/GA/2.2.0/|ooRexxPlugin]] adds support for [[syntax highlighting]], syntax checking, [[code completion]] and documentation support modeled after [[Javadoc]] using [[Annotation|annotations]].<ref>{{Cite news |last=Flatscher |first=Rony G. |year=2023 |title=The IntelliJ IDEA Plugin ooRexxPlugin 2.2 for Rexx and ooRexx 5.0 |url=https://www.rexxla.org/presentations/2023/04_ooRexx_Plugin_2_2.pdf}}</ref> [https://speleotrove.com/misc/rexxcpslist.html RexxCPS] is a benchmark that measures the number of Rexx clauses (independent syntax units in a line) per second that an interpreter processes. {{Version|l|show=110110}} {| class="wikitable sortable" |- ! Major Releases !! Release Date !! Notable Features and Changes |- | {{Version |o |Object REXX<br />1.0.0<br />(OS/2) <ref name="OS2"/> |sortKey=1.0}} | 1996-09-25 || * First official release as part of OS/2 Warp 4 * Support for object-oriented paradigm * Concepts such as <code>SELECT</code>, <code>DO</code> loops, <code>IF-THEN-ELSE</code> branching * Support for procedure and function calls, stems and compound variables * Provides array handling, arithmetic and built-in functions * Includes interfaces to [[IBM Db2|DB2]], [[Internet protocol suite|TCP/IP sockets]] and C applications |- | {{Version |o |Object REXX<br />1.0.0<br />(Windows)<ref name="Win95" /> |sortKey=1.0}} | 1997-02-28 || * First releases for Windows * Development Edition (1997-05-30) additionally provides a dialogue library and editor as well asa built-in [[tokeniser]] |- | {{Version |o |Object REXX<br />1.1.0<br />(AIX)<ref name="AIX"/> |sortKey=1.1}} | 1999-04-09 || * First release for AIX V4.1.5 * Addition of library for [[File Transfer Protocol|file transfer protocol]] (FTP) |- | {{Version |o |Object REXX<br />2.1.0<br />(Windows)<ref name="V2R1"/> |sortKey=2.1}} | 2001-04-21 || * Support for Windows 98, Windows Me, Windows 2000, and Windows NT * Support for [[Object Linking and Embedding]]/[[ActiveX]], [[Windows Script Host]] (WSH) engine and [[Unicode]] functions * Addition of RxMath native library |- | {{Version |o |ooRexx<br />3.0.0<ref name="ooNews">{{cite web |title=ooRexx News |url=https://sourceforge.net/p/oorexx/news/ |website=Sourceforge |access-date=18 May 2024}}</ref><ref>{{cite book |title=Open Object Rexx Reference Version 3.0.0 Edition |date=24 March 2005 |publisher=RexxLA |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/3.0.0/rexxref.pdf |access-date=18 May 2024}}</ref> |sortKey=3.0}} | 2005-03-30 || * First release as open-source * Supports 28 keyword instructions, four directives, 29 classes with associated methods and 75 built-in functions * Includes an extension class for [[Regular expression|regular expressions]] and ooDialog 3.0.0 * Improved PDF documentation |- | {{Version |o |ooRexx<br />3.1.0<ref name="ooNews"/> |sortKey=3.1}} | 2006-08-21 || * Various enhancements * Separate documentation for ooDialog |- | {{Version |o |ooRexx<br />3.1.1<ref name="ooNews"/> |sortKey=3.1 A}} | 2006-11-23 || * Support for [[Linux]], [[Microsoft Windows|Windows]], [[IBM AIX|AIX]] and [[Oracle Solaris|Solaris]] * Additional methods for various classes and new functions for the RexxUtil library * Addition of <code>CircularQueue</code> class |- | {{Version |o |ooRexx<br />3.1.2<ref name="ooNews"/> |sortKey=3.1}} | 2007-09-17 || * Support for [[MacOS]] * Additional methods for the <code>MutableBuffer</code>, <code>String</code> and <code>Object</code> classes * Includes interface to [[OpenOffice.org|Open Office]] |- | {{Version |o |ooRexx<br />3.2.0 |sortKey=3.0}} | 2008-01-22 || * Various enhancements |- | {{Version |o |ooRexx<br />4.0.0<ref>{{cite news |title=ooRexx 4.0.0: Readme |url=https://sourceforge.net/projects/oorexx/files/oorexx/4.0.0/0ReadMe.pdf |access-date=18 May 2024}}</ref> |sortKey=4.0}} | 2009-09-30 || * Support for [[64-bit computing|64bit]] versions of [[Linux]], [[IBM AIX|AIX]] and [[Microsoft Windows|Windows]] * Drop support for WSH engine * Improved [[C++]] [[API|application programming interface]] * Addition of <code>Buffer</code>, <code>IdentityTable</code>, <code>Orderable</code>, <code>Package</code>, <code>Pointer</code>, <code>RexxContext</code>, <code>Routine</code>, <code>WeakReference</code> and <code>SocketClass</code> classes * New methods for <code>RexxQueue</code>, <code>Object</code>, <code>DateTime</code>, <code>Method</code>, <code>Stem</code>, <code>String</code>, <code>MutableBuffer</code>, <code>OLEObject</code> classes * Additional classes and methods for ooDialog * Addition of sample programs and separate documentation for the Windows extension library |- | {{Version |o |ooRexx<br />4.1.0<ref>{{cite news |title=ooRexx 4.1.0: ReleaseNotes |url=https://sourceforge.net/projects/oorexx/files/oorexx/4.1.0/ReleaseNotes |access-date=18 May 2024}}</ref> |sortKey=4.1}} | 2011-09-28 || * Addition of RxUnixSys library and ooSQLite extension<ref>{{cite news |title=ooSQLite: Readme |url=https://sourceforge.net/projects/oorexx/files/ooSQLite/ReadMe.txt |access-date=18 May 2024}}</ref> * Enhancement of [[Internet protocol suite|TCP/IP]] socket and ooDialog support * Addition of <code>File</code> class and new methods for <code>DateTime</code> class * Addition of extension classes for handling the [[comma-separated values]], [[MIME|multipurpose internet mail extensions]] and [[Simple Mail Transfer Protocol|simple mail transfer protocol]] * Separate documentation for the Rexx and Unix extension library (RxUnixSys) |- | {{Version |o |ooRexx<br />4.2.0<ref>{{cite news |title=ooRexx 4.2.0: Changes |url=https://sourceforge.net/projects/oorexx/files/oorexx/4.2.0/CHANGES.txt |access-date=18 May 2024}}</ref> |sortKey=4.2}} | 2014-02-23 || * More than 43 enhancements (e.g. tracing) * Standalone installer for ooDialog 4.2.3 and several new classes and methods * [[Systemd]] support and compliance with [[Linux Standard Base]] * New methods for the <code>Relation</code>, <code>OrderedCollections</code>, <code>Array</code>, <code>String</code>, <code>Mutablebuffer</code>, <code>StackFrame</code>, <code>Queue</code> and <code>OrderedCollection</code> classes * Separate documentation for ooSQLite external library |- | {{Version |o |ooRexx<br />5.0.0<ref>{{cite news |title=ooRexx 5.0.0: Changes |url=https://sourceforge.net/projects/oorexx/files/oorexx/5.0.0/CHANGES.txt |access-date=18 May 2024}}</ref> |sortKey=5.0}} | 2022-12-22 || * A total of 86 new features and 76 enhancements * Addition of <code>AlarmNotification</code>, <code>Json</code>, <code>MessageNotification</code>, <code>RexxInfo</code>, <code>StringTable</code> and <code>Validate</code> classes * New methods for <code>Alarm</code>, <code>Class</code>, <code>Collection</code>, <code>Directory</code>, <code>Message</code>, <code>Method</code>, <code>MutableBuffer</code>, <code>Object</code>, <code>Package</code>, <code>Routine</code>, <code>String</code> and <code>RxFtp</code> classes * Separate documentation ooRexxUnit ([[unit testing]] framework), orxnCurses ([[ncurses]] library), C/C++ APIs and the release and [[Software build|build environment]] |- | {{Version |c |ooRexx<br />5.1.0 |sortKey=5.1}} | 2025-05-02 || * A total of 36 enhancements * Several improvements to <code>Json</code> class * Inclusion of <code>oleinfo</code> scripts to facilitate [[Object Rexx#Windows automation|Windows automation]] * Addition of the <code>TraceObject</code> class to support the [[Object REXX#Tracing|tracing]] of [[Object REXX#Multi-threading|multi-threaded]] programs |- | {{Version|cp|ooRexx<br />5.2.0|sortKey=5.1}} | 2025-05-05 || |} == Design philosophy == ooRexx follows the [[Design#Philosophies|design philosophy]] of classic Rexx to create a "[[Human-centered computing|human-centered]]" programming language that is easy to learn, code, remember and maintain. This is achieved, in part, by keeping the language small and following the [[principle of least astonishment]].<ref name="fosdick"> {{Cite book |last=Fosdick |first=Howard |url=https://rexxinfo.org/Rexx_Programmers_Reference.pdf |title=Rexx Programmer's Reference |publisher=Rexx Language Association |year=2024 |isbn=979-898611913-7 |edition=2nd}}</ref><ref name=":7">{{Cite journal |last=Cowlishaw |first=Mike |date=1987 |title=The design of the REXX language |url=https://dl.acm.org/doi/pdf/10.1145/24686.24687 |journal=ACM SIGPLAN Notices |volume=22 |issue=2 |pages=26–35|doi=10.1145/24686.24687 |url-access=subscription }}</ref> A readable syntax is enabled by being case-insensitive, free-form, requiring as little punctuation as possible, and using instructions that are straightforward English.<ref name=":7" /> In addition, it is a [[dynamic programming language]] that offers [[Flexibility (engineering)|flexibility]] and allows to focus on development rather than language constraints. Following the "documentation before implementation" design principle of classic Rexx, ooRexx offers comprehensive documentation in accordance with the IBM Style Guide that includes [[Syntax diagram|syntax diagrams]] and examples.<ref name=":7" /><ref name=":2">{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxref.pdf |title=ooRexx Documentation 5.0.0 Open Object Rexx Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}}</ref> === Instructions === As in classic Rexx, there are assignment instructions, keyword instructions and command instructions. In line with the desire to keep the language small, ooRexx 5.0.0 has only thirty keyword instructions.<ref name=":2" /> Unlike many other languages, no keywords are reserved, so keyword instructions such as <code>DO</code>, <code>SAY</code>, <code>END</code> and <code>IF</code> for example can be used as variable names during an assignment. This avoids having to memorize a long list of [[Reserved word|reserved words]].<ref name=":4" /> An assignment is used to set or change the value of a variable. The equal sign (<code>=</code>) is used to create an assignment instruction which can be used in combination with eleven operators for extended assignment sequences such as <code>+=</code>, <code>-=</code>, <code>*=</code> and others. Keyword instructions such as <code>ARG</code>, <code>PARSE</code>, <code>PULL</code> or <code>USE</code> have the same effect as assignments.<ref name=":2" /> In cases where an instruction is neither an assignment nor a keyword instruction, it must be a string literal or a valid expression which is considered a command instruction, which causes the interpreter to pass the string to the operating system for execution and set a variable <code>RC</code> for the return code. In addition, the <code>ADDRESS</code> instruction allows commands to be redirected to specific command environments such as [[Bourne shell|Bourne Shell]], [[Bash (Unix shell)|Bash]], [[Z shell|Z-Shell]], [[Cmd.exe|Command Prompt]] and others, some editors including [[ISPF]], [[Time Sharing Option|TSO]] EDIT, [[XEDIT]] and its [[XEDIT#PC and Unix adaptations|adaptations]], as well as intercepting errors.<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 three instruction types of classic Rexx, ooRexx adds [[Directive (programming)|directive]]{{efn|As of 5.0.0, ooRexx has the <code>::ANNOTATE</code>, <code>::ATTRIBUTE</code>, <code>::CLASS</code>, <code>::CONSTANT</code>, <code>::METHOD</code>, <code>::OPTIONS</code>, <code>::REQUIRES</code>, <code>::RESOURCE</code> and <code>::ROUTINE</code> directives.}} instructions which need to be placed at the end of the program. After loading and the syntax check, the interpreter executes all defined directives to set up the execution environment for the program before further instructions are executed. Directives can be used to define [[Object REXX#Procedure and function|routines]], [[Object REXX#Class and Method|classes]], [[Object REXX#Class and Method|methods]], attributes or execution options like the number of digits to use in arithmetics. To make directive instructions readily recognizable, they are introduced with two consecutive colons (<code>::</code>).<ref name=":2" /> To facilitate the [[reusability]] of code, the <code>::REQUIRES</code> directive allows the integration of another Rexx program (also known as a package) or an external (native) library. This directive causes the interpreter to make every routine and class that specifies the <code>PUBLIC</code> option of the denoted Rexx program (package) to become directly accessible. External packages usually use the file extension <code>.cls</code>, for example <code>::requires "csvstream.cls"</code> or <code>::requires "json.cls"</code>. Some [[Object REXX#External packages and libraries|external packages and libraries]] are delivered with the ooRexx interpreter. === Free-form === ooRexx has a [[Free-form language|free-form syntax]] where the positioning of the program code is irrelevant, which allows a high degree of flexibility. Before execution, the interpreter merges multiple unquoted blanks into one, while a character string enclosed in [[Quotation mark|quotation marks]] (single or double) is not changed. Concatenation can be requested explicitly with two vertical bars (<code>||</code>), or implicitly by separating terms with spaces or by abutting terms. Optionally, clauses can be spread over several lines by using the comma (<code>,</code>) or the minus sign (<code>-</code>) as a continuation character, or several clauses can be used in a single line, separated by a semicolon (<code>;</code>).<ref name=":2" /> Since a free-form language provides flexibility and requires fewer syntactic rules to be considered, it is assumed that it eases the learning effort by reducing the [[Cognitive load#Intrinsic|intrinsic cognitive load]].<ref name=":3">{{Cite journal |last1=Winkler |first1=Till |last2=Flatscher |first2=Rony G. |title=Cognitive Load in Programming Education: Easing the Burden on Beginners with REXX |url=https://research.wu.ac.at/files/46150789/CECIIS_CLT_REXX.pdf |journal=Central European Conference on Information and Intelligent Systems}}</ref> <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 === As classic Rexx, ooRexx is a [[Case sensitivity#In programming languages|case-insensitive programming language]]. Accordingly, the ooRexx interpreter capitalizes all characters outside quotation marks (single or double) and ignores case for instructions, variable names and all other aspects of the language. Only sequences within quotation marks are treated as literal strings and are not changed during processing.<ref name=":2" /> Because the cases do not need to be differentiated, fewer additional details need to be learned and frustrating syntax errors are avoided.<ref name=":3" /><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 === While classic Rexx follows the "Everything is a String" philosophy and has [[String (computer science)|string]] as its only data type, ooRexx considers everything as objects, including non-string objects such as arrays, streams and many more. Objects are manipulated using methods instead of traditional functions. In ooRexx, a string variable is a reference to a string object and does not need to be declared, which reduces the effort for programmers compared to [[Type system|strictly typed languages]].<ref>{{Cite journal |last1=Stefik |first1=Andreas |last2=Siebert |first2=Susanna |date=2013 |title=An empirical investigation into programming language syntax. |url=https://dl.acm.org/doi/10.1145/2534973 |journal=ACM Transactions on Computing Education |volume=13 |issue=4 |pages=1–40 |doi=10.1145/2534973|url-access=subscription }}</ref> A string object can be of any length and contain any characters, including numerical values. It is therefore possible to change numerical values with string manipulations and methods of the <code>String</code> class. In addition, a string variable can contain any type of expression, including executable instructions, which can be evaluated or executed with the <code>INTERPRET</code> keyword instruction.<ref name=":2" /><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 === Similar to the messaging paradigm implemented by [[Alan Kay]] in Smalltalk, everything in ooRexx is an object that can be communicated with. The notion of sending messages to objects as if they were living beings helps beginners to learn OOP concepts.<ref name=":4">{{Cite journal |last1=Flatscher |first1=Rony G. |last2=Winkler |first2=Till |title=Employing the Message Paradigm to Ease Learning Object-oriented Concepts and Programming |url=https://research.wu.ac.at/files/64505159/mipro24_9194_Flatscher_Winkler_EmployingMessageParadigm_final-4.pdf |journal=In 2024 47th MIPRO ICT and Electronics Convention (MIPRO) |pages=1244–1249}}</ref> In contrast to Smalltalk, there is an explicit message operator, the tilde (<code>~</code>), where the receiving object is placed to the left of it and the result of the operation is returned. Sending a message leads to the activation of a method with the corresponding method name and to the manipulation of the receiving object. Like Smalltallk, ooRexx messages can be cascaded if two tildes (<code>~~</code>) are used instead of one, returning the object that received the method rather than the result produced.<ref name=":9">{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxpg.pdf |title=ooRexx Documentation 5.0.0 Programmer Guide |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |date=2022 |publisher=RexxLA}}</ref> The default behavior of most methods can be changed by specifying an option, which can be either spelled out or abbreviated and is not case-sensitive. When reading code, this enables a literal understanding and reduces the learning effort for beginners, as there is no need to learn the meaning of abbreviations.<ref name=":3" /> For example, the method with the name <code>strip</code> removes leading and trailing blanks by default. This behavior can be changed, for example, by specifying <code>"leading"</code> or <code>"l"</code> as an option. While functions are nested in classic Rexx, messages can be chained in ooRexx, which improves the readability of a [[Statement (computer science)|statement]].<ref name=":4" /><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> === Cross-platform interoperability === ooRexx is designed to retain [[Rexx#Features|all the features of classic Rexx]] and essentially complies with the ANSI standard for the Rexx language (X3.274-1996, "Programming Language REXX").<ref name=":0" /> In contrast to an optional specification in the ANSI standard, ooRexx does not allow characters such as <code>@</code>, <code>#</code>, <code>$</code> and <code>¢</code> in symbols. While in classic Rexx the expression <code>b. = a.</code> results in <code>b.</code> being assigned the default value of <code>a.</code>, the interpreter makes <code>b.</code> an alias for <code>a.</code>. In addition, ooRexx allows <code>--</code> as a comment mark and <code>-</code> as a line continuum, which are not specified in the standard.<ref name=":0" /> Classic Rexx scripts usually run without changes under ooRexx, making it easy to migrate to OOP features at the desired rate while preserving the time invested in the original code.<ref name="fosdick" /> As the interpreter supports a large number of platforms, code migration to these is also feasible. == Features == Above all, ooRexx offers OOP features such as [[Inheritance (object-oriented programming)|subclassing]], [[Polymorphism (computer science)|polymorphism]], [[Encapsulation (computer programming)|data encapsulation]] and [[multiple inheritance]] via [[mixin]] [[Class (computer programming)|classes]]. The interpreter includes the <code>rexxc</code> utility, which makes it possible to compile ooRexx programs and optionally encode the result as [[base64]], a source-less file that starts faster since the initial parsing and compiling has already been done.<ref name=":9" /> === Parsing === The <code>PARSE</code> keyword instruction makes it possible to quickly and flexibly parse a string and assign parts of it to variables in a single step.<ref name="fosdick" /> Subsequent instruction is used to specify the source of the string, for example <code>ARG</code> for arguments that are listed when the program or function is called, <code>VAR</code> for variables, <code>PULL</code> for data queues or standard input (typically the keyboard), <code>VALUE</code> for any expression. When using <code>VALUE</code>, the <code>WITH</code> keyword is required to specify the end of an expression, followed by a parsing pattern. This pattern can be a list of variables, a position number or literal delimiters; it is possible to use these patterns in combination. Optionally, the upper and lower case of the string can be converted before parsing.<ref name=":2" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> str = "Person: Rick McGuire" /* parse string using the literal ":" and blanks between words into variables a ("Person"), b ("Rick"), and c ("McGuire") */ parse var str a ":" b c /* parse by literal and blank */ say b c /* output: Rick McGuire */ </syntaxhighlight> === Procedure and function === ooRexx provides a new way to define procedures and functions that are not specific to a particular class by using the <code>::ROUTINE</code> [[Object REXX#Instructions|directive]]; unlike the older <code>PROCEDURE</code>, code defined with <code>::ROUTINE</code> has an implicit <code>RETURN</code> at the end. The <code>CALL</code> instruction can be used to invoke a routine as a procedure. In addition, routines that return values via the <code>RETURN</code> keyword instructions can be called using function calls by specifying the name of the routine followed by parentheses. The content within the brackets is passed as an argument to a routine. While the <code>PARSE ARG</code> instruction can be used to parse received string arguments and assign them to variables, the newer <code>USE ARG</code> must be used for objects of other types. In addition, the <code>STRICT</code> option can be used to limit the number of arguments that must match the number of specified names.<ref name=":2" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">call DoSomething /* "CALL" keyword instruction */ table = .stem~new /* Stem object for indsum */ table[1] = 2; table[2] = 4 say indsum{table,1.2) /* function call requiring use arg */ say dirsum(2,4) /* either parse arge or use arg okay */ ::Routine DoSomething /* "ROUTINE" directive (procedure) */ say "I did something!" /* output: I did something! */ /* Implicit return because next */ /* statement is a directive. */ ::Routine dirsum /* "ROUTINE" directive (function) */ parse arg first, second /* Valid because both are strings. */ return first+second ::Routine indsum /* "ROUTINE" directive (function) */ use strict arg table, first, second /* can't use parse arg with stem arg */ Sum = table{first} + table[second] /* do calculation */ return Sum /* "RETURN" result */</syntaxhighlight> === Class and Method === The <code>::CLASS</code> [[Object REXX#Instructions|directive]] followed by a class name causes the interpreter to define a new class. After the class name, options such as <code>METACLASS</code>, <code>SUBCLASS</code>, <code>MIXINCLASS</code>, <code>ABSTRACT</code> and <code>INHERIT</code> can be set in order to use OOP features. The <code>::METHOD</code> directive can be used to define a new class method that is associated with the last <code>::CLASS</code> directive. The <code>::ATTRIBUTE</code> directive is used to define an [[Mutator method|accessor method]] that can retrieve or assign an object variable. Using the <code>EXPOSE</code> instruction, an object variable can be directly exposed to a method.<ref name=":2" /><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> === Multi-threading === Conceptually, ooRexx provides object-based [[Concurrency (computer science)|concurrency]], according to which objects have independent resources to execute methods and can communicate with each other using the messaging paradigm. Several objects can be active at the same time and exchange messages for [[Synchronization (computer science)|synchronization]].<ref name=":2" /> Concurrency can be achieved with the <code>REPLY</code> keyword instruction, which causes an early return from a method while its remainder continues to execute in a new thread. Alternatively, the keyword instruction <code>GUARD</code> can be used to mark a method as unprotected so that it can be executed together with other methods of the same class. Finally, using the <code>START</code> method (Object or Message class) causes the recipient to process the received message in a separate thread, thus also enabling concurrency.<ref name=":2" /> === Tracing === As in classic Rexx, the <code>TRACE</code> keyword statement and the built-in <code>TRACE()</code> function facilitate debugging. Both allow control over the level of detail and enable interactive debugging at runtime.<ref name=":6">{{Cite book |last1=Flatscher |first1=Rony G. |last2=Winkler |first2=Till |chapter=Devising a TraceObject Class for Improved Runtime Monitoring of ooRexx Applications |date=2024 |title=Proceedings of the 7th ACM International Workshop on Verification and Monitoring at Runtime Execution |chapter-url=https://dl.acm.org/doi/pdf/10.1145/3679008.3685543 |page=19-24|doi=10.1145/3679008.3685543 |isbn=979-8-4007-1119-0 }}</ref> When interactive debugging, the interpreter pauses after most instructions that are traced.<ref name=":2" /> ooRexx 5.1.0 introduces the <code>TraceObject</code> class, which provides additional information such as timestamps, interpreter instances, thread IDs on which messages are dispatched, and the state of the guard locks for tracing multi-threaded programs. This class makes it easier to determine which method is currently guarded and blocked.<ref name=":6" /> The ooRexx debugger, which is also included in the "net-oo-rexx" bundle, is based on Trace and offers a [[graphical user interface]] (GUI) that uses the [[Object REXX#Java|Java bridge]] to facilitate debugging on all platforms.<ref name=":12" /><ref>{{Cite web |date=2025-01-26 |title=ooRexx Debugger |url=https://sourceforge.net/projects/oorexxdebugger/ |access-date=2025-02-02 |website=SourceForge |language=en}}</ref> == Built-in functions and classes == As ooRexx aims to be compatible with classic Rexx, the traditional built-in functions are still available.<ref name=":9" /> Release 5.0.0 provides 82 built-in functions, including character manipulation, conversion and information functions, many of which call methods of the <code>String</code> class. In addition, the built-in [[Dynamic-link library|dynamic link library]] RexxUtil offers 29 cross-platform, 25 Windows-specific and four Unix-specific functions for manipulating system files, directories, classes and objects.<ref name=":2" /> In keeping with its object-oriented roots, ooRexx provides most of its functionality via built-in classes and methods. ooRexx 5.0.0 is delivered with a total of 57 built-in classes, which are divided into the class groups Fundamental, Stream, Collection and Utility.<ref name=":2" /> === Fundamental classes === Fundamental classes are the essential building blocks for all other classes. The <code>Object</code> class is the root of the [[class hierarchy]], so that its methods and attributes are available for all instantiated objects of each class. The <code>Class</code> class (a.k.a. meta class) is used to maintain the properties of a class (like its method objects) and gets used for creating instances (a.k.a. objects, values). Therefore, an [[Instance (computer science)|instance]] of this class (a.k.a. class object) is created for each <code>::CLASS</code> directive.<ref name=":2" /> The purpose of the <code>Method</code> class and <code>Routine</code> class is to create method or routine objects. The <code>String</code> class provides methods for handling strings, such as logical operations, concatenation, copying, joining, splitting, reversing, arithmetic, conversion, and others.<ref name=":9" /> A <code>Package</code> class instance contains all created routines, classes, and methods and manages external dependencies referenced by <code>::REQUIRES</code> directives. The <code>Message</code> class enables the asynchronous sending of messages, which enables the concurrent execution of methods.<ref name=":2" /><ref name=":9" /> === Stream classes === Stream classes facilitate communication with external objects such as files, queues, [[Serial port|serial interfaces]], devices, etc. The <code>Stream</code> class itself is a mixin class that can be inherited and is a subclass of the <code>InputOutputStream</code>, <code>InputStream,</code> and <code>OutputStream</code> classes.<ref name=":2" /> The <code>Stream</code> class provides methods for opening, reading, writing, and closing streams and flushing buffers, setting the file location, retrieving information, and other stream-related operations. While the <code>OPEN</code> method opens the stream, the <code>ARRAYIN</code> method can be used to read its content into an array object. The <code>CLOSE</code> method explicitly closes a stream before the stream object is reclaimed by the [[Garbage collection (computer science)|garbage collector]].<ref name=":2" /><ref name=":9" /><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 === A collection is an object that contains multiple items with associated indexes that enable items to be retrieved using the <code>AT</code> or <code>[]</code> methods. There are MapCollection, SetCollection and OrderedCollection classes, all of which allow manipulation of a specific collection type.<ref name=":9" /> A MapCollection is a mixin class that defines the basic set of methods implemented by all collections that map from an index to a value. The <code>Directory</code>, <code>StringTable</code>, <code>IdentityTable</code>, <code>Properties</code>, <code>Table</code>, <code>Relation</code> and <code>Stem</code> classes inherit these methods.<ref name=":2" /> A Directory or a StringTable object is a collection of unique string indexes. In an IdentityTable object, each item is associated with a single index, and there can only be one item for each index. The Properties object provides specific methods for saving and loading properties into files. Unlike a Table object, which cannot contain duplicate indexes, a Relation object is a collection in which elements can have the same index, which can be of any object type. A Stem object is created automatically when a compound variable is used. As in classic Rexx, such a variable consists of a stem and a tail, separated by a dot (<code>.</code>). While the stem must begin with a letter, the tail can be any character. Using a single numeric tail creates the same effect as an [[Array (data type)|array]], while multiple numeric tails can be used to create a multidimensional array.<ref name=":2" /><ref name=":9" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">fruits.1 = "Apple" /* assigning to stem variable */ fruits.4 = "Orange" /* assigning to stem variable */ say fruits.4 /* output: Orange */ say fruits.[1] /* output: Apple */</syntaxhighlight>SetCollections are special types of MapCollections where the index and the element are the same object. While the indexes in a <code>Set</code> object are unique, each index in a <code>Bag</code> object can appear more than once.<ref name=":2" /> An OrderedCollection is a mixin class that defines the basic methods for all collections that have an inherent index order, such as the <code>List</code>, <code>Queue</code>, <code>CircularQueue</code> and <code>Array</code> classes. A List object allows new items, for which a new index is created, to be added at any position in a collection. The associated index remains valid for that item regardless of other additions or removals. A Queue object allows items to be removed from the head and added to the tail or head of the queue. A CircularQueue object is a queue with a predefined size. Once the end of the circular queue is reached, new elements are inserted from the beginning to replace the previous items.<ref name=":2" /><ref name=":9" /> An Array is sequenced collection ordered by whole-number indexes. Like some other collection classes, the <code>Array</code> class provides the <code>MAKESTRING</code> method to encode its elements as a string object.<ref name=":2" /> <syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> ArrayObj = .array~of("One", "Two", "Three") /* array with 3 items */ say ArrayObj~at(2) /* output: Two */ say ArrayObj~makeString(,"; ") /* output: One; Two; Three */ </syntaxhighlight> === Utility classes === Utility classes are a collection of 31 classes that provide implementations for common tasks. The <code>MutableBuffer</code> class enables greater efficiency in string operations such as concatenation, as no new object needs to be assigned. The <code>File</code> class provides methods for listing files in a directory or retrieving information about files and directories.<ref name=":2" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> FileObj = .File~new("~/someFolder/") /* create file object for folder */ FileArr = FileObj~ListFiles /* retrieve array of files */ do FilePath over FileArr /* iterate over the array items */ say FilePath /* output: FilePath item */ end </syntaxhighlight>The <code>DateTime</code> or <code>TimeSpan</code> classes support the retrieval and formatting of a date, time or timestamp in various formats and enable arithmetic operations between them. Several Comparator classes facilitate sorting for built-in classes such as File, DateTime and others. The class <code>Supplier</code> and its subclass <code>StreamSupplier</code> enable the enumeration of an items collection together with an indexes collection. The <code>Validate</code> class provides methods that can be used to check whether given arguments are of the correct class and type, or within a numerical range. A <code>VariableReference</code> instance maintains a reference, while a <code>WeakReference</code> instance creates a reference to another object that is not pinned.<ref name=":2" /> A [[regular expression]] is a pattern that can be used to match strings. To increase the readability of patterns in the code, the <code>RegularExpression</code> class allows the use of symbolic names encapsulated with colons (<code>:</code>) for common sets. For instance, matching a string containing only letters typically described as <code>[A-Za-z]</code> can be abbreviated using <code>[:alpha:]</code>.<ref name=":2" /> Other classes help to obtain information about the context of the currently executed code (<code>RexxContext</code>), the Rexx language or the executing platform (<code>RexxInfo</code>) and execution specifics (<code>StackFrame</code>) via environment symbols. The <code>Buffer</code> and <code>Pointer</code> classes are specifically designed to support writing methods and function in native code using the C/C++ APIs. <code>Alarm</code> and <code>Ticker</code> classes provide notification functions and <code>EventSempahore</code> and <code>MutexSempahore</code> classes implement synchronization mechanisms for multi-threading activities. The <code>Monitor</code> class enables messages to be forwarded to various target objects and the <code>RexxQueue</code> class provides object-like access to external Rexx data queues.<ref name=":2" /> == External packages and libraries == Using the <code>::REQUIRES</code> [[Object REXX#Instructions|directive]] and specifying the <code>LIBRARY</code> option, external libraries can be integrated per program. Such libraries are usually organized around domain-specific functions.<ref name=":2" /> === Supplied with interpreter === The Rexx extension library offers classes for reading and writing [[comma-separated values]] (CSV) files, as well as for creating and processing [[JSON|JavaScript Object Notation]] (JSON) data. A library called “hostemenu” is also included, which partially emulates a [[Time Sharing Option|TSO]]/[[Content management system|CMS]] environment.<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxextensions.pdf |title=ooRexx Documentation 5.0.0 Rexx Extensions Library Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}}</ref> The RxSock native library enables to incorporate [[Internet protocol suite|TCP/IP protocols]],<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rxsock.pdf |title=ooRexx Documentation 5.0.0 RxSock TCP/IP Socket Functions Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}}</ref> while the RxFtp native library<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rxftp.pdf |title=ooRexx Documentation 5.0.0 RxFtp Class Library Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}}</ref> specifically provides access to the [[File Transfer Protocol|file transfer protocol]] (FTP). The RxMath native library offers advanced mathematical functions such as square root calculation, exponential function, logarithm, sine, cosine, tangent, arc sine and power calculation.<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rxmath.pdf |title=ooRexx Documentation 5.0.0 RxMath Math Functions Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}}</ref> <syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> Say rxcalcsin(1) /* output: 0.0174524064 */ ::requires 'rxmath' LIBRARY /* load a native library */ </syntaxhighlight> For Windows, ooRexx includes the ooDialog framework allowing to produce [[Dialog box|Windows dialogs]] and therefore [[Graphical user interface|graphical user interfaces]].<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/oodialog.pdf |title=ooRexx Documentation 4.2.4 ooDialog Reference |last2=Flatscher |first2=Rony G. |last3=McGuire |first3=Rick |last4=Peedin |first4=Lee |last5=Sims |first5=Oliver |last6=Wolfers |first6=Jon |publisher=RexxLA |year=2019}}</ref> The interpreter is delivered with several example programs and function packages that demonstrate the use of this framework.<ref name=":9" /> For [[POSIX]]-compatible operating systems, the orxnCurses class library enables the writing of [[Text-based user interface|text-based user interfaces]] using the [[ncurses]] programming library.<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/orxncurses.pdf |title=ooRexx Documentation 5.0.0 nCurses Class Library Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Steinböck |first7=Erich |last8=Wolfers |first8=Jon |publisher=RexxLA |year=2022}}</ref> The RxUnixSys library provides functions on most [[Unix]] systems for interacting with processes and threads, users and user groups, files and [[File system|file systems]] and other.<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/unixextensions.pdf |title=ooRexx Documentation 5.0.0 Unix Extensions Function Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Steinböck |first7=Erich |last8=Wolfers |first8=Jon |publisher=RexxLA |year=2022}}</ref> Many of these external packages and libraries are also compatible with other [[Rexx#Toolkits|Rexx implementations]]. === Not supplied with interpreter === {{stub-section|date=January 2025}} There are also packages that need to be downloaded and added manually. As part of the Net-oo-rexx bundle, the Regex package enables handling regular expressions, while Log4rexx provides a logging framework and Oorexxshell an interactive ooRexx shell.<ref name=":12" /> The Mod_Rexx package provides a module for [[Apache HTTP Server|Apache]] 2.4 that gives an interface to ooRexx under Windows, AIX and Linux and enables all phases of an Apache request to be processed.<ref>{{Cite web |date=2022-01-17 |title=Mod_rexx |url=https://sourceforge.net/projects/modrexx/ |access-date=2025-02-04 |website=SourceForge |language=en}}</ref> The Rexx Parser package provides an [[abstract syntax tree]] parser for Rexx and ooRexx, which assigns a category to all script elements, while the Rexx Highlighter package expands the parser and enables highlighting to be output as HTML, [[ANSI escape code|ANSI colors]], [[LuaTeX|LuaTex]] and [[LaTeX]].<ref>{{Cite web |title=The Rexx Parser |url=https://rexx.epbcn.com/rexx-parser/ |access-date=2025-02-04 |website=rexx.epbcn.com}}</ref><ref>{{Cite web |title=The Rexx Highlighter |url=https://rexx.epbcn.com/rexx-parser/doc/highlighter/ |access-date=2025-02-04 |website=rexx.epbcn.com}}</ref> The Rexx XML parser enables the parsing of [[XML]] files into an in-memory model and access to this model via a [[Document Object Model|DOM]]-like API.<ref>{{Citation |last=Armstrong |first=Andrew |title=abend0c1/rexxxmlparser |date=2024-12-02 |url=https://github.com/abend0c1/rexxxmlparser |access-date=2025-02-14}}</ref> ooRexxUnit is a test framework inspired by [[JUnit]] that enables the execution of ooRexx test cases that help to verify whether an application's specifications are met.<ref>{{Cite journal |last=Flatscher |first=Rony G. |year=2006 |title=ooRexxUnit: A JUnit Compliant Testing Framework for ooRexx Programs |url=https://wi.wu.ac.at/rgf/rexx/orx17/ |journal=The 2006 International Rexx Symposium}}</ref> == Bridges == While ooRexx compared to Object REXX no longer contains classes for SOM and WPS support, it offers [[application programming interfaces]] (APIs) for interacting with code written in [[C (programming language)|C]] or [[C++]].<ref name=":8">{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxapi.pdf |title=ooRexx Documentation 5.0.0 Application Programming Interfaces |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |date=2022 |publisher=RexxLA}}</ref> There is also an external library that implements a bidirectional [[Java (programming language)|Java]] bridge, which enables interaction between ooRexx and Java.<ref name=":4" /> Furthermore, there are classes that enable interaction with SQL databases and classes are provided that enable the automation of Windows applications. === C/C++ APIs === As classic Rexx, ooRexx includes APIs for extending Rexx with applications written in C and vice versa. This enables the creation of [[Callback (computer programming)|handlers]] for subcommands used in Rexx programs that run as application [[Macro (computer science)|macros]], external functions that allow a direct extension of the ooRexx function set and system functions that allow the behavior of the interpreter to be customized.<ref name=":8" /> With ooRexx 4.0.0 APIs have been introduced that allow C++ applications to extend ooRexx and vice versa. This includes handlers for methods and functions written in C++ that extend ooRexx, both packaged as external libraries. These are [[Dynamic-link library|dynamic link libraries]] on Windows or as [[Shared library|shared libraries]] on Unix-based systems. An external library can be loaded with the <code>::REQUIRES</code> directive or by using the <code>EXTERNAL</code> keyword instruction as part of a <code>::ROUTINE</code>, <code>::METHOD</code>, or <code>::ATTRIBUTE</code> directive. === Java === [[File:BSF4ooREXX awt.png|alt=Java Swing via BSF4ooRexx|thumb|300x300px|Multi-platform GUIs via BSF4ooRexx]] Using the C++ APIs, BSF4ooRexx was developed as a bidirectional Java bridge based on the [[Bean Scripting Framework]]. This bridge enables ooRexx to communicate with Java objects and Java to interact with Rexx applications.<ref name=":10">{{Cite web |title=BSF4ooRexx |url=https://sourceforge.net/projects/bsf4oorexx/ |access-date=2024-11-10 |website=sourceforge.net|date=12 August 2024 }}</ref><ref name=":11">{{Cite news |last=Flatscher |first=Rony G. |date=2009 |title=The 2009 Edition of BSF4Rexx Part I |url=https://www.rexxla.org/presentations/2009/2009_orx20_BSF4Rexx_01.pdf |work=20th Rexx Language Symposium |publisher=RexxLA}}</ref> The bridge is realized by requiring the ooRexx package <code>BSF.CLS</code>, which defines public routines, classes and the environment symbol <code>.BSF4REXX</code>.<ref name=":11" /> Examples are provided for the use of Java classes in connection with [[Abstract Window Toolkit|AWT]], [[Swing (Java)|Swing]], [[JavaFX]], [[Java Database Connectivity|JDBC]], [[Java 2D]] and some others.<ref name=":10" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1">/* create Java object */ frame=.bsf~new("javax.swing.JFrame", "Hello, my beloved world - from ooRexx!") frame~setSize(410,20) /* set width and height */ frame~visible=.true /* make JFrame visible */ call SysSleep 10 /* sleep for ten seconds */ ::requires "BSF.CLS" /* get Java support */</syntaxhighlight> Based on BSF4ooRexx, interaction with [[Universal Network Objects]] (UNO), as used in [[OpenOffice.org|OpenOffice]] and [[LibreOffice]], is supported via the <code>UNO.CLS</code> package.<ref>{{Cite book |last=Waglechner |first=Christoph |url=https://wi.wu.ac.at/rgf/diplomarbeiten/BakkStuff/2009/20090621-Waglechner-Pitonyak-OOo/Waglechner_PitonyakNutshells.pdf |title=OpenOffice.org Automation Using ooRexx Scripting Language by means of Selected Nutshell Examples by Andrew Pitonyak |date=2009}}</ref> In addition, the <code>CLR.CLS</code> package together with [https://github.com/jni4net/jni4net Jini4Net] enables the use of the [[.NET Framework|.NET framework]].<ref>{{Cite book |last=Baginski |first=Adrian |url=https://wi.wu.ac.at/rgf/diplomarbeiten/BakkStuooR2016/20160723_Baginski-Adrian-ooRexx-Net-Cookbook.pdf |title=A .NET Cookbook Using ooRexx.NET |date=2016}}</ref> Communication with processes via the [[D-Bus]] [[middleware]] under Linux is possible using the <code>DBUS.CLS</code> package.<ref>{{Cite book |last=Lagler |first=Richard |url=https://wi.wu.ac.at/rgf/diplomarbeiten/Seminararbeiten/2015/20150220-Lagler-DBus.pdf |title=D-Bus Language Binding for ooRexx: An Introduction on Nutshell Examples |date=2015}}</ref> === SQL === The ooSQLite class provides an interface to [[SQLite]], an in-process library that implements a self-contained, serverless, zero-configuration, transactional [[SQL]] database engine.<ref>{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/oosqlite.pdf |title=ooRexx Documentation 1.0.0 ooSQLite Reference |last2=Flatscher |first2=Rony G. |last3=McGuire |first3=Rick |last4=Miesfeld |first4=Mark |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}}</ref> It allows interaction with several variants of SQL databases without having to change the script, but multi-threading is not supported.<ref>{{Cite web |title=OREXX/SQL Object Framework - EDM2 |url=http://www.edm2.com/index.php/OREXX/SQL_Object_Framework |access-date=2024-12-11 |website=www.edm2.com}}</ref> The external Rexx/SQL package enables access to SQL databases of different vendors via [[Open Database Connectivity]] (ODBC).<ref>{{Cite web |date=2013-06-19 |title=Rexx/SQL |url=https://sourceforge.net/projects/rexxsql/ |access-date=2025-02-03 |website=SourceForge |language=en}}</ref> With the goal of providing more functionality than a subset of ODBC and being [[Thread safety|thread-safe]], the Rexx MySQL library provides a wrapper in C to add [[MySQL]] support.<ref>{{Cite web |date=2013-04-25 |title=REXX MySQL Library |url=https://sourceforge.net/projects/rexx-mysql/ |access-date=2025-02-03 |website=SourceForge |language=en}}</ref> === Windows automation === The Windows extension includes the [[Windows Script Host]] (WSH) Scripting Engine that can be used to perform general automation tasks. It also includes [[Object Linking and Embedding]]/[[ActiveX]] (OLE) support allowing to interact with Windows programs via the <code>OLEObject</code>.<ref name=":5">{{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/winextensions.pdf |title=ooRexx Documentation 5.0.0 Windows Extensions Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Sims |first7=Oliver |last8=Wolfers |first8=Jon |publisher=RexxLA |year=2022}}</ref> [[OLE Automation]] is an [[inter-process communication]] mechanism developed by [[Microsoft]] that is based on a subset of the [[Component Object Model]] (COM). This mechanism enables, among other things, the invocation of program functions, the querying and setting of attributes and the interception of component events. The ooRexx interpreter comes with examples that demonstrate OLE interaction with [[Microsoft Access|Access]], [[Microsoft Word|Word]], [[Microsoft Excel|Excel]], [[OpenOffice (Apache)|OpenOffice]]/[[LibreOffice]], [[Active Directory|ActiveDirectory]], [[Windows Management Instrumentation|WMI]] and other programs. Furthermore, a utility program for searching available OLE objects is included.<ref name=":9" /><syntaxhighlight lang="oorexx" style="background-color: #ffffff; !important" line="1"> exc = .OLEObject~new("Excel.Application") /* create object for Excel */ exc~visible = .true /* make Excel visible */ Worksheet = exc~Workbooks~Add~Worksheets[1] /* add worksheet */ Worksheet~cells(1,1)~Value = “First Cell” /* insert string into cell */ </syntaxhighlight>In addition to OLE support, the Windows extension enables interaction with the Windows program manager, the [[Tracing (software)|system event log]], the [[Clipboard (computing)|clipboard]] and the [[Windows Registry|registry]] as well as to query, edit and interact with windows, menus or sub-menus.<ref name=":5" /> == Notes == {{Notelist}} == See also == {{Portal|Computer programming|Free and open-source software}} * [[Comparison of programming languages]] * [[Timeline of programming languages]] == References == {{Reflist}} == Further reading == * {{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxref.pdf |title=ooRexx Documentation 5.0.0 Open Object Rexx Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |publisher=RexxLA |year=2022}} * {{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxpg.pdf |title=ooRexx Documentation 5.0.0 Programmer Guide |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |date=2022 |publisher=RexxLA}} * {{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/winextensions.pdf |title=ooRexx Documentation 5.0.0 Windows Extensions Reference |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Sims |first7=Oliver |last8=Wolfers |first8=Jon |publisher=RexxLA |year=2022}} * {{Cite book |last1=Ashley |first1=W. David |url=https://sourceforge.net/projects/oorexx/files/oorexx-docs/5.0.0/rexxapi.pdf |title=ooRexx Documentation 5.0.0 Application Programming Interfaces |last2=Flatscher |first2=Rony G. |last3=Hessling |first3=Mark |last4=McGuire |first4=Rick |last5=Peedin |first5=Lee |last6=Sims |first6=Oliver |last7=Wolfers |first7=Jon |date=2022 |publisher=RexxLA}} * {{Cite book |last=Fosdick |first=Howard |url=https://rexxinfo.org/Rexx_Programmers_Reference.pdf |title=Rexx Programmer's Reference |publisher=Rexx Language Association |year=2024 |isbn=979-898611913-7 |edition=2nd}} * {{Cite book |last=Flatscher |first=Rony G. | title=Introduction to Rexx and ooRexx: From Rexx to Open Object Rexx (ooRexx) |publisher=Mijnbestseller |year=2024 |isbn=978-9403755038 }} ==External links== {{commons category|REXX (programming language)}} *[https://www.rexxla.org/ Rexx Language Association] *[[sourceforge:projects/oorexx/files/oorexx-docs/5.0.0/|Open Object Rexx 5.0.0 documentation]] *[[sourceforge:projects/oorexx/|Open Object Rexx on Sourceforge]] *[https://www.oorexx.org/ Open Object Rexx Website] *[https://rosettacode.org/wiki/Category:OoRexx Open Object Rexx on Rosetta Code] *[[sourceforge:projects/bsf4oorexx/|BSF4ooRexx on Sourceforge]] *[[sourceforge:projects/oorexxdebugger/|ooRexx Debugger on Sourceforge]] *[https://wi.wu.ac.at/rgf/rexx/tmp/net-oo-rexx-packages/ Net-oo-Rexx] {{Programming languages}} {{IBM FOSS}} [[Category:Text-oriented programming languages]] [[Category:High-level programming languages]] [[Category:Multi-paradigm programming languages]] [[Category:Class-based programming languages]] [[Category:Object-oriented programming languages]] [[Category:Structured programming languages]] [[Category:Dynamically typed programming languages]] [[Category:Free and open source interpreters]] [[Category:Scripting languages]] [[Category:IBM software]] [[Category:Cross-platform software]] [[Category:Rexx]] [[Category:Programming languages created in 1988]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:Commons category
(
edit
)
Template:Efn
(
edit
)
Template:IBM FOSS
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Notelist
(
edit
)
Template:Portal
(
edit
)
Template:Programming languages
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Stub-section
(
edit
)
Template:Version
(
edit
)