I'm sure your BSF4ooRexx is a really nice library. But it's moot point
talking about it on this forum because ooRexx has not been ported to
z/OS, I'm sorry to say that I think it probably never will be. Unless,
of course, there is a REXX enthusiast who has the time and skills to do
the port. I can tell you from experience, it's not easy. I also wonder
what will happen to ooRexx once Rick McGuire retires? Is there a big
enough community to keep it going?
FWIW, the Python Py4J and JPype (and others) libraries are similar to
BSF4ooRexx and both run on z/OS. Note: you will need access to the
xlclang/xlclang++ libraries to install those packages as PyPi doesn't
have binaries for z/OS.
https://talvi.net/posts/a-brief-overview-of-python-java-bridges-in-2020.html
We use ReactorNetty for Java TCP servers [1]. Although it's far more
common these days to use a layer 7 protocol such as HTTP(S) using a
framework like Spring to do all the heavy lifting. It would be
interesting to see how BSF4ooRexx could use ReactorNetty and if there
would be any benefit over just using Java or Kotlin.
[1] https://projectreactor.io/docs/netty/release/reference/index.html
Python is not my favorite language by a country mile. For scripting I
would choose Lua every day of the week and twice on Sundays. My younger
colleagues, however, would not. A lot of universities use Python as the
language for Introduction to Programming courses so the new hires
already know the language from colleague. The reason I evangelize Python
on z/OS is because I can see that IBM are backing it and it's strategic.
I recently noticed IBM have released the Python AI Toolkit for z/OS
which is free of charge. Exciting times ahead.
https://www.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ssi/rep_ca/1/897/ENUS223-021/index.html&lang=en&request_locale=en
On 6/3/23 04:16, Rony G. Flatscher wrote:
Comment, asking:
> Like what? Have you ever tried to write a TCP server in REXX?
Comment, receiving:
> Start here and it is reasonably simple:
- TCPIP.SEZAINST(RSSERVER)
- TCPIP.SEZAINST(R6SERVER)
Comment: so writing a TCP server in REXX is not only theoretically
possible, but a reality. Interesting what happens next:
Thanks for the links. Now, there is code duplication between the
two modules. How would one go
about externalizing the common code to a module?
The method of maintaining the socket descriptor list is crude and
highlights the lack of data
structures in classic REXX.
Writing a non-blocking, multiplexing TCP server in Python is simple
https://docs.python.org/3/library/selectors.html
Comment: surprisingly bringing up totally different items/aspects
(somehow as "if you can, confuse/sidetrack/derail them"). The answer
is: if one has a need for a TCP server or a TCP client in REXX one can
create and use one as has been pointed out.
There have been no questions asked about how to go about "writing a
non-blocking, mulitplexing TCP server in Python". If there was a need
to "write a non-blocking, multiplexing TCP server in Python" why was
that particular question not asked in the first place?
OTOH if the need is for REXX servers and/or clients (the original
question) that employ "a non-blocking, mulitplexing TCP server" (the
new, derailing questions) and one wishes to code that in REXX one can
either look for REXX function libraries supplying the needed
infrastructure, or create such interfaces to such libraries, or use
NetRexx or BSF4ooRexx, which get one even more powerful abilities due
to be immediately able to exploit the multiplatform, tested, cunning
Java class libraries that come for free with Java. :)
Here slides where business administration students who learn
programming (in a course named "Business Programming") as novices (!)
in the second part of the semester (after two months learning Rexx and
then ooRexx from scratch) having become able to use all of Java as a
huge external ooRexx function and class library:
<https://wi.wu.ac.at/rgf/wu/lehre/autojava/material/foils/230_AutoJava_Sockets_V05.pdf>
(the slides also demonstrate how to take advantage of the Java SSL/TLS
classes, it is actually quite easy). This demonstrates among other
things how easy it becomes to exploit Java from ooRexx for creating
TCP server and clients, and as one can see it is even easy doing the
same with employing Java's SSL/TLS from the Rexx programs! [BTW this
has become possible because of ooRexx dynamic and message based
nature. Java objects suddenly understand ooRexx messages, the case of
spelling method names or field names is not relevant anymore and some
more. Or invoking Java methods on the Java RexxProxy class causes
messages to be sent off to the proxied Rexx object and some more.]
Compare the Python library above with what Java allows for, here a
nice overview article about it:
<https://liakh-aliaksandr.medium.com/java-sockets-i-o-blocking-non-blocking-and-asynchronous-fb7f066e4ede>.
Anything you see in the discussion about the POSIX definitions (that
shine through that Python library above and as such mandates the
knowledge about it) , the explanations about blocking, non-blocking,
synchroneous, asynchroneous, multiplexing followed by the overview of
respective Java classes in an overview form as well as the nutshell
Java samples (using Sockets, NIO, NIO2) can be directly and
immediately used/exploited from REXX in the form of ooRexx and
NetRexx, where NetRexx will even create native Java classes from your
Rexx code (running at the speed of native code). If wanting to keep
the interactivity of an interpreter, the dynamics and the flexibility
of ooRexx at runtime then use that.
The point here is simple: everyone who has REXX skills can rather
easily and immediately take advantage of ooRexx or NetRexx.
The design principle of "human-centricness" of REXX defined by its
inventor Mike F. Cowlishaw has been successfully applied for these two
Rexx languages as well, making it even for newcomers (novices, see
above!) easy to learn and take advantage of these Rexx languages (as a
matter of fact Mike F. Cowlishaw also designed NetRexx at IBM which
later got open-sourced and gets further developed by RexxLA.org).
Just try out these REXX variants, experiment a little bit, they open
totally new doors in addition to those you have been enjoying with
classic REXX already, hence it will pay in any case.
:)
---rony
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN