Home   Archive   Permalink



Little tutorial for newbies

I notice that most people starting with programming get lost in the basics of understanding variables, functions, conditional evaluations, lists, loops, objects, user interface components, and other basic ideas like concatenation, saving data to some form of persistent storage, or even just setting up a working environment and running code.
    
I put together the tutorial below with the idea of getting people to understand all the basic concepts, not just in Rebol, but with an eye towards using any other development tools too. Because Rebol is so easy to get started with, the tutorial focuses on getting a few basic types of apps actually created (CRUD, graphics, and CGI), using the basic building blocks in all sorts of coding environments. Along the way it demonstrates a bit more about how things like dialects and other features of Rebol relate to common concepts like functions, objects, and variables, and how Rebol makes not just basic things simple, but also simplifies potentially much more complicated goals. For people just starting out with coding, it should help to clarify not just how to do things with Rebol code, but also generally "how programmers think". Hopefully, it will be a productive entry point for some new users who are experiencing the common sticking points of getting started coding, and also nice comparison between Rebol and other mainstream tools:
    
http://re-bol.com/starting_computer_programming_with_rebol.html

posted by:   Nick     8-Jan-2014/10:33:03-8:00



This one is meant to be a really quick read, consumable in one sitting. The fast pace is intended to get users through all the concepts without too much detail, so that a functional overview, and some encouraging practical understanding can be achieved quickly.

posted by:   Nick     9-Jan-2014/8:14:07-8:00



I updated the text today with a bunch of my existing little example programs, simplified and explained in the context of this tutorial. I think it should still take an hour or less to read (38 printed pages).

posted by:   Nick     9-Jan-2014/14:53:09-8:00



Aside from the basic concepts and code examples, the tutorial covers these 14 little app examples:
    
Tiny Text Editor
GUI Contacts App
Tip Calculator
Tile Game
Generic Calculator
Tiny Etch a Painting App
Image Slideshow
Bar Chart
Tric Trac Game
Calendar
Generic CGI App, With HTML Form
CGI Photo Album
CGI Text Chat
A Generic Drop Down List CGI App

posted by:   Nick     9-Jan-2014/15:07:43-8:00



I added a bunch more fully documented app examples today (all taken from older tutorials):
    
Days Between 2 Dates
Image Effects
Send Emails
Paypal Report
Shopping List and To-Do List
Marching Alien Logo Army
    
These app examples are included too, without additional documentation:
    
Web Page Editor
Math Test
Compliment Generator
FTP Tool
Simple Full Screen Presentation
Minimal Cash Register and Daily Sales Total Report
Group Chat (Console)
Group Chat (GUI)

posted by:   Nick     10-Jan-2014/14:09:10-8:00



I made some final edits to this text tonight. This should be the last version, until I get a chance to make an R3 version.

posted by:   Nick     10-Jan-2014/23:15:31-8:00



Hmm, guess I lied - I cleaned up a few sections this morning.
    
This is quickly becoming my favorite text. It covers not only enough practical Rebol code to thoroughly understand 20 varied apps, it also covers all the basic programming concepts which absolutely new coders need to know to start building useful programs, in about an hour. It shows off Rebol's ability to dramatically simplify common goals, with enough general context to compare how similar ideas are handled in other languages and tool sets. In 46 pages, it provides a real basis to understand all the general fundamental concepts of writing code, to actually creating a bunch of useful apps with Rebol.
    
I've always thought that a big untapped market for Rebol could be found among "non-programmers", and I think this sort of fast lane approach to doing real practical work with Rebol is a great way to attract more of that potential crowd. I think that most people with a casual passing interest in "programming" will devote an hour of their life to learning a little. With most other tools and texts, after an hour, students are left mystified and/or overwhelmed about how difficult writing code is, and they abandon the idea. On the other hand, if they leave with a complete understanding of how easy it is to create a variety of actually useful and interesting apps, they're much more likely to pursue the goal further. If there's no other intro available which teaches those casually interested candidates to do so much, so quickly, then Rebol has a special chance at attracting that community (some of whom will go on to contribute tools...)

posted by:   Nick     11-Jan-2014/10:58:51-8:00



I just fond this posting, you seem to very active in Rebol. I am an on again off again hobby programmer, took some lesson years ago, and made progress, but it just seems to take way to much time to learn the syntax of a language to make it into anything worth doing. I have dabbled in c, C++, python and javascript (which I am thinking about starting up again) but came across Rebol and though , man that is what I need a language I can walk away from for a week or two and come back , feeling like I can pick it back up...that is my big problem, I leave for a while and come back and have to relearn from about scratch. One thing that worries me about Rebol is the lack of a following, mean it may just dry up and go away...what is you opinion on this.
sign: Ron blister@ymail.com

posted by:   ron     11-Jan-2014/18:19:59-8:00



Rebol had a heyday around 2004, and then lost most of its community about 5 years ago, when Rebol's creator Carl Sassenrath completely disappeared and abandoned supporting Rebol for more than a year. At that time, the only available version of Rebol was a closed source commercial product which absolutely required Carl's presence. Professional developers weren't going to base their livelihoods on a closed source development tool which had no reliable support, so only a small community continued to work with Rebol.
    
Then, about a year ago Carl released Rebol version 3 as an open source project, and interest in Rebol spiked. R3 was not as mature - actually not even fully operational - it didn't even have a working GUI dialect at the time. But a group called Saphirion, and in particular one capable developer named Cyphre, has been working on it, releasing a version for Android with GUI and graphic support, and the community has seen some growth. New 32 and 64 bit versions of R3 for Linux are being developed and used commercially by a company named Atronix, and they are working with Saphirion to release versions for the community.
    
A new open source project called Red has also been built by another of the community's most talented developers Nenad Rakocevic ("Doc Kimbel"). Doc has been working on Red full time for more than 2 years (even before the release of R3), and its future looks extremely encouraging. Red is still in an alpha state, but its features and capabilities will likely outpace those of R3 sometime this year. Red is a compiler (as opposed to an interpreter like R3), so it's performance will be suitable for work beyond the scope which Rebol was designed to handle.
    
I'm also talking with the guys at Saphirion right now about funding a port of R3 to Javascript. If that project gets completed the way I hope, Rebol will be usable as a web development tool in the browser (so that the whole mess of HTML, CSS, Javascript and all related tools can be dealt with at at much higher level, much more productively, entirely using Rebol code).
    
The number of visitors to my Rebol web sites has nearly tripled during the last year, so I expect that the community is growing. It will likely take a while for new developers to catch on and start using it for commercial work, contributing useful tools to R3 and Red, but that is already happening (there was an interesting 3D demo for Red released this week). And now that R3 and Red are entirely open source, with practical licenses (Apache II for R3 and BSD for Red), I doubt it will ever dry up and go away.
    
Either way, I don't think there's any harm in studying Rebol. At very least, for simple projects, it's a amazingly simple and productive tool, and for those who enjoy studying language tools, it's a truly unique and brilliantly designed/realized concept, unlike anything else out there. You can accomplish a lot of practical work with Rebol, even as it exists at the moment, and for situations where it doesn't fit, you can always choose to use a different tool - that kind of choice applies to any development tool. Learn Rebol and use it where you can. You can always start learning Java and the whole mess of other mainstream tools, in addition to Rebol. Most developers have to come in contact with Java, C, C++, C#, Visual Basic, PHP, Python, Ruby, SQL, and HTML5 (HTML + CSS + Javascript), etc., at some point anyways. Once you've been around the block a few times, you'll likely enjoy using Rebol whenever possible :)

posted by:   Nick     12-Jan-2014/3:51:30-8:00



I came across a book on Rebol in the library of my university, and were fanscinated by it. I had worked with Perl for a while, and learnt the basics of C, Basic and a few other languages. But Rebol is different, it is amazingly simple to use and easy to learn. A few lines will be sufficient for almost anything I need. So I decided that I should learn it, no matter how busy I am with my work. But I soon became disappointed: no body around me seemed to know this language even if they were quite experienced programmers. I found no tutorial to follow and most online forums were dead long before. I wondered whether I should give it up.
I have looked for a while and found this forum. Since then, I come to visit almost daily, to see the new posts and to ask questions that trouble me. To my great pleasure, there are always new posts, and all my questions got answered soon. I then decide I should stick to this language.
I followed some of the tutorials by Nick, and found them handy and easy to follow. Right now I am still a newbie, but I hope one day I can make some nice softwares which can facilitate my work.
By the way, I think that it is vital for a language community to have a few open source projects which can fulfill the needs of some specific professions. For instance, there are some good toolkits for my field in Java, so learning Java became extremely inviting for me and my colleagues. This is where Rebol is extremely good at: its ability with dialects makes it easy to create mini-languages for those fields. I think this WILL make Rebol more and more popular.


posted by:   Rex     12-Jan-2014/7:10:51-8:00



Feel free to post specific questions about the work you're interested in accomplishing. I'll help as much as possible whenever I have time. If you want personalized lessons or in-depth help writing any code, I do private instruction and coding by the hour (and I do my best to keep it inexpensive :)

posted by:   Nick     12-Jan-2014/11:16:19-8:00



Thanks Nick, I wish I could attend your lessons, but I am on the other side of the Pacific :p

posted by:   Rex     12-Jan-2014/20:27:49-8:00



ty for all the input and background on the language Rebol. I am more than a bit impressed with the response I got from my simple inquiry , which leads me to believe at this point , at least here in this forum it is a well supported Rebol community, though small it is active, which is fine , small is sometimes much better than large, in attention.
    
post specific questions about the work you're interested in >>> I will try and explain.
    
1)I want to make a website that is more functional than some info ad, or blog. I want to add forms for me, and email forms out to another, drop info into a form from a drop down menu. I want to be be able to draw info from a email, drop it in a form sort it , key on certain info and list it. I want to make it accessible from anywhere, securely.
    
2) I want to make scripts that execute software on my computer the way I want it done, reported and sorted the way I want it done, monitor ports, and buses the way I want it done, sorta like Linux does with all the crons and bash scripting, but do it in windows 8 . I once done something of its like in VB script, but again, I do not want to learn 10 different languages to do 10 different things. beside the VB things was a cut and paste someone else work , I want to be able to do it and do it with a nice GUI that I wrote.
    
3)my final goal to this is to be proficient and like the language I am working with. Comfortable is a good word, so I move forward into an area of programming I hope to accomplish before I am to old to do it, and that is robotic programming. I would like to take a basic input and output control chip and write code for it to make it do functions I programmed into it, this is my final and long term goal. This may never happen but that is what the final golden fleece in the end. I am halve way though my term here in life so , it may never happen before my term is up, but one can dream.        
    
lets start with my site first...lol I just downloaded the Rebol inter and put the Linux version of Rebol in the CGI area of my new web site (x10hosting.com, is the provider) then I loaded the pc version for testing and that is as far as I got, I could not get the NOW.TXT file to work at all on the my PC, so I will pick it up and try again tomorrow. My goal here is just to see if I can make it work on my pc and then on the web site.
    


posted by:   ron     12-Jan-2014/20:51:50-8:00



hey Rex > everyone in the computer world has skype, or something like it, the world is a small place now days.

posted by:   ron     12-Jan-2014/20:56:38-8:00



1.Click the Rebol program icon (found by default on your desktop, or in Start -> Programs -> Rebol)
2.Click the "Console" button in the Rebol program.
3.Type or paste your code (text) at the flashing command prompt.
    
...this did not work, does this program not work windows 8 ... first I get this from the exe:
    
REBOL/Core 2.7.8.3.1 (1-Jan-2011)
Copyright 2011 REBOL Technologies
REBOL is a Trademark of REBOL Technologies
All rights reserved.
    
Finger protocol loaded
Whois protocol loaded
Daytime protocol loaded
SMTP protocol loaded
ESMTP protocol loaded
POP protocol loaded
IMAP protocol loaded
HTTP protocol loaded
FTP protocol loaded
NNTP protocol loaded
>>
    
I then type in code and get errors.
    
>> alert "Hello World"
** Script Error: alert has no value
** Near: alert "Hello World"
>>
    
I then tried the editor none ...
    
>> editor none
** Script Error: editor has no value
** Near: editor none
>>
    
I must be missing something simple, so starts my first question, what am I doing wrong?

posted by:   ron     12-Jan-2014/23:06:58-8:00



Ron,
    
You're running the Rebol/Core version. It doesn't have many of the features you want for Desktop application development (graphics, GUI, sound, etc.). Be sure to download the Rebol/View version from:
    
     http://www.rebol.com/download-view.html
    
Right click and "Run as Administrator" to install.

posted by:   Nick     12-Jan-2014/23:12:14-8:00



ahh , that would explain it, I thought it would work just like the python inter and it does. I just loaded it and it works fine. Now to start learning the language...thanks.
    
By the way Nick do you have Skype or something like it?

posted by:   ron     13-Jan-2014/7:00:01-8:00



Yep, I do lessons with videoconferencing and shared desktop.

posted by:   Nick     13-Jan-2014/9:02:33-8:00



You can reach me at reverse decompress #{
789CCBCD4FD64B2D292DD0CDCD4F76C8CBCC4D4954B0CAC94CCC4D555048CDCB
CC4B2DCB4C0312A9C51599C5F945A955A9A94519254036483C352F3FBFBC44C1
0A4867140000ED6D1C3248000000
}

posted by:   Nick     13-Jan-2014/19:40:58-8:00



Ron,
    
If you're having trouble getting Rebol CGI set up on Windows, download this:
    
http://sourceforge.net/projects/makedocsitebuilder
    
It's got an Apache server with Rebol CGI all set up and ready to go.

posted by:   Nick     13-Jan-2014/19:50:33-8:00



great I will do that, I have not yet tested the CGI but this should be a fail safe way of making sure I get things working...ty again...
    


posted by:   ron     15-Jan-2014/7:24:04-8:00



Notice that the program above creates a C:\sitebuilder\ folder. Use the server_start.bat and server_stop.bat files in that folder to start and stop the Apache server.    
    
You can check the C:\sitebuilder\udrive\public_html\ folder for an example of a working CGI example. That's the folder where you'll put your scripts. Here's a basic boiler plate for getting CGI scripts running in Rebol:
    
#!/usr/bin/rebol.exe -cs
R E B O L []
print "content-type: text/html^/"
submitted: decode-cgi read-cgi
    
If you don't know how to use that, the tutorial at http://business-programming.com explains it, and there's another at http://re-bol.com/cgi_tutorial.txt

posted by:   Nick     15-Jan-2014/12:02:12-8:00