REBOL.org Scripts Broken?
See update comment at the bottom of this message...
Someone recently contacted me to ask why so many of the scripts at REBOL.org appear to be broken in REBOL/View 1.3.2. I was surprised by the question, and asked for a specific example. They mentioned tile-game.r as a simple case. My reaction was "no way!" It's a simple script. I've run it often. It works fine.
But, then I downloaded the script from REBOL.org, and it did not run fine! It opened a window and closed it immediately. Yes, that looks pretty broken to me too. Not good.
Upon opening the tile-game script in an editor, the problem was immediately apparent. Someone had modified the script to use view/new to open the script's window. The /new prevents the main event loop from running, and the script will immediately exit. (If you look at the same script in the REBOL Viewtop/Games folder, you will find that it works correctly and does not use view/new.)
That's improper REBOL programming. Stand-alone scripts, like those provided as examples in REBOL.org should always work as is. No other programming or mucking around with the script should be required. That's really the main idea behind a script archive like REBOL.org. Beginners need to rely on these archived scripts. Note that if you look at the demos, games, and other examples that are run from the REBOL viewtop, you will find that they all obey this simple rule. They all run as-is, stand-alone.
I've been told that many of the REBOL.org scripts are broken in this same fashion. I have no idea how this happened, but I'm going to find out. I will let you know what I discover.
PS: I've also noticed that a lot of the scripts on REBOL.org have been saved with Unix (LF) line terminators, instead of ANSI standard CRLF terminators. This is a problem, because when users download such scripts and open them with text editors such as Windows Notepad, they see one very long line.
REBOL scripts for general distribution should use CRLF line termination. Of course, this is an easy mistake to make if your server is running Linux/Unix. Users can fix such script line termination easily with this line of REBOL:
write %file.r read %file.r
This will replace the script with one that has proper line terminations for your operating system.
I should note that I'm sure REBOL.org is not alone in this problem. It is likely that other script sites, including REBOL.com and REBOL.net may do the same thing.
Ok, so I received some feedback from various folks regarding the above problems. The answer is, we're not really sure how it happened. It is possible that some of the problem scripts have been that way for a long time. Remember that the origin of some of the rebol.org scripts is from the old reboltech.com library.
But, origins aside, it would be good to get the scripts fixed and working well in the newer versions of REBOL. New users who download scripts want to see them work, otherwise it can be frustrating.
Of course, REBOL.org is a large collection and the task of checking every script is beyond what the friendly volunteers of the site can handle. So, that's where you come in. If you find a broken script, at the very least, let someone know. Send them feedback, so they can add it to their long list. Even better, send them (or the author) a fix. I'm sure it will be appreciated.
Updated 27-May-2023 - Copyright Carl Sassenrath - WWW.REBOL.COM - Edit - Blogger Source Code