REBOL for COBOL programmers |
November 14, 2016
This is a short, personal, specific explanation of one person's
experience installing REBOL on a computer running 32-bit
opensuse 13.2. At some point in REBOL's past, development on
non-windows computers dropped off, and installation on such
computers became a bit of a struggle for the not-so-technically
adept. This document explains one pathway to getting REBOL
operating on one particular computer, in case that information
is helpful to anyone else.
The target audience is anyone who wants to use REBOL/View on a computer running GNU/Linux and has had a bit of trouble. This document explains one specific way to get it running on one specific computer. In other words, this is not the only way, or the best way. It is just a way.
The computer in this situation was a 64-bit computer with a 32-bit version of opensuse 13.2 I tried running REBOL on a 64-bit version of opensuse 13.2 and failed.
Go to the REBOL web site at www.rebol.com.
Click the "Downloads" item on the menu bar at the top.
Scroll down to the REBOL/View section.
Select the "Linux x86 libc6 2.5" item (rebol-view-278-4-3.tar.gz). Click the link to start the download.
In the dialog box that appears, select the "save" option. The file will go to the "Downloads" folder in your home directory.
Locate the rebol-view-278-4-3.tar.tz file and right-click it. In the menu that appears, locate the "extract" option and in the sub-menu, select "Extract Archive Here." The result will be a folder called "releases."
Inside "releases" will be a folder called "rebol-view." Inside that will be an executable called "rebol." Click it.
The REBOL desktop should appear. User the "User" menu option to set up your email address and email server names. If all went well, yoiu should get the message, on the REBOL desktop, that you are connected to the internet. After you set up your email information you should be able to send email with REBOL, unless you are using REBOL at work where there might be some security restrictions.
That first execution created, in the home directory, a folder called ".rebol" (that is, dot-rebol so it is hidden) and in that folder is the "user.r" file where email preferences are stored. Since that folder seems to be in a known location, you can move the rebol executable to some location outside the "Downloads" folder if you want to.
While you can, it seems, now put the "rebol" executable anywhere you like and it will run, in practice you are going to want to run scripts, and it seems that generally it works best if you put your scripts in the same folder as the interpreter. There is just less fussing. So for this example, use the konsole or the file manager, to to the home directory, and make a folder called REBOL (or any name you want). Move the executable out of the download area and into this new folder. Click it to make sure it runs and connects to the internet.
In opensuse you can make a desktop shortcut. If you are using the traditional desktop and not the application launcher, right-click the desktop and select "Create New" "Link to Application."
In the "General" tab, enter a name, maybe "REBOL/View."
In the "Application" tab, in the "Command" field, use the button to browse to the place where you put the "rebol" executable, and select it.
In the "Work path" field, browse to the folder where you put the executable, and select that folder.
Click the "Advanced Options" button. Check the "Run in terminal" box. OK that dialog. OK your way out of the operation. The shortcut should appear on the desktop. Click it to be sure it works.
Right-click the shortcut and select "Properties" in the pop-up menu. Left-click the generic icon in the "General" tab of the properties window. A window of icons should appear. Pick one that you like and OK your way out of that operation.
Run REBOL with your shortcut. Notice that a console window appears along with the REBOL desktop. If you select "Console" on the REBOL desktop, the desktop will disappear and that console window will become the REBOL console. Entering the "desktop" command will bring back the REBOL desktop window.
In the console window, enter the command "what-dir." You will see that the working directory is the place where you put the executable, because you specified that ih the "Work path" when you made the shortcut.
Create the following script and save it in the folder with the REBOL executable. Use any name, perhaps "test1.r."
REBOL [] alert "test1.r executed"Then run REBOL, activate the console ("Console" button on desktop) and type
do %test1.rYou should get an alert box.
Now create this script. Call it "test2.r."
REBOL [] view layout [button [quit]]Run it with
do %test2.rTry closing the window in two ways. Use the "X" in the upper right, and use the button which will execute the "quit" function. Notice that the "X" closes the window but the console remains active, whereas the button quits REBOL completely. This will be useful information in designing your programs.
The above path through things was not the only way and probably not the best way. In Unix-like systems, it seems customary to put executables in the "bin" folder. You could have done that with the REBOL executable. Then when you made the shortcut, you could have specified a different folder for the work path, and that is where you could have put scripts.
If you are just going to run individual scripts, putting things anywhere seems to work. But, if you write scripts that launch others, things get tricky. It seems that when you run REBOL, the directory where it is located becomes its working directory, and if you run some script outside of that, and that script calls some other one, REBOL won't find it. If you are making an application where one script launches another, it might be better to make a copy of the REBOL interpreter and include it with your scripts.
After you have done the above setup, if you use a file manager to go to the folder where put the executable, and you click it, the REBOL desktop will come up just fine, but if you click the "Console" button the desktop will disappear and no console will appear, I don't know why that is.
If you start a terminal window (like konsole) and cd to the folder where you put REBOL, and then run from the command line (dot-slash rebol), the desktop will appear, and when you click the "Console" button the konsole window will become active as the REBOL console.
If you experiment with starting REBOL and get some false starts, depending on what you did, REBOL might still be running even though no desktop or console window is visible. After a session of trying things, run konsole and enter this command:
ps -ef | grep rebolThere is a good chance you will see many instances of rebol. Kill them. If you look at the display, you will see user ID, followed by two numbers. The first is the process ID, and the second is the parent process ID. The first number, the process ID, is used in the command to kill the process. Do the following:
kill (process ID)where (process ID) is that first number. Make sure you get the process number correct so you don't kill something else important.