Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unclear on platform independent use after creation

Status
Not open for further replies.

Ed_Ray

IS-IT--Management
Jan 21, 2017
8
0
0
US
Hi to all.

I am new to Rexx but have programmed in many other scripting languages and high level languages such as c and c++ etc.

My question is typically when I compile other non Rexx scripts I get a true compiled item which I can take to the platform it was designed for and run it without the user needing to have the interpreter or anything else installed on their system.

The point being most users don't want to have to install anything on their systems just to get ones program to run.

I was going through some of the Rexx related web sites such as rexxinfo.com etc. and noticed they talked about "compiling" the Rexx script but it was not a true compilation in that still needed to be interpreted.

So my question is does the user need to install a Rexx interpreter on their system to run my scripts on their system?

If the answer is yes, then doesn't this defeat the whole point of compiling ones script so that the user does not need to install anything else other than ones executable?

Thanks to all in advance. Although the answer is probably a simple one for experienced Rexx folks, I was not able to find any direct answer to this by going through many different Rexx web sites.

 
Rexx compilation is not to an executable but, rather, to something similar to byte code in Java. So, just as you need a Java VM nstalled to run Java byte code you need a Rexx interpreter to run 'compiled' rexx.

The advantages are: a) it protects your source code from prying eyes and b) programs run a lot faster when 'compiled'.


Nic
 
So my question is does the user need to install a Rexx interpreter on their system to run my scripts on their system?

As far as I know, there are 2 options:

1. If you plan to use ooREXX, then it has included REXXC.
Here the answer to your question is: YES

2. On the page of Regina, there is link to RexxWrapper:
I never tried it, but it seems to create standalone executable which contains the rexx interpreter and your script.
 
For mikrom;
Regarding your "REXXC" compiler reference, once "compiled", is the interpreter build into the compiled file so that the user need not install an interpreter onto their system as implied by your other reference "RexWrapper". I ask since it does not directly state that in the "REXXC" reference description.

This the whole gist of my original question, that the user need not install anything on their system to run my rexx file.

So to make sure I am crystal on your answers: If I compile it with either of these two tools you referenced, the interpreter will be part of the compiled file and the user would not need to install a stand alone rexx interpreter on their system right?

Thanks for your answer, the build in interpreter part once compiled really needs to be more explicitly specified in many of the other rexx web sites. Unfortunately this is definitely not specified in most of the other rexx sites.

 
Here is it, how it works with REXXC:
Code:
c:\_mikrom\Work>rexx hello.rex
Hello from REXX

c:\_mikrom\Work>rexxc hello.rex helloc -s

c:\_mikrom\Work>rexx helloc
Hello from REXX

Even if I create a file named *.EXE, it doesn't run standalone without REXX interpreter - if I try it I get:
Code:
c:\_mikrom\Work>rexxc hello.rex helloc.exe -s

c:\_mikrom\Work>helloc.exe
This version of c:\_mikrom\Work\helloc.exe is not compatible with the version of Windows you're running. Check your computer's system information
 to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher.

c:\_mikrom\Work>rexx helloc.exe
Hello from REXX

If we look at the "compiled" file helloc, it has only 756 Bytes - because it does not contain embedded interpreter.
In other words: What REXXC does is not true compilation, its so called tokenization.
Code:
c:\_mikrom\Work>dir hello?.*
 Volume in drive C is OS
 Volume Serial Number is 0209-9D88

 Directory of c:\_mikrom\Work

23.01.2017  08:45                21 hello.rex
23.01.2017  08:54               756 helloc
23.01.2017  08:57               756 helloc.exe
               3 File(s)          1 533 bytes
               0 Dir(s)  1 284 077 252 608 bytes free


 
For mikrom;
I guess I am more confused now then before.

The hello.rex file is only 21 bytes while the tokenized one (helloc) is 756 bytes (much larger) which would imply it has the interpreter built inside the file else why would it be so much larger?

Thanks
 
Hi Ed_Ray,

21 bytes vs 756 Bytes does not mean that the compiler is packed in. With REXX compiler packed in, it would be some KBytes or MBytes

It's similar as when I try to write Hello World program in Python or Java:
- Hello.py has 19 Bytes, "compiled" hello.pyc has 132 Bytes
- Hello.java has 114 Byte, "compiled" Hello.class has 415 Bytes

In both "compiled" cases (Python and Java) the interpreters are not included in the "bytecode". To run the bytecode you need the interpreters installed.
With REXXC it's very similar.

I suggest you to install ooREXX and try it yourself.
 
Hi mikrom;
Thanks for your response. I will try it myself later on this week.

One last question to make sure. Do you need just the ONE interpreter file along with "helloc" or does the user need to install ALL of the installation files including the interpreter file?

I think the user can live with having to load only these TWO file but I just don't think you will able to convince any of your clients that they have to install an entire program with many files just to make your one Rexx file work.

I know for sure if this were the case, ALL of my clients would say NO THANKS and this would pretty much kill any attempt on my part to use Rexx for any real programming needs. It would then only make sense to use for my own personal OS admin work and nothing else.

Thanks for your help. Appreciate your feedback.
 
I have installed ooREXX in one one directory. The size is cca 38 MB. It contains EXE files DLLs, examples and doc.
IMO, you will need more than 1 file.
Maybe you can create smaller portable REXX version, where you copy in one directory only files, which are needed to run your script and you will distribute this portable REXX version with your script.
Further, you can use a setup program, which creates for you an installation program, which you will distribute to the user. In the past I distributed my Python programs using Inno Setup. It created for me one installation EXE which I gave to the user.
 
Hi Ed Ray,
I tried, what I wrote in my previous post and it works:
1. To run my HelloWorld script I created minimalistic portable REXX from Regina
2. Then I downloaded Inno Setup and created setup EXE for distributing my application.

User gets only one exe file, installs it by double click in a selected directory.
In case when it doesn't want it it can be easily uninstalled in using Add Or Remove Programs in Control Panel

If you want to try I uploaded it here
 
 http://files.engineering.com/getfile.aspx?folder=5ebc9611-6220-414c-b463-a235fa9b71e6&file=MyHelloApp.exe
Hi mikrom;
I will take your recommendation under consideration since it seems a decent happy medium. I also downloaded your file. Thank you.

I guess I (and all my clients) have gotten spoiled with the other scripting languages I have previously used which compile into a single real machine code executable that did not require anything else other than that one file on the users system.

Too may people have gotten their systems messed up when full installations modified ini file and/or registry settings etc.

Regarding the regina portable version, I did not see that as an option in the web site links. Is this an option you can only see and choose during the installation process?

I think the other alternative related to Rexx I had been looking into, is netRexx since it is my understanding based on their write-up that it can create a single program file that runs on any environment that has a Java Virtual Machine which I believe includes Windows, linux and Mac OSX the exact platform targets I care about.

This means after "compilation", you don't need to have the user install all the netrexx installation files.


Thanks.
 
Ed_Ray said:
I guess I (and all my clients) have gotten spoiled with the other scripting languages I have previously used which compile into a single real machine code executable that did not require anything else other than that one file on the users system.
interesting: can you say what a scripting languages have you used ?


Ed_Ray said:
Regarding the regina portable version, I did not see that as an option in the web site links. Is this an option you can only see and choose during the installation process?
On the Regina download page, instead to download EXE file you can download ZIP. This I mean as a portable version.
I downloaded Regina391w64.zip unpacked it in a directory and created a minimalistic version by removing files that were not necessary to run the program. Then to run a REXX application this minimalistic version could be distributed.
I attached the ZIP archive with all files needed. Download it and unpack it, then the file 00_Readme1st.txt contains a short step-by-step info, how I created the setup program MyHelloApp.exe (posted before)


Ed_Ray said:
I think the other alternative related to Rexx I had been looking into, is netRexx since it is my understanding based on their write-up that it can create a single program file that runs on any environment that has a Java Virtual Machine which I believe includes Windows, linux and Mac OSX the exact platform targets I care about.
This means after "compilation", you don't need to have the user install all the netrexx installation files.
NetREXX is a REXX-like language, but it's not REXX - it's completely other language - read a manual on it.
NetREXX coud be compiled in Java class or jar file and distribute at the similar way as Java applications, but IMO, I don't see an advantage in distributing NetREXX - because "what when the user does not have Java" is similar problem as "what when the user does not have REXX"..
If the user does not have Java you must say him to install it. And when the user does not have REXX you must say him to install it. IMO it's the same - or not ?
 
 http://files.engineering.com/getfile.aspx?folder=58f001fe-225b-49f8-9bee-41f542ebfc4d&file=MyHelloApp.zip
Hi mikrom;

With respect of a few scripting languages that convert to a single executable there are many I have used, but here are a few:

vbscripts can be compiled into a single .exe that is executed directly within the executable file. The executable uses a built in Wscript object so even if the user had clobbered their wscript.exe file within the windows system, the vbs executable will still work.

Another is livecode. Not only does it compile to a single executable file that does not need anything else to run, at compilation time it creates a window executable file (.exe), a Linux executable file (file with no extension) and a mac OSX executable (.app) file. In addition it can also create for the same source, an android executable file and an IOS executable file (not sure of the extensions since I have yet to select those compilation options since I have been concentrating on desktop apps).

Yet another is autoit. It create a true .exe that does not require any other file to run other than itself.
===========================================================================

As far as netRexx, based on speaking to many windows, Linux and mac osx users in the past and in recent times, they have stipulated that their OS typically already comes with a JVM preinstalled so there is really nothing additional for them to install other than the single netrexx file. Hence the netrexx advantage.

In addition, other netrexx programmers have recently told me that the other big netrexx advantage is the ability to natively access and use all the jvm classes (the entire related library) and related methods directly within netrexx.
 
Hi Ed_Ray,

Thanks for the answer abou the scripting languages.

... that their OS typically already comes with a JVM preinstalled ...
generally, that's not true, i have Windows and Linux and on every machine I installed Java self - the same like I installed self REXX :)

big netrexx advantage is the ability to natively access and use all the jvm classes (the entire related library) and related methods directly within netrexx
Yes it's surely true. But if you want to use Java classes, you must have some knowledge in Java: You must be able to understand and try Java code.
When you want to solve a practical problem - for example how to parse your specific XML: You must first google for example how to parse XML in Java, maybe try some example, understand it and adapt the Java solution for your specific XML. When it works in Java, then transform the Java Code into NetRexx. For me I don't see much advantage, because I'm java programmer and in this case I would solve my XML problem rather in Java.
My opinion is that NetREXX would serve me good, if I have a working REXX code and want to incorporate it into Java.
But it was only my opinion. I never tried that. If you want, then best thing is to try it and make your own expereinces with it.
 
Hi mikrom;
Thanks for the feedback

In reality I only need rexx (probably ooRexx) to only do a few simple things like the three items shown below in a cross platform manner (linux and Mac os x) since for the windows OS I have used the livecode language particularly for the complex GUI and extensive string handling etc along with a custom windows exe that does items [1] through [3] below:

Items [1] to [3] needed done by ooRexx for linux and Mac osx:
[1]Be able to tell that a locally launched html file has finally become active based on a window title or handle (so I won’t send keystrokes or clicks to an inactive window)
[2] Once active be able to send it keystrokes or mouse clicks
[3]Close the active hrml file window with the window handle or title

I located “Open Object Rexx™ Windows Extensions Reference Version 4.0.0 Edition” online then went over to the “window object class” material part of the reference .
It seems that some of this can be used to do items [1] to [3] items WITHIN windows.

but since I have already created a custom windows exe file to do the three items above,
I only need a language that has similar methods to those specified in the ooRexx windows extensions specified above in order to do the same functionality for linux and the Mac osx.

Does ooRexx have extensions (actual document links)similar to the ooRexx windows object class extensions that work for linux and the Mac osx to allow me to do items [1] through [3] specified above?.

Thanks.
Any reference links that you can give me showing similar methods usable in linux and Mac osx would be most appreciated.

 
Does ooRexx have extensions (actual document links)similar to the ooRexx windows object class extensions that work for linux and the Mac osx ...
I think there is nothing like this for other OS than windows - or I don't know about it.

ooREXX originates from IBM Object REXX which was commercial product only for Windows (and OS/2) (see So these extensions were created only for Windows (and maybe for OS/2).

If you install ooREXX for Windows, there are lots of demo examples how to do things in Windows. Now I searched for these examples on my Linux installation and didn't found nothing.

Finally, also the documentation says that's only for Windows platform:

You mentioned livecode. It's not possible to do with it ? - because Wikipedia says that it's cross-platform.
 
Hi mikrom;
Thanks for the response.

Why don't I use livecode?
Ha Ha Ha. Let me hold my laughter for a second before I proceed. Oh if you only knew my pain.

I have actually completed my main app using Livecode(LC). The only flaw with LC is that it only lets you communicate with windows created WITHIN LC. Once it launches the local Html page it no longer provides any further communication path to that window because it will not do this natively nor does it provide a dll or com object extension to do this either...groan and double groan...

So they want to force the programmer to have to use a multitude of separate scripting languages to do the simple tasks I stated before (repeated here):

[1]Be able to tell that a locally launched html file has finally become active based on a window title or handle (so I won’t send keystrokes or clicks to an inactive window)
[2] Once active be able to send it keystrokes or mouse clicks
[3]Close the active hrml file window with the window handle or title

This means that unlike some of the scripting languages I had mentioned to you before like autoit, autohotkey or the linux equivalent (autokey) and similar scripting languages or linux tools like "xdotool (allows you to simulate keyboard and mouse input), and wmctrl (let's you manipulate GUI windows)" it does NOT create/provide a unique windows handle to the launched window based on the windows title that was created for the local html file.

Once this is not provided, the programmer then has no control over his own launched html file since there would be no point in sending keystrokes etc when there is no way of knowing when your window has become active and without a handle you can end up closing the wrong window etc.

I have already made repeated requests for livecode to provide me with this same functionality but they don't seem to want to do this (they rather you suffer through the learning curve and use of these other separate scripting languages to do the three simple tasks specified above).

So I am now stuck searching around the world for other cross platform scripting languages or OS specific tools in order to do these three simple tasks within the linux and Mac osx platforms.

This is how I ran into you on this Rexx forum, trying to see what ooRexx could do to resolve this mess. So do you now see the whole story and why I was laughing at the begining of the email but also said I was going through so much pain?

Lets both laugh together on this unbelivable story since crying at this point won't resolve anything.

Personally I really hate having to search and waste my time learning so many other scripting languages just to solve a few simple tasks when a relatively simple extension provided by LC would resolve all these issues.

In addition I hate heving my elegantly crafted main app become a mess with bits and pieces of the other scripting languages and tools inserted all over the place and dislike wasting my time testing them and "glueing" them together so they all work as one on all the different platforms.

Without ooRexx providing me with a cross platform solution, I am left with having to find tools similar to "xdotool" and "wmctrl" (linux cmd line tools) in order to manipulate the Mac OS X’s Terminal command line tool called xterm, in order to execute the three simple tasks specified above on a Mac. For me, this is just one big unnecessary cross platform mess I would rather not have to go through.

Thanks for all your past help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top