On 15.04.2024 19:08, Jon Perryman wrote:
Java's not perfect, but it is powerful and it is pretty much universally
available on z/OS.
People don't understand the ingenuity behind REXX and don't understand the real
problems it solves. From a language standpoint, REXX is just another language
but it's real strength is it's environment integration. Instead of the caller
maintaining libraries, the environment automatically integrates with REXX. For
instance, REXX in the TSO environment, gives you access to TSO commands
(address TSO) and z/OS programs (address linkmvs). Start ISPF and address
ISPEXEC is available. ISPF option 2 gives you address ISREDIT. SYSCALLS ON
gives you address syscalls.
For product developers, REXX is simple to integrate environments as witnessed
by the plethora of integrated environments on z/VM, z/OS and probably z/VSE
(e.g. some addressable environments: automation, CICS, CMS, CP, TSO, UNIX,
SYSCALLS and more)
OOREXX is not REXX because it does not have the automatic environment
integration and as you say, using JAVA instead of OOREXX would be preferable.
REXX on the other hand is preferable over JAVA in many IBM environments. For
instance, why would you use JAVA as your system automation environment language?
The complication of using OOP REXX is rarely beneficial for most environments.
Generally, you are not building complicated applications. For instance, system
automation will be the most complex but managing events under objects would be
complicated and unmanageable given the current automation environment design.
There is no "complication of using OOP REXX": ooRexx runs Rexx programs just like Rexx. It therefore
needs to support addressable command environments it also supports the REXXSAA APIs including exits.
ooRexx adds the message expression to Rexx to simplify interactions with any kind of values. E.g.
instead of coding
say reverse("abc") /* yields a string "cba" */
you can optionally code:
say "abc"~reverse /* yields a string "cba" */
The message expression consists of a receiver value (synonyms: object, instance) on the left-hand
side of the tilde (~), which is the message operator, followed by the name of a message on the right
hand side. If the message has arguments you would supply them in parentheses.
The receiver is then responsible to search for a method (function) by the name of the received
message, invokes it and returns the result, if any.
This is a quite simple concept.
Whether you take advantage of the message paradigm in ooRexx or not is up to you if working with
strings as for strings there are the REXX built-in functions (BIFs).
In the context of message expressions please note that Alan Kaye, one of the most influential and
seminal computer scientists who was working on Xerox PARC' SmallTalk gets cited Wikipedia
(https://en.wikipedia.org/wiki/Alan_Kay):
Along with some colleagues at PARC, Kay is one of the fathers of the idea of
object-oriented
programming <https://en.wikipedia.org/wiki/Object-oriented_programming>
(OOP), which he named.
Some original object-oriented concepts, including the use of the words
'object' and 'class', had
been developed for Simula <https://en.wikipedia.org/wiki/Simula> 67 at the
Norwegian Computing
Center <https://en.wikipedia.org/wiki/Norwegian_Computing_Center>. Kay said:
I'm sorry that I long ago coined the term "objects" for this topic
because it gets many
people to focus on the lesser idea. The big idea is "messaging
<https://en.wikipedia.org/wiki/Message_passing>".
The idea of messaging is what the IBM research team in Hursley added to REXX to come up with Object
REXX, making it astonishingly simple to interact with any kind of value (object, instance) in any
programming environment.
The message paradigm not only works with string values, but with any kind of values (objects,
instances).
This is the reason why it is simple for novices who learn programming with ooRexx to interact with
Windows and Windows programs like MS Office or OpenOffice or LibreOffice via OLE: the ooRexx
programmer only needs to send messages to those Windows objects, how the receiver (an OLE object)
carries them out is not necessary to be known by the ooRexx programmer.
The same is true for Java: the ooRexx programmer only needs to send messages to Java objects, how
the receiver (a Java object) carries them out is not necessary to be known by the ooRexx programmer.
The same is true for DBus on Linux systems: the ooRexx programmer only needs to send messages to
Java objects, how the receiver (a DBus object) carries them out is not necessary to be known by the
ooRexx programmer.
And so on ...
---
The other addition of ooRexx to REXX are directive instructions. If present, they are put at the end
of a program and direct the ooRexx interpreter to carry out services on behalf of the ooRexx
programmer in the setup phase. E.g. the requires directive tells the ooRexx interpreter to call
another Rexx program before our program starts to run. This way one can use directives to set up
resources that our programs need to use.
To shed some light on this, these are the steps the ooRexx interpreter carries out if it is supposed
to run a program:
1. loading phase: the Rexx program will be read and syntax checked,
2. setup phase: if the Rexx program contains directives (they get led in with
two consecutive
colons as eye catchers at the end of the program), then the interpreter will
carry them out,
3. execution phase: the program will start to run with the first instruction.
At that point in time
all directives got processed already and the program can take advantage of
any resources the
directives brought into the execution environment.
In the case that a Rexx programmer needs to work with structures, he can use the appropriate
directives to define them (the directives class, attribute, method, constant). Using the message
named NEW he can create as many instances of a structure (class, type) as needed.
Again, one would use directives only, if they add value to a Rexx program.
---
A last word ad ooRexx: it is available for all major operating systems, including Windows, Linux and
MacOS such that any decent programmer can install it and take advantage of it. ooRexx is also
available for s390x Linuxes such that it can be used on mainframes now.
Whatever ooRexx programs you create on one platform can be usually run on all
the other platforms.
---
You may want to take a look at the article
<https://research.wu.ac.at/files/41301564/ISECON23_Flatscher_Proposing_ooRexx_article.pdf> which
introduces Rexx and ooRexx to engineering educators. Reading that article, any interested REXX
programmer from this mailing list should be able to learn ooRexx in about half an hour!
You would also see how easy it is to exploit message expressions and directives. If that is not
enough of an insight, you would learn how to create an Excel spreadsheet and fill it with data and
amend that program for your own purposes. If that is not enough, you would learn how easy it is to
use messages to address Java to create a Java popup window that runs on Windows, Linux and MacOS
unchanged. And if that is not enough you would see how easy it is to create a Java2D graphics using
a simple Rexx program that addresses a Java2D command handler.
It is not difficult, if educators who never heard about Rexx or ooRexx can understand that article
without any further explanations and can assess how easy, but also how poerful Rexx and ooRexx are.
After all ooRexx is Rexx. :)
---rony
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN