REBOL - the Relative Expression-Based Object Language
See http://www.rebol.com/ http://reboltutorial.com
Quoting the home page (http://www.rebol.com/rebol-intro.html):
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 (http://www.rebol.com/rebolsteps.html) 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. -- MichaelHill
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. -- SimonMichael
[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. -- CliffordAdams (generally a fan of LittleLanguages)
Sadly there is no FreeReferenceImplementation.
We've used it to write a DomainSpecificLanguage that compiles into XML.
Example Script: create Vendor IBM id 'IBM' salesperson 'S1' discount10.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>-- DavidVydra
There is a wiki written in Rebol called VaNilla 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.
-- AndrewMartin
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" EssExpressions.
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 http://www.vsf.cape.com/~emergent/sherman.htm. 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: http://web.archive.org/web/20000412131326/http://www.vsf.cape.com/~emergent/sherman.htm
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:
http://home.comcast.net/~prunesquallor/random/sherman.zip
...hmmm...the site is live (and mostly contains Lisp code by Marshall), but that particular link isn't working today (2004apr24)
Hmmm - Google finds http://members.core.com/~bhawley/rebol/Sherman.zip, which is live.
It's not clear what that is, though; it contains a .EXE, not source code. Anyone try it? AnswerMe
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: http://ll1.ai.mit.edu/marshall.html
Marshall also criticizes some of the Rebol 2.0 decisions (e.g. removing continuations): http://www.compkarori.com/vanilla/display/Continuations+Rebuttal
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: http://www.ai.mit.edu/~gregs/ll1-discuss-archive-html/msg03917.html
There's a Rebol clone called: R# or RebolSharp?. There's more details on SourceForge at: http://sourceforge.net/projects/r-sharp. It features GNU General Public License. -- AndrewMartin
Does Rebol fall into the category of HomoiconicLanguages? It seems to, but I can't quite tell from the descriptions given.
Yes
Rebol is a great language, no doubt, but WhyIsntRebolPopular?
CategoryProgrammingLanguage MinimalistLanguage PrototypeBasedProgramming