REBOL

From Bauman National Library
This page was last modified on 8 June 2016, at 19:00.
Rebol
File:Rebol logo.png
Paradigm language oriented programming, data exchange, functional, prototype-based, imperative
Designed by Carl Sassenrath
Developer REBOL Technologies
Typing discipline dynamic, strong
License 2.7.8 is Freely redistributable software,[1] 2.101.0 has Apache 2.0 license[2]
Filename extensions .r, .reb[3]
Website www.rebol.com
Influenced
JSON,[4] Red

Rebol (Relative Expression-Based Object Language) is the work of Carl Sassenrath who was one of the main creators of the esteemed AmigaOS operating system. In 1995, he decided to work on a new programming language and his efforts came to fruition in 1997 with version 1.0 of Rebol. Carl’s objective was to design a language that is simple to learn, multiplatform and fully adapted to the exchange of information between heterogeneous systems. As such the language is highly capable in the field of network programming. It supports the major network protocols and allows easy handling of sockets. Rebol is an ambitious concept realised in a range of products.

A virtual machine

The evaluator is actually a virtual machine which simulates an identical environment regardless of the underlying operating system and hardware architecture. Unlike Java, it is very light weighing in at between 250 and 400 KB depending on the version. It is also very easy to install because it consists of a single executable. No! you are not dreaming, the Rebol virtual machine is entirely contained in a single file. There are no DLLs or libraries to install whatever the operating system. In a few seconds, it is possible to transform any computer into a machine capable of using your applications written in Rebol. This virtual machine contains the Rebol evaluator, the standard dictionary, TCP/IP support, a garbage collector and security manager.

A family of products

Rebol comes in six versions aimed at different audiences and also targeting different application areas.

Rebol/Core

Rebol/Core is the foundation. This compact evaluator, of around 350 KB, contains the heart of the language. It includes the evaluator, the garbage collector, the security manager, network protocols and the words in the Rebol dictionary. Distributed under a “freeware” licence, this product can be freely downloaded from rebol.com for many operating systems and can be freely used in commercial products. Rebol/Core is not a demonstration version or limited product. It is the perfect tool for developing applications to exchange information, write CGI or system administration scripts.

Rebol/View

Rebol/View is an overlay on top of Rebol/Core which adds the ability to develop graphic applications. Since version 1.3, Rebol/View uses the very powerful AGG graphics library as its display engine. It’s possibilities are impressive since AGG provides advanced graphics primitives, excellent display speed, anti-aliasing management, vector fonts and incredible effects which can be applied in real-time (rotation, perspective, size, transparency, colour processing, etc.). For building user interfaces, Rebol/View incorporates VID (Visual Interface Dialect) allowing the definition of screens with a minimum of instructions. The main user interface components are included as standard (button, input field, slider, image, progress bar, etc.). You can also change their appearance by using a style sheet and even create your own components. VID is a dialect which allows the flexible implementation of complex graphical interfaces on multiple platforms. All this takes place in a single executable file that is only a few hundred KB in size. Rebol/View is also free and can be redistributed without constraint. A commercial version called Rebol/View/Pro is also available and adds to the evaluator a group of encryption functions (DES, RSA, DH and electronic signature management) and also support for the HTTPS protocol.

Rebol/Command

For e-business applications, you can use a commercial product called Rebol/Command. This version is also available for multiple operating systems and provides encryption functions, the HTTPS protocol, and access to ODBC data sources and the MySQL and Oracle databases. Rebol/Command is perfectly adapted for the development of complex dynamic web sites and thanks to its native FastCGI support, it allows the establishment of high-performance applications that can be distributed across multiple servers using a n-tier architecture.

Rebol/SDK

Rebol/SDK is a development kit allowing the generation of executable files from a Rebol script. With the SDK, it becomes possible to distribute an application written in Rebol without the user having to install Rebol/Core, Rebol/View or Rebol/Command. One feature of the SDK is that it uses an encryption algorithm to conceal the source code of the Rebol script. Thus making it possible to distribute a commercial application containing proprietary technology.

Rebol/IOS

Finally, if you want to set up an intranet with a high degree of security and in which a community of users can share information, applications and data files, you can use the Rebol/IOS groupware platform. This is composed of two elements which are the server, Rebol/Serve, and the Rebol/Link multiplatform client. Rebol/IOS not only comes with a large number of applications ready for use (task management, phone book, news publication, administration tools, etc.) but also includes a development kit which allows custom applications to be written.

Simple code example

Now going to write a short Rebol program and, in this case, we’ll start with a simple game. It is a matter of guessing a number selected by the computer. The game guides us by indicating if our guess is higher or lower than the secret figure. The logic consists of two embedded loops which respectively execute the code indefinitely and ask the player to guess until he finds the correct number. Once the guess is correct, the boolean end takes the value true, which stops the execution of the loop defined by the word until. The secret number is obtained from the word random followed by a maximum value. In our case, the figure lies between 0 and 100. We also have a counter, initialised to 0 at the start of an attempt, which indicates how many guesses the player took to win. It is incremented by 1 for each guess.

REBOL []
forever [
    value: random 100
    counter: 0
    end: false
    print "NEW GAME"
    until [
        nbr: to-integer ask "Your figure ?"
        counter: counter + 1
        either (nbr <> value) [
            either (nbr < value) [
                print "Too small !"
            ] [ print "Too big !" ]
        ] [
            print [ "Won in " counter " tries" ]
            end: true
        ]
        end
    ]
]
;; Note press the escape key to finish playing

External links

References

  1. REBOL Technologies. The REBOL/View and REBOL/Core 2.7.8 license
  2. R3 source at GitHub
  3. "Carl's REBOL Blog - Let's switch to .reb suffix". Rebol.com. August 18, 2013. Retrieved January 23, 2014. 
  4. Crockford, Douglas. The JSON Saga, jsonsaga.ppt