Rebol Language

REBOL - the Relative Expression-Based Object Language

Quoting the home page (www.rebol.com ):

REBOL is a messaging language for distributed Internet applications that run across all devices.

REBOL was designed over a 20 year period by Carl Sassenrath, the system architect responsible for the world's first multitasking multimedia operating system, the Commodore Amiga Os. The first implementation of REBOL (pronounced like "rebel yell") was released in 1997 to a small group of users running on three operating systems, and today REBOL has grown to reach more than 1,000,000 users running on more than 40 OS platforms.


average:
function [block] [total] [

total:
0

foreach number block [total:
number + total]

total / (length? block) ] print average [1 10 12.34]

7.78

Here is another version, which defines average as a "refinement" of a sum function ("either" is basically a prefix ?: operator):

sum:
func [nums [block!] /average /local total] [

total:
0

foreach num nums [total:
total + num]

either average [total / (length? nums)][total] ] print sum [123 321 456 800]

1700

print sum/average [123 321 456 800]

425

Here is an object definition with sample uses:

account:
make object! [

balance:
0

deposit:
func [amount] [balance: balance + amount]

withdraw:
func [amount] [balance: balance - amount]

]

account/deposit 1000

my-account:
make account [balance: 400]

See the "REBOL in Ten Steps" page (www.rebol.com ) for more examples.


A fascinating idea. I downloaded it last night and spent some time with the docs. Folks, even if you have no interest in language development not backed by the majors, you should go check this link out. -- Michael Hill


Rebol - Squeak. Squeak - Rebol. Hmm.. whenever I use one I think of the other. Rebol is young and very compact. Squeak is large but it does the whole object thing, which Rebol seems to think is not worth the trouble. I wonder how the forthcoming Rebol/Media (GUI support) will compare to Squeak's Morphic system. I wonder how Rebol can do GUIs at all without an object-based system. I look forward to being edified.

[Note from an infrequent reader of this page: Rebol does have object-like structures; it's just that they aren't nearly as pervasive as in Smalltalk. The OOP features of J are similar.]

REBOL uses a prototype based object system, like Self.


Rebol tries to solve many problems by adding more "value" datatypes to the language. Datatypes provide a non-extensible (?) set of core objects. Here are the different kinds of value datatypes (from the REBOL Dictionary for 2.1.92.3.1):

binary bitset block char date decimal email file get-word hash integer issue list lit-word logic money none paren path refinement set-path set-word string tag time tuple url word

Each of these values has separate commands for conversion (like to-binary), checking the type of a value (binary?), and another word to describe the datatype (binary!).

There appear to be more kinds of values - the values above are simply the ones which have a "to-typename" command. Some of the others are: datatype, port, object, function, series, error, and native.


Rebol makes Perl seem clean and orthogonal. It contains many interesting ideas (especially the object construction without separate "classes"), but the structure ... they should have stopped with the kitchen sink. The sad thing is that with a little more consistency, the language could have been much smaller and more powerful. Still, the quick "Ten Steps" guide is worth reading for a different perspective. -- Clifford Adams (generally a fan of Little Languages)

Sadly there is no Free Reference Implementation.


We've used it to write a Domain Specific Language that compiles into XML.

Example Script:

create Vendor IBM id 'IBM' salesperson 'S1' discount 10.0

Translates Into: <script> <create domain='Vendor', id='IBM'> <field name='id'>IBM</field> <field name='salesperson'>S1</field> <field name='discount'>10.0</field> </create> </script>


There is a wiki written in Rebol called Va Nilla which illustrates some of its features as a language (Networking, Parsing, etc).


I've written up a HTML/XML/WML dialect in Rebol, that allows me to write __ML without needing to worry about closing tags. For example, a part of my site creation code is:

html [

head [ title (Title) meta/http-equiv/content "Refresh" ( rejoin [ mold Refresh/second "; URL=" Destination ] ) link/rel/type/href "stylesheet" "text/css" %Index.css script/type/language/src "text/javascript" "JavaScript" %FrameBurster.js "" ] ]

which generates HTML according to the words and paths used.

Also, written up a plain text to ML dialect, so I don't have to bother with HTML. And a site creation dialect which uses files and directories to create a basic web site.


You can do just the same with the various LISPs, in a very similar fashion. It is well-known that XML et. al are just "too verbose" Ess Expressions.

REBOL's approach is quite different from using Lisp macros. There's a function called PARSE, that allows you to use a pseudo-BNF dialect to define your own dialects.


In fact there are many other REBOL-based tools that support this small community. One of them called REBOL/IOS contains many small apps (called REBlets) that enable the members of this closed community (you have to request a free password to become eventually eligible as a new member).

The community members exchange almost everything related to a conversation going from text messages, to emails with attached files and web links, but no sound or video can travel directly on screens without external help from Web browsers or other tools.

All of the common activities take place in a central room hosted on a foreign (or local) server and every client has its own -automatically synchronized - copy of everything that resides on the server. The client part of the set-up is called the DESKTOP and from this start-up point users can do almost everything other user communities do which normally requires them to use many of the common required client tools to do so like EMAIL, INSTANT MESSENGER, FORUM and CHAT - in fact the one that REBOL/IOS offers is a persistent one (Called the CONFERENCE REBlet) and every message can even be received and consulted while OFF-LINE - a not so common tool to find in fact.

So all of these tools are glued around the small DESKTOP client app. and everything can be shared from a single place. To work into this environment is like having a warm summer breeze coming during a very cold winter. We just continue to live in a better environment while we look at others trying to do their best with some tools that sometimes would have to be rethinked! The Wiki concept is an exception to these other tools and is a class by itself, like REBOL/IOS.

-- Gerard Cote


There used to be a Rebol clone called Sherman available at www.vsf.cape.com . Does anybody know if it is still around? My google searches to date only seem to turn up links to this same page.

archive.org has this as the last updated content: web.archive.org

Please do not delete the above archive.org link, but here is Joe Marshall's current web site's copy of Sherman, which is a Rebol to Scheme translator:

...hmmm...the site is live (and mostly contains Lisp code by Marshall), but that particular link isn't working today (2004apr24)

Hmmm - Google finds members.core.com , which is live.

It's not clear what that is, though; it contains a .EXE, not source code. Anyone try it? Answer Me

Note: Joe Marshall was co-author of the Rebol 1.0 interpreter at Rebol Technology, and wrote sherman after leaving RT.

He gave a talk about Rebol at the first Little Language conference: ll1.ai.mit.edu

Marshall also criticizes some of the Rebol 2.0 decisions (e.g. removing continuations): www.compkarori.com

Elsewhere he mentions that a Rebol program with N tokens has N! possible parses, making parsing rather harder than is typical for computer languages. See this thread: www.ai.mit.edu


There's a Rebol clone called: R# or Rebol Sharp. There's more details on Source Forge at: sourceforge.net . It features GNU General Public License.


Does Rebol fall into the category of Homoiconic Languages? It seems to, but I can't quite tell from the descriptions given.

Yes


Rebol is a great language, no doubt, but Why Isnt Rebol Popular?


See original on c2.com