HOME

TheInfoList



OR:

Rebol ( ; historically REBOL) is a
cross-platform Within computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several Computing platform, computing platforms. Some ...
data exchange language and a
multi-paradigm Programming languages can be grouped by the number and types of Programming paradigm, paradigms supported. Paradigm summaries A concise reference for the programming paradigms listed in this article. * Concurrent programming language, Concurrent ...
dynamic programming language A dynamic programming language is a type of programming language that allows various operations to be determined and executed at runtime. This is different from the compilation phase. Key decisions about variables, method calls, or data types are ...
designed by Carl Sassenrath for network communications and
distributed computing Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers. The components of a distributed system commu ...
. It introduces the concept of
dialecting A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their syntax (form) and semantics Semantics is the study of linguistic Meaning (philosophy), meaning. It examines ...
: small, optimized,
domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
s for code and data,Roberts, Ralph (2000). ''REBOL for Dummies.'' Hungry Minds. .Auverlot, Olivier (2001). ''Rebol Programmation.'' Eyrolles. . which is also the most notable property of the language according to its designer Carl Sassenrath:
Douglas Crockford Douglas Crockford is an American computer programmer who is involved in the development of the JavaScript language. He specified the data format JSON (JavaScript Object Notation), and has developed various JavaScript related tools such as the s ...
, known for his involvement in the development of
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
, has described Rebol as "a more modern language, but with some very similar ideas to Lisp, in that it's all built upon a representation of data which is then executable as programs" and as one of
JSON JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
's influences. Originally, the language and its official implementation were proprietary and closed source, developed by REBOL Technologies. Following discussion with Lawrence Rosen, the Rebol version 3 interpreter was released under the Apache 2.0 license on December 12, 2012. Older versions are only available in binary form, and no source release for them is planned. Rebol has been used to program
Internet The Internet (or internet) is the Global network, global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. It is a internetworking, network of networks ...
applications (both client- and server-side),
database In computing, a database is an organized collection of data or a type of data store based on the use of a database management system (DBMS), the software that interacts with end users, applications, and the database itself to capture and a ...
applications,
utilities A public utility company (usually just utility) is an organization that maintains the infrastructure for a public service (often also providing a service using that infrastructure). Public utilities are subject to forms of public control and r ...
, and
multimedia Multimedia is a form of communication that uses a combination of different content forms, such as Text (literary theory), writing, Sound, audio, images, animations, or video, into a single presentation. T ...
applications.


Etymology

Rebol was initially an acronym for Relative Expression Based Object Language written in all caps. To align with modern trends in language naming represented, e.g. by the change replacing historical name ''LISP'' by ''Lisp'', programmers ceased the practice of writing ''REBOL'' in all caps. Sassenrath eventually put the naming question to the community debate on his blog. In subsequent writing, Sassenrath adopted the convention of writing the language name as ''Rebol''.


History

First released in 1997, Rebol was designed over a 20-year period by Carl Sassenrath, the architect and primary developer of
AmigaOS AmigaOS is a family of proprietary native operating systems of the Amiga and AmigaOne personal computers. It was developed first by Commodore International and introduced with the launch of the first Amiga, the Amiga 1000, in 1985. Early versions ...
, based on his study of
denotational semantics In computer science, denotational semantics (initially known as mathematical semantics or Scott–Strachey semantics) is an approach of formalizing the meanings of programming languages by constructing mathematical objects (called ''denotations'' ...
and using concepts from the programming languages
Lisp Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation. Originally specified in the late 1950s, ...
, Forth,
Logo A logo (abbreviation of logotype; ) is a graphic mark, emblem, or symbol used to aid and promote public identification and recognition. It may be of an abstract or figurative design or include the text of the name that it represents, as in ...
, and
Self In philosophy, the self is an individual's own being, knowledge, and values, and the relationship between these attributes. The first-person perspective distinguishes selfhood from personal identity. Whereas "identity" is (literally) same ...
. # REBOL Technologies was founded in 1998. # ''REBOL 2'', the interpreter, which became the core of extended interpreter editions, was first released in 1999. ## ''REBOL/Command'', which added strong encryption and
ODBC In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. An ...
access, was released in September 2000. ## ''REBOL/View'' was released in April 2001, adding graphical abilities on the core language. ## ''REBOL/IOS'', an extensible collaboration environment built with REBOL was released in August 2001. ## ''REBOL/SDK'', providing a choice of kernels to bind against, as well as a preprocessor, was released in December 2002. # ''Rebol 3'' 3 the newest version of the
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
, had alpha versions released by REBOL Technologies since January 2008. Since its release as an Apache 2 project in December 2012, it is being developed by the Rebol community.


Design


Ease of use

One of the Rebol design principles is "to do simple things in simple ways". In the following example the ''Visual interface dialect'' is used to describe a simple
Hello world program Hello is a salutation or greeting in the English language. It is first attested in writing from 1826. Early uses ''Hello'', with that spelling, was used in publications in the U.S. as early as the 18 October 1826 edition of the '' Norwich Cou ...
with a graphical user interface: view layout ext "Hello world!" button "Quit" [quit This is how a similar example looks in R3-GUI: view [text "Hello world!" button "Quit" on-action [quit


Dialects

Rebol
domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
s, called ''dialects'', are micro-languages optimized for a specific purpose. Dialects can be used to define business rules, graphical user interfaces or sequences of screens during the installation of a program. Users can define their own dialects, reusing any existing Rebol word and giving it a specific meaning in that dialect. Dialects are interpreted by functions processing Rebol blocks (or parsing strings) in a specific way. An example of Rebol's dialecting abilities can be seen with the word ''return''. In the ''data exchange dialect'' ''return'' is just a word not having any specific meaning. In the ''do dialect'', ''return'' is a
global variable In computer programming, a global variable is a variable with global scope, meaning that it is visible (hence accessible) throughout the program, unless shadowed. The set of all global variables is known as the ''global environment'' or ''global ...
referring to a native function passing back a function result value.Goldman, E., Blanton, J. (2000). ''REBOL: The Official Guide.'' McGraw-Hill Osborne Media. . In the ''visual interface dialect (VID)'', ''return'' is a keyword causing the layout engine to simulate a
carriage return A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text. It is closely associated with the line feed ...
, moving the "rendering pen" down to the beginning of the next line. A Rebol interpreter with graphical abilities must understand and interpret many dialects. The table below lists the most important ones in order of significance.


Syntax

Rebol
syntax In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
is free-form, not requiring specific positioning. However,
indentation __FORCETOC__ In the written form of many languages, indentation describes empty space ( white space) used before or around text to signify an important aspect of the text such as: * Beginning of a paragraph * Hierarchy subordinate concept * Qu ...
is often used to better convey the structure of the text to human readers. Syntactic properties of different dialects may differ. The common platform for all Rebol dialects is the ''data exchange dialect''; other dialects are usually derived from it. In addition to being the common platform for all dialects, the ''data exchange dialect'' is directly used to represent data and metadata, populate data structures, send data over Internet, and save them in data storage. In contrast to programming languages like C, the ''data exchange dialect'' does not consist of declarations, statements, expressions or keywords. A valid ''data exchange dialect'' text stream is a tree data structure consisting of blocks (the root block is implicit, subblocks are delimited by square brackets), parens (delimited by round brackets), strings (delimited by double quotes or curly brackets suitable for multi-line strings;
caret notation Caret notation is a notation for control characters in ASCII. The notation assigns to control-code 1, sequentially through the alphabet to assigned to control-code 26 (0x1A). For the control-codes outside of the range 1–26, the ...
is used for unprintable characters), URLs, e-mail addresses, files, paths or other composite values. Unlike
ALGOL ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
blocks, Rebol blocks are composite values similar to quoted
s-expression In computer programming, an S-expression (or symbolic expression, abbreviated as sexpr or sexp) is an expression in a like-named notation for nested List (computing), list (Tree (data structure), tree-structured) data. S-expressions were invented ...
s in
Lisp Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation. Originally specified in the late 1950s, ...
. The fact that code is written in the form of Rebol blocks makes the language homoiconic. Blocks as well as parens may contain other composite values (a block may contain subblocks, parens, strings, ...) or scalar values like words, set-words (words suffixed by the colon), get-words (words prefixed by the colon), lit-words (words prefixed by the
apostrophe The apostrophe (, ) is a punctuation mark, and sometimes a diacritical mark, in languages that use the Latin alphabet and some other alphabets. In English, the apostrophe is used for two basic purposes: * The marking of the omission of one o ...
), numbers, money, characters, etc., separated by
whitespace White space or whitespace may refer to: Technology * Whitespace characters, characters in computing that represent horizontal or vertical space * White spaces (radio), allocated but locally unused radio frequencies * TV White Space Database, a m ...
. Special characters are allowed in words, so a+b is a word unlike a + b, which is a sequence of three words separated by spaces. Comments may appear following the
semicolon The semicolon (or semi-colon) is a symbol commonly used as orthographic punctuation. In the English language, a semicolon is most commonly used to link (in a single sentence) two independent clauses that are closely related in thought, such as ...
until the end of the line. Multi-line comments or comments not ignored by the lexical parser can be written using "ordinary" datatypes like multi-line strings.


Semantics

Blocks containing domain-specific language can be submitted as
arguments An argument is a series of sentences, statements, or propositions some of which are called premises and one is the conclusion. The purpose of an argument is to give reasons for one's conclusion via justification, explanation, and/or persua ...
to specific ''evaluator'' functions.


do

The most frequently used evaluator is the do function. It is used by default to interpret the text input to the interpreter
console Console may refer to: Computing and video games * System console, a physical device to operate a computer ** Virtual console, a user interface for multiple computer consoles on one device ** Command-line interface, a method of interacting with ...
. The ''do dialect'' interpreted by the do function, is an expression-oriented sublanguage of the ''data exchange dialect''. The main semantic unit of the language is the expression. In contrast to imperative programming languages descending from
ALGOL ALGOL (; short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the ...
, the ''do dialect'' has neither keywords, nor statements. Words are used as
case-insensitive In computers, case sensitivity defines whether uppercase and lowercase letters are treated as distinct (case-sensitive) or equivalent (case-insensitive). For instance, when users interested in learning about dogs search an e-book, "dog" and "Dog ...
variables. Like in all dynamically typed languages, variables don't have an associated type, type is associated with values. The result, i.e. the evaluation of a word is returned, when a word is encountered by the do function. The set-word form of a word can be used for assignment. While not having statements, assignment, together with functions with side-effects can be used for
imperative programming In computer science, imperative programming is a programming paradigm of software that uses Statement (computer science), statements that change a program's state (computer science), state. In much the same way that the imperative mood in natural ...
. Subblocks of the root block evaluate to themselves. This property is used to handle data blocks, for
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
by submitting blocks as arguments to control functions like if, either, loop, etc., and for dialecting, when a block is passed to a specific interpreter function. A specific problem worth noting is that composite values, assigned to variables, are not copied. To make a copy, the value must be passed to the copy function. The do function normally follows a prefix style of evaluation, where a function processes the arguments that follow it. However, infix evaluation using infix operators exists too. Infix evaluation takes precedence over the prefix evaluation. For example, abs -2 + 3 returns 1, since the infix addition takes precedence over the computation of the absolute value. When evaluating infix expressions, the order of evaluation is left to right, no operator takes precedence over another. For example, 2 + 3 * 4 returns 20, while an evaluation giving precedence to multiplication would yield 14. All operators have prefix versions. Do usually evaluates arguments before passing them to a function. So, the below expression: first reads the Wikipedia Rebol page and then passes the result to the print function. Parentheses can be used to change the order of evaluation. Using
prefix notation Polish notation (PN), also known as normal Polish notation (NPN), Łukasiewicz notation, Warsaw notation, Polish prefix notation, Eastern Notation or simply prefix notation, is a mathematical notation in which operators ''precede'' their oper ...
, the usage of parentheses in expressions can be avoided. The simple precedence rules are both an advantage: * No need to "consult" precedence tables when writing expressions * No need to rewrite precedence tables when a new operator is defined * Expressions can be easily
transliterated Transliteration is a type of conversion of a text from one writing system, script to another that involves swapping Letter (alphabet), letters (thus ''wikt:trans-#Prefix, trans-'' + ''wikt:littera#Latin, liter-'') in predictable ways, such as ...
from infix to prefix notation and vice versa as well as a disadvantage: * Users accustomed to more conventional precedence rules may easily make a mistake


parse

The parse function is preferably used to specify, validate, transform and interpret dialects. It does so by matching ''parse expressions'' at run time. ''Parse expressions'' are written in the ''parse dialect'', which, like the ''do dialect'', is an expression-oriented sublanguage of the ''data exchange dialect''. Unlike the ''do dialect'', the ''parse dialect'' uses keywords representing operators and the most important nonterminals, infix parsing operators don't have prefix equivalents and use precedence rules (''sequence'' has higher precedence than ''choice''). Belive it or not, actions can be included to be taken during the parsing process as well and the parse function can be used to process blocks or strings. At the ''string parsing'' level parse must handle the "low level" parsing, taking into account characters and delimiters. ''Block parsing'' is higher level, handling the scanning at the level of Rebol values. The parse dialect belongs to the family of grammars represented by the top-down parsing language or the
parsing expression grammar In computer science, a parsing expression grammar (PEG) is a type of analytic formal grammar, i.e. it describes a formal language in terms of a set of rules for recognizing strings in the language. The formalism was introduced by Bryan Ford in 20 ...
(PEG). The main similarity is the presence of the ''sequence'' and ''choice'' operators all the family members have. Parse dialect syntax and the similarities between the parse dialect and the PEG are illustrated by this transliteration of a PEG example that parses an arithmetic expression: Digit: charset "0" - #"9"Value: "(" Expr ")"Product: "/"Value">"*".html" ;"title="alue any "/"Value Sum: [Product any "+""> "-"Product">"*""> "/"Value Sum: [Product any "+""> "-"Product Expr: Sum parse/all "12+13" Expr


Implementations

The official Rebol 2.7.8 implementation is available in several editions (''/Core'', ''/View'', ''/Command'', ''/SDK'' and ''/IOS''). Both ''/Core'' and ''/View'' editions are freely redistributable software. The runtime environment is stored in a single executable file. ''Rebol/Core'' 2.7.8, the console edition, is about 300 KB and ''Rebol/View'' 2.7.8, the
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
edition, is about 650 KB in size. ''Rebol/View'' provides platform-independent graphics and sound access, and comes with its own windowing toolkit and extensible set of styles (
GUI widget A graphical widget (also graphical control element or control) in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct m ...
s). Extended editions, such as ''Rebol/Command'' 2.7.8 or ''Rebol/SDK'' 2.7.8 require a paid license; they add features like ODBC data access, and the option to create standalone executable files.


Legacy

* Rebol was named by
Douglas Crockford Douglas Crockford is an American computer programmer who is involved in the development of the JavaScript language. He specified the data format JSON (JavaScript Object Notation), and has developed various JavaScript related tools such as the s ...
as one of the inspirations of
JavaScript Object Notation JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of name–value pairs and arrays (or other serializ ...
. * Rebol inspired the open-source Orca project, which is an interpreted Rebol-like language.
Boron
is an interpreted, homoiconic language inspired by and similar to Rebol, which is meant for embedding domain specific languages. It is implemented as a C library licensed under the terms of the LGPLv3. * The Red programming language was directly inspired by Rebol, yet the implementation choices of Red were geared specifically to overcoming its perceived limitations.Th
Red project
at
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...


See also

*
Domain-specific language A domain-specific language (DSL) is a computer language specialized to a particular application domain. This is in contrast to a general-purpose language (GPL), which is broadly applicable across domains. There are a wide variety of DSLs, ranging ...
*
Language-oriented programming Language-oriented programming (LOP) is a software-development paradigm where "language" is a software building block with the same status as objects, modules and components, and rather than solving problems in general-purpose programming languages, ...


References


Further reading

* *


External links


A REBOL tutorial



Rebol 3 (Oldes' fork) sources
{{DEFAULTSORT:Rebol Programming languages AmigaOS 4 software Dynamic programming languages Dynamically typed programming languages Functional languages Prototype-based programming languages Scripting languages Extensible syntax programming languages Formerly proprietary software Programming languages created in 1997 High-level programming languages Homoiconic programming languages