Author Topic: Classic, Regina, Object and Open Object Rexx  (Read 2372 times)

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 284
  • Karma: +5/-0
    • View Profile
Classic, Regina, Object and Open Object Rexx
« on: October 01, 2024, 06:58:57 pm »
I see that the knowledge of REXX is somewhat limited even with OS/2 users.

Classic Rexx (by IBM) is the default scripting language in OS/2, eComStation and ArcaOS and one just need a simple text editor and write in fairly plain English.
It allow you as a user to write scripts to aid you with certain tasks and it is well integrated with the system so that you don't need to specify an executable to run a script, but it also drive applications as the "engine" written with for example DrDialog, VX-REXX and even code you can write yourself and compile.
It is not possible to create reusable text libraries of code to just call, but one can write functions in the script that perform certain tasks. It's is however possible to use external compiled libraries.

Regina Rexx (by Mark Hessling) is more modern, very similar to Classic Rexx, but lack the system integration.
It is more up to date than Classic Rexx and probably also somewhat more reliable.

Object Rexx (by IBM) addressed some of the shortcomings of Classic Rexx, and on can switch to it in OS/2, eComStation and ArcaOS, while the way to write code also evolved and introduced ~ and arrays with [] but also external reusable code libraries, written in plain text Object Rexx.
Object Rexx is just as well integrated with the base OS as Classic Rexx, can run and use Classic Rexx scripts end external compiled libraries and be the engine for DrDialog, VX-REXX etc., but was never set as default due to that the OS/2 version had some flaws caused by the compiler used, if I remember correctly.

Open Object Rexx (by RexxLA)
has refined what IBM created with Object Rexx and also cleaned up some syntax and introduced a lot of useful and powerful stuff. We now have an up to date and current ooRexx back ported to OS/2 but the integration found in Classic Rexx and Object Rexx is missing so DrDialog, VX-REXX etc. can not benefit from the new features, easier and simpler way to express complicated information and relations etc. but still need to rely on those old scripting engines to be present. If we'd have the intergration Classic Rexx and Object Rexx could be phased out in favor of the new and open version. What we need is what I express as the integration part and that it can run in any command line environment, not only 4OS2.

So what can one do with REXX you wonder?
Alex Taylor has for example written some excellent software that you may have used, both command line scripts and GUI applications like Naps and ANPM to mention a few.
Glassman wrote AutoWGet that is very helpful to fetch things from the internet
and much more...

I use ooRexx to automatically create documents with maps to send to owners of land at work, drive office applications, vector drawing applications such as OpenOffice Draw, Calc etc. split/merge/extract text PDF documents with GhostScript and retrieve routes from google between places etc.

I would like to get your attention to push for an update to the wps integration stuff and enable it for ooRexx on OS/2, without reinventing the wheel from scratch.
The problem is that IBM have a cross licensing agreement with another party (Amiga)?!
« Last Edit: October 02, 2024, 11:23:15 pm by Martin Iturbide »

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: Classic, Regina, Object and Open Object Rexx
« Reply #1 on: October 02, 2024, 08:00:32 am »
Fairly complete description, Jan-Erik. Thanks.
Some of these details I didn't know very well - as far as I can remember, Object REXX was heavily criticized on Warp 4 and almost never used - I stayed on Classic REXX, like many of us.
I also used DrDialog and GPF Rexx (too bad they're discontinued) to build some fancy apps for my theatre activities and boy, was it fun.

I'm currently too involved in porting OS/2 apps from the open source entourage so I don't have time, but in the future I'm willing to write some other useful GUI application in REXX, mostly for my activities as a musician and electronic engineer.

The interesting part of REXX on OS/2 is its integration with the system and SOM - I see many similarities between {OS/2, SOM, REXX} and the .NET environment on Windows and Linux with its Powershell scripting language, though I prefer the more elegant REXX syntax (Powershell can really be a drag). So yes, being able to integrate Regina or ooRexx with OS/2 (and SOM) would give us a big step forward.

Mentore

Andi B.

  • Hero Member
  • *****
  • Posts: 873
  • Karma: +14/-2
    • View Profile
Re: Classic, Regina, Object and Open Object Rexx
« Reply #2 on: October 02, 2024, 09:00:47 am »
Is Open Object Rexx (by RexxLA) what was/called NetRexx? I vaguely remember some presentation on some Warpstock Europe some time ago...

Mentore

  • Full Member
  • ***
  • Posts: 226
  • Karma: +11/-0
    • View Profile
Re: Classic, Regina, Object and Open Object Rexx
« Reply #3 on: October 03, 2024, 08:17:29 am »
Is Open Object Rexx (by RexxLA) what was/called NetRexx? I vaguely remember some presentation on some Warpstock Europe some time ago...

AFAIK, Andi, NetRexx was/is (?) something related to Java: quoting the NetRexx website
"NetRexx is a general-purpose programming language inspired by two very different programming languages, Rexx and Java."

Though I feel Netrexx and ooRexx have many things in common, ISTR there is also a converter from / to Netrexx under OS/2.

Mentore

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1074
  • Karma: +27/-0
    • View Profile
    • Blonde Guy
Re: Classic, Regina, Object and Open Object Rexx
« Reply #4 on: October 03, 2024, 03:48:33 pm »
NetRexx is an implementation of Rexx that runs on a Java virtual machine. The powerful thing about it is that it can access many Java libraries. If you prefer Rexx, but want to write Java programs, NetRexx may be useful.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5027
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Classic, Regina, Object and Open Object Rexx
« Reply #5 on: October 04, 2024, 04:23:55 pm »
Hello Jan-Erik

I would like to get your attention to push for an update to the wps integration stuff and enable it for ooRexx on OS/2, without reinventing the wheel from scratch.
The problem is that IBM have a cross licensing agreement with another party (Amiga)?!

I don't have knowledge on this area, so I'm just asking, what kind of WPS and ooRexx integration do you expect or need?
Is it something like "IBM's Object Rexx has this WPS integration, I need the same one for ooRexx, because it is currently missing on that open open source project"?

Is there too much WPS integration on IBM's Object Rexx? Will it be a long project to do that?

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Jan-Erik Lärka

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 284
  • Karma: +5/-0
    • View Profile
Re: Classic, Regina, Object and Open Object Rexx
« Reply #6 on: October 06, 2024, 10:31:01 am »
NetRexx
  • The last version that ran with our Java (1.)6 was 3.04, as they then compiled it to require features introduced with Java (1.)8 in later NetRexx versions
  • I understand that NetRexx create byte code that the java engine run, but with the additions of Rexx like libraries that add useful features that resemble Rexx.
  • It claim to be like Rexx, but due to the underlying requirement to follow a ceratin structure the code one can write, need to have a certain structure that I don't recognize from Rexx.

Consensus was that Object Rexx for OS/2 wasn't good enough (good features, but bad memory handling, speed and stability due to the complier used), thus not set as default.

WPS integration
Both IBM Classic Rexx (crexx from now on) and IBM Object Rexx (orexx from now on) is integrated with the system, that's why you need to switch rexx interpreter with the command SWITCHRX (see the code of SWITCHRX.CMD in your OS2-folder) that aslo reregister files such as
REXXSC.DLL
OREXXSC.DLL
REXXSOM.DLL
OREXXSOM.DLL
REXXWPS.DLL
OREXXWPS.DLL
that enable crexx  and orexx to be the scripting engine for applications as well as talk to the wps through SOM etc. etc. that interact with the scripting engine to launch it from command line without first typing a scripitng engine name such as rexx <script_to_run.ext>. Guess DB2 intergation and other rexx enabled applications use the currently enabled scripting engine.

When I talk about WPS integration I also mean the programming interface "rexxsaa", not just SOM or WPS.
Code: [Select]
/*
 * Filename: dbug.cpp
 *   Author: JanErik
 *  Created: Sun Oct  6 2024
 *  Purpose: Compile into dbug.exe and debug "it" with Watcom Visual Debugger (wdw) to correct libraries (dll:s) you write for rexx (see unimix rexx .dll)
 *  Changes:
 */
#define INCL_REXXSAA
#include <rexxsaa.h>
#include <iostream.h>

int main(int args, char *argn[]) {
  LONG      return_code;                 /* interpreter return code    */
  RXSTRING  argv[1];                     /* program argument string    */
  RXSTRING  retstr;                      /* program return value       */
  SHORT     rc;                          /* converted return code      */
  CHAR      return_buffer[250];          /* returned buffer            */
                                     /* build the argument string  */
  CHAR      retval[1];
  retval[0] = '\0';

  if( args > 2 ) {
    MAKERXSTRING( argv[0], argn[1], strlen( argn[1] ) );
  } else {
    MAKERXSTRING( argv[0], retval, strlen( retval ) );
  }
                                       /* set up default return      */
  MAKERXSTRING(retstr, return_buffer, sizeof(return_buffer));
  return_code = RexxStart(args,           /* one argument               */
                          argv,        /* argument array             */
                          argn[1], /* REXX procedure name        */
                          NULL,        /* use disk version           */
                          NULL,    /* default address name       */
                          RXCOMMAND,   /* calling as a subcommand    */
                          NULL,        /* no exits used              */
                          &rc,         /* converted return code      */
                          &retstr);    /* returned result            */
                                       /* process return value       */
                                       /* need to return storage?    */
  if (RXSTRPTR(retstr) != return_buffer)
    DosFreeMem(RXSTRPTR(retstr));      /* release the RXSTRING       */

  return 0;
}

There's a nifty script by Steven Levine out there that can enable one or the other on the fly, but then one can't rely on that a certain is enabled but has to fall back to always has to assume crexx to start with.  >:(
crexx is not aware of any of the new features, so with it still the default it is not really useful.
« Last Edit: October 06, 2024, 10:54:03 am by Jan-Erik Lärka »