Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Greetings, back in the day (mid '90s) while working with IBM at Rochester MN
(USA) I had the need for the square root function, in REXX (believe it or not).

I wrote a routine for REXX (for the S370 system) that provides not only the
square root function sqrt(n) but also the transcedental functions--
trigonometric, exponential, logarithmic, hyperbolic -- and I placed these
routines in a REXX script called COMPUTE.REX/

When Dougie Lawson (also former IBMer) pointed me to oorexx on the RPi, I got
very nostalgic for my COMPUTE.REX and the memory of a day when the sqrt(n)
function was missing from a 'computer' language. I pulled it out of my archives
and decided to share it with yous guys.

oorexx (regina-rexx) is available on the repositories; so, I downloaded it
and voila-- COMPUTE.REX still works, no hits, no runs, no errors (if you
can stand the baseball metaphor (the season is fast approaching!)

I read the man page for regina-rexx (after downloading for RPi) and found that
it 'still' has no sqrt(n) function! BIG surprise...

For historical purposes (and just fun) I have uploaded my COMPUTE.REX module
from 1993 right here in this forum so that every RPi REXX user can 'finally'
have a sqrt(n) function... as well as arbitrary precision, and transcendentals;
including a couple of ways to calculate PI.

I'm not going to gaurantee that COMPUTE.REX is suitable for any purpose
what-so-ever, nor that it is complete, nor that it doesn't have bugs!
And, as always, we are somewhat embarrassed by our own old code... we would
surely not have done it 'that way' would we?

But, here it is for fun and enjoyment (and a bit of history to boot).

The script can be run embedded, can be placed into another script, or
can be run interactively. To start, I'll just show you how to call it in
regina-rexx at the command line to compute sqrt(2) !

it's crude and ugly but it gets the job done. It's a much cleaner syntax than yucky python.

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sat Apr 16, 2016 5:48 pm

by MarkHaysHarris777

DougieLawson wrote:
Here's my latest rexx program ...

Thanks Dougie, and for someone who may be watching but hasn't grown up with BASIC or REXX @mathboy4life;

... the highlight of REXX is that everything is a string (yes, everything); numbers, arrays, the code, objects--- all of it is represented by 'strings' which are interpreted as stuff like numbers (what is called a REXX number) or objects like lists of 'things' but represented as only 'strings'.

The simple idea behind REXX was to provide a language for IBM managers (simple people, most of which have had full frontal labotomies), operators, secretaries, support reps, accountants, etc... all of which had a singon to a 370 system mainframe (usually using a $5000 color 3279 terminal sitting in their office where an iMac sits today) to get their mail, and to do tasks involving metrics, data mining, 'managing' all sorts of stuff--- WITHOUT having to become a full fledged competant programmer. Mike Cowlishaw (UK IBMer) dreamt this up while the rest of the mainframe world was using klunky scripting tools like exec2. Well, it caught on big time, Mike was awarded a fellowship with IBM (five years of funding to do whatever he liked), and many people 'programmed' who were not necessarily programmers... even us professional programmers used it!

This was the same goal exactly the same goal of Kemeny and Kurtz at Dartmouth college in the US; ca. 1964. BASIC in combination with DTSS (Dartmouth Time Sharing System) became a way for non-programmers to program... there were terminals all over campus at Dartmouth in 1964 (first college ever to have an IT department which taught computer science classes to English majors!

But, BASIC had datatypes (numbers, and strings). REXX has no types. Everything is a string, and strings of characters are what people typically know how to use; without much study. Cowlishaw's book was about the size of the C K&R, and was an easy two hour read. VM's Conversational Monitor System (CMS) and REXX gave IBMers and their customers the ability to leverage the full power of the 370 system mainframes with elegance and ease.

There is still a huge REXX language following on the net today; and thousands of people are still leveraging the power of the king of languages--- REXX. (or Qeen, Regina) Long live the Queen)

Peace

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sat Apr 16, 2016 6:00 pm

by Douglas6

MarkHaysHarris777 wrote:if you can stand the baseball metaphor (the season is fast approaching!)

Um, actually, the season started almost two weeks ago.

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sat Apr 16, 2016 6:05 pm

by MarkHaysHarris777

Douglas6 wrote:

MarkHaysHarris777 wrote:if you can stand the baseball metaphor (the season is fast approaching!)

Um, actually, the season started almost two weeks ago.

ha! yeah, I'm talking about the 'Honkers' season (Rochester MN, um we have geese) and hotdogs, and beer, and sitting out in our little local stadium under the sun ... you know ... this summer!

We don't do cricket here (now there's a game for you... baseball for men!) We had a local Brit from Austrailia explain the game to a bunch of us at church one Saturday morning... whew, that is a serious sport...

it's crude and ugly but it gets the job done. It's a much cleaner syntax than yucky python.

Did you use XEDIT to write it?

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sun Apr 17, 2016 1:20 am

by DougieLawson

I use the rexxla OOREXX, it was initially installed to run some code on my machine that's written by a friend who had three years in Kingston, NY working as a VM/CMS developer. Steve logs in to my RPi B+ from his house and uses half of our shared 2TB NAS box for backing up his data (off-site, remotely).

That NAS for his off-site backups has been online since 2011, it's been running on a B+ since Feb 2015.

I've not used a real (modern) VM system or xedit since July 2003. I do most of my REXX programming on z/OS, TSO & ISPF rather than VM, CMS and XEDIT. My VM skills are a little bit rusty.

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sun Apr 17, 2016 2:09 am

by Dutch_Master

MarkHaysHarris777 wrote:... are hot dogs and beer a 'thing' at cricket matches?

Thus would answer a true Englishman, based on my observations of a) the game when it's covered on the BBC, and b) the public visible on said coverage

(always wondered why Americans insist on naming a game where one carries the oddly-shaped oval(-ish) ball in the hand as "football" where it clearly isn't played by the foot )

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sun Apr 17, 2016 2:35 am

by MarkHaysHarris777

Dutch_Master wrote:
(always wondered why Americans insist on naming a game where one carries the oddly-shaped oval(-ish) ball in the hand as "football" where it clearly isn't played by the foot )

Well, there is the kickoff, the punt, and the extra points 'kicked' after a touchdown; other than that... oh, beats me.

The more interesting question is why certain American men are paid millions of dollars per year to move a big's bladder down a cow pasture... I suppose its because they 'move it' whilst risking permanent brain damage (what little they had to begin with)... but again, beats me ?

But baseball... aaah... the best. Beyond the dogs, brats, and beers... all about stats, numbers, programming... and did I mention the dogs and beers? aaah.

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sun Apr 17, 2016 11:09 am

by DougieLawson

MarkHaysHarris777 wrote:But baseball... aaah... the best. Beyond the dogs, brats, and beers... all about stats, numbers, programming... and did I mention the dogs and beers? aaah.

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

"The game of rounders has been played in England since Tudor times, with the earliest reference being in 1744 in A Little Pretty Pocket-Book where it was called "base-ball" by John Newbery."

So it's been called "base-ball since as far back as we know.

When did it get renamed to "rounders"?

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Tue May 10, 2016 11:54 am

by Paulwood

I am so glad I found you can run REXX on the Pi! I still have a 1984 presentation on REXX and use to use it all the time (yes much easier than python!) I just had need to take two css files full of email addresses (mail chimp exports) most email addresses were in both, but some were unique to each file. I copied everything from one file to the next and sorted them and used a quick rexx program to compare the lines and write out a new file of the unique lines. Took about 20 minutes to write and test it and I havent touched REXX in 10 years!

Here the program if anyone wants to look at it. The email addresses are the first of the CSV entries in the file.

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

... OOREXX from RexxLA is also available in sources, and they will build right there on your PI ! (this does take some time... about 40 minutes?)

OORexx is the object oriented version from IBM; was popular back in the OS/2 Warp days.

Regina REXX has two flavors (both installed on the PI from the repositories... regina, and rexx) The difference in the interpreters is that Regina supports add-on modules (like maybe gpio libraries in C; haven't tried it yet) while the rexx counterpart does not. The install of oorexx will overwrite the rexx from regina, as will it also overwrite the man page; so if you want to preserve those be sure to move the man page to /usr/local/share and move the rexx interpreter to /usr/local/bin/ before installing oorexx. That way you can have all three on your PI at the same time without conflict. Oh, by the by, you'll also have to rename 'rexx' to 'rex' /

Long live the Rexx, long live Regina!

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sat May 14, 2016 11:07 am

by Paulwood

MarkHaysHarris777 wrote:Are you using Regina?

I'm not a 100% sure, but I beleive it is REXX since that is the command I used. I'm going to have to experiment with Regina to see if I can get the GPIO to work.

As for OOREXX...we'll see. I have a mental block about OO programming, maybe I just learned programming too long ago and with four grandsons that live nearby 5, 4, 3, and 2, I never seem to have the time to work on the projects I want to...but I do get to play with some cool kids toys

I remember writing a lot of ARexx around 1990. Sadly, I've forgotten most of the syntax.

Regina-REXX error on sysloadfuncs

Posted: Mon Dec 12, 2016 8:30 pm

by pgutti

Since a few weeks i run a raspberry app, my very first use of unix and linux. In the past i used Rexx very often, on various IBM Platforms. Now i'm very happy about that this wonderful scripting languange is available under Linux/Debian.

Under Regina i tried to load regutil functions. But this ends in an error:

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

You may be right: i copy-pastet this fincion call from pdf running under Mac OS into the VPN window!

Re: Regina-REXX and the COMPUTE.REX module for Dougie Lawson

Posted: Sun Dec 18, 2016 6:16 pm

by pgutti

With the Raspberry Pi installation, we get a very nice programming editor: Geany. It displays almost any programming language syntax sensitive. Very, very helpful when coding complex scripts. And nice looking too!