Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Rebol
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Programming language designed by Carl Sassenrath}} {{Use mdy dates|date=December 2014}} {{Infobox programming language | name = Rebol | logo = [[File:Rebol logo.png]] | paradigm = [[language oriented programming]], [[Data exchange language|data exchange]], [[functional programming|functional]], [[prototype-based programming|prototype-based]], [[imperative programming|imperative]] <!-- ordered by prominence--> | year = {{Start date and age|1997}} | designer = [[Carl Sassenrath]] | developer = REBOL Technologies | latest_release_version = 2.7.8 | latest_release_date = {{Start date and age|2011|01}} | latest_test_version = 2.101.0 | latest_test_date = {{Start date and age|2012|12}} | typing = [[dynamic typing|dynamic]], [[strong typing|strong]] | license = 2.7.8 is [[Freely redistributable software]],<ref name="lic">REBOL Technologies. ''The REBOL/View and REBOL/Core 2.7.8 [http://www.rebol.com/license.html license]''</ref> 2.101.0 has [[Apache License|Apache 2.0 license]]<ref name="r3src">[https://github.com/rebol/r3 R3 source] at [[GitHub]]</ref> | file ext = .r, .reb<ref>{{cite web|url=http://www.rebol.com/article/0540.html |title=Carl's REBOL Blog - Let's switch to .reb suffix |publisher=Rebol.com |date=August 18, 2013 |access-date=January 23, 2014}}</ref> | influenced_by = [[Self (programming language)|Self]], [[Forth (programming language)|Forth]], [[Lisp (programming language)|Lisp]], [[Logo (programming language)|Logo]]<ref name="OG" /> | influenced = [[JSON]],<ref name="JSON">[[Douglas Crockford|Crockford, Douglas]]. ''[https://www.youtube.com/watch?v=-C-JoyNuQJs The JSON Saga]'', [http://crockford.com/codecamp/jsonsaga.ppt jsonsaga.ppt] {{Webarchive|url=https://web.archive.org/web/20121004043939/http://crockford.com/codecamp/jsonsaga.ppt# |date=October 4, 2012 }}</ref> [[Red (programming language)|Red]] | operating_system = [[cross-platform]] | website = {{URL|www.rebol.com}} | wikibooks = Rebol Programming }} '''Rebol''' ({{IPAc-en|Λ|r|Ι|b|Ιl}} {{respell|REB|Ιl}}; historically '''REBOL''') is a [[cross-platform]]<ref name="RD" /> [[data exchange language]] and a [[multi-paradigm programming language|multi-paradigm]] [[dynamic programming language]] designed by [[Carl Sassenrath]] for network communications and [[distributed computing]]. It introduces the concept of [[dialecting]]: small, [[optimization (computer science)|optimized]], [[domain-specific language]]s for code and data,<ref name="RD">Roberts, Ralph (2000). ''REBOL for Dummies.'' Hungry Minds. {{ISBN|0-7645-0745-1}}.</ref><ref name="RP">Auverlot, Olivier (2001). ''Rebol Programmation.'' Eyrolles. {{ISBN|2-212-11017-0}}.</ref> which is also the most notable property of the language according to its designer [[Carl Sassenrath]]: {{Blockquote|text=Although it can be used for programming, writing functions, and performing processes, its greatest strength is the ability to easily create domain-specific languages or dialects|author=Carl Sassenrath<ref name="DJ">{{cite web|last=Sassenrath|first=Carl|date=2000-07-01|url=http://www.ddj.com/184404172|title=Inside the REBOL scripting language|publisher=[[Dr. Dobb's Journal]]}}</ref>}} [[Douglas Crockford]], known for his involvement in the development of [[JavaScript]], has described Rebol as "a more modern language, but with some very similar ideas to [[Lisp (programming language) | Lisp]], in that it's all built upon a representation of data which is then executable as programs" and as one of [[JSON]]'s influences.<ref name="JSON" /> Originally, the language and its official implementation were [[proprietary software|proprietary]] and closed source, developed by REBOL Technologies. Following discussion with [[Lawrence Rosen (attorney)|Lawrence Rosen]],<ref>{{cite web|url=http://www.rebol.com/article/0511.html |title=REBOL to become open source |publisher=Rebol.com |date=September 25, 2012 |access-date=January 23, 2014}}</ref> the Rebol version 3 interpreter was released under the [[Apache License|Apache 2.0 license]] on December 12, 2012.<ref>{{cite web|url=http://www.rebol.com/cgi-bin/blog.r?view=0519 |title=Comments on: R3 Source Code Released!|first=Carl|last=Sassenrath|date=December 12, 2012|access-date=August 14, 2014 |quote=''You probably thought the source release would never happen? Am I right? Well, it's there now in github at github.com/rebol/rebol.''}}</ref> Older versions are only available in binary form, and no source release for them is planned. Rebol has been used to program [[Internet]] [[application software|application]]s (both [[client-side|client-]] and [[server-side]]), [[database]] applications, [[utility software|utilities]], and [[multimedia]] applications.<ref name="RD" /> ==Etymology== Rebol was initially an acronym for '''R'''elative '''E'''xpression '''B'''ased '''O'''bject '''L'''anguage written in all caps.<ref name="RD" /><ref name="DJ" /> 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.<ref>{{cite web |url=http://www.rebol.com/cgi-bin/blog.r?view=0525 |title=Calling REBOL Rebol? |date=December 14, 2012 <!--6:49 GMT--> |access-date=December 2, 2013 |archive-date=December 3, 2013 |archive-url=https://web.archive.org/web/20131203023615/http://www.rebol.com/cgi-bin/blog.r?view=0525 |url-status=dead }}</ref> In subsequent writing, Sassenrath adopted the convention of writing the language name as ''Rebol''.<ref>{{cite web|last1=Sassenrath|first1=Carl|title=Cross-compiling Rebol for your favorite embedded board|url=http://www.rebol.com/article/0526.html|access-date=16 September 2016}}</ref> ==History== First released in 1997, Rebol was designed over a 20-year period by Carl Sassenrath, the architect and primary developer of [[AmigaOS]], based on his study of [[denotational semantics]] and using concepts from the programming languages [[Lisp (programming language)|Lisp]], [[Forth (programming language)|Forth]], [[Logo (programming language)|Logo]], and [[Self (programming language)|Self]]. # 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 [[Open Database Connectivity|ODBC]] 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. # {{anchor|Rebol_3}}''Rebol 3'' [R3], the newest version of the [[interpreter (computing)|interpreter]], 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.<ref>{{cite web|title=Source code for the Rebol interpreter|url=https://github.com/rebol/rebol|website=rebol/rebol GitHub|access-date=14 March 2017}}</ref> ==Design== ===Ease of use=== One of the Rebol design principles is "to do simple things in simple ways".<ref name="RD" /> In the following example the ''Visual interface dialect'' is used to describe a simple [[Hello world program]] with a graphical user interface: <syntaxhighlight lang="smalltalk">view layout [text "Hello world!" button "Quit" [quit]]</syntaxhighlight> This is how a similar example looks in R3-GUI: <syntaxhighlight lang="smalltalk">view [text "Hello world!" button "Quit" on-action [quit]]</syntaxhighlight> [[File:R3-GUIHelloWorld.png|R3-GUI Hello world example]] ===Dialects=== Rebol [[domain-specific language]]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.<ref name="RD" /> Dialects are [[interpreted language|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 <code>''return''</code>. In the ''data exchange dialect'' <code>''return''</code> is just a word not having any specific meaning. In the ''do dialect'', <code>''return''</code> is a [[global variable]] referring to a native [[Function (computer science)|function]] passing back a function result value.<ref name="OG">Goldman, E., Blanton, J. (2000). ''REBOL: The Official Guide.'' McGraw-Hill Osborne Media. {{ISBN|0-07-212279-X}}.</ref> In the ''visual interface dialect (VID)'', <code>''return''</code> is a [[Keyword (computer programming)|keyword]] causing the layout engine to simulate a [[carriage return]], moving the "rendering pen" down to the beginning of the next line.<ref name="RP" /> A Rebol interpreter with graphical abilities must understand and interpret many dialects. The table below lists the most important ones in order of significance. {| class="wikitable" |- ! Dialect name ! Interpreted by ! Purpose |- | Data exchange dialect | <code>load</code> function | represents data and metadata; common platform for Rebol dialects |- | Do dialect | <code>do</code> function | programming |- | Parse dialect | <code>parse</code> function | [[pattern matching]] |- | Function specification dialect | <code>make</code> function | [[function (computer science)|function]] definition; [[functional programming]] |- | Object specification dialect | <code>make</code> function | [[object (computer science)|object]] definition/inheritance; [[prototype-based programming]] |- | Visual interface dialect (VID)<br>or<br>RebGUI | <code>layout</code> function<br>or<br><code>display</code> function | specifies [[graphical user interface]] |- | Draw dialect | <code>view</code> function | defines graphical elements (lines, polygons, etc.) |- | Script specification dialect | <code>do</code> function | script definition |- | Security policy dialect | <code>secure</code> function | specifies security policy |} ===Syntax=== Rebol [[syntax (programming languages)|syntax]] is [[free-form language|free-form]], not requiring specific positioning. However, [[indent style|indentation]] 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 (programming language)|C]], the ''data exchange dialect'' does not consist of [[declaration (computer science)|declarations]], [[statement (programming)|statement]]s, [[expression (programming)|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 [[delimiter|delimited]] by [[bracket|square brackets]]), parens (delimited by [[bracket|round brackets]]), [[string (computer science)|strings]] (delimited by [[quotation mark|double quotes]] or [[bracket|curly brackets]] suitable for multi-line strings; [[caret notation]] is used for unprintable characters), [[Uniform Resource Locator|URLs]], e-mail addresses, files, paths or other [[scalar (computing)|composite values]]. Unlike [[ALGOL]] [[block (programming)|blocks]], Rebol blocks are composite values similar to quoted [[s-expression]]s in [[Lisp (programming language)|Lisp]]. The fact that code is written in the form of Rebol blocks makes the language [[homoiconicity|homoiconic]].<ref name="OG" /> Blocks as well as parens may contain other composite values (a block may contain subblocks, parens, strings, ...) or [[scalar (computing)|scalar values]] like words, set-words (words suffixed by the [[colon (punctuation)|colon]]), get-words (words prefixed by the colon), lit-words (words prefixed by the [[apostrophe (mark)|apostrophe]]), numbers, money, [[character encoding|characters]], etc., separated by [[whitespace (computer science)|whitespace]]. Special characters are allowed in words, so <code>a+b</code> is a word unlike <code>a + b</code>, which is a sequence of three words separated by spaces. [[Comment (computer programming)|Comment]]s may appear following the [[semicolon]] 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.<ref name="OG" /> ===Semantics=== Blocks containing domain-specific language can be submitted as [[argument (computer science)|arguments]] to specific ''evaluator'' functions.<ref name="RD" /> ====do==== The most frequently used evaluator is the <code>do</code> function. It is used by default to interpret the text input to the interpreter [[command line interface|console]]. The ''do dialect'' interpreted by the <code>do</code> function, is an [[expression-oriented programming languages|expression-oriented]] sublanguage of the ''data exchange dialect''. The main semantic unit of the language is the [[expression (programming)|expression]]. In contrast to imperative programming languages descending from [[ALGOL]], the ''do dialect'' has neither keywords, nor statements. Words are used as [[case sensitivity|case-insensitive]] [[variable (programming)|variables]]. Like in all [[dynamically typed language]]s, 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 <code>do</code> function. The set-word form of a word can be used for [[assignment (computer science)|assignment]]. While not having statements, assignment, together with [[side-effect (computer science)|functions with side-effects]] can be used for [[imperative programming]].<ref name="OG" /> Subblocks of the root block evaluate to themselves. This property is used to handle data blocks, for [[structured programming]] by submitting blocks as arguments to [[control flow|control]] functions like <code>if</code>, <code>either</code>, <code>loop</code>, etc., and for dialecting, when a block is passed to a specific interpreter function.<ref name="RD" /> 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 <code>copy</code> function.<ref name="OG" /> The <code>do</code> function normally follows a [[polish notation|prefix style of evaluation]], where a function processes the arguments that follow it. However, [[infix notation|infix evaluation]] using infix [[operator (programming)|operator]]s exists too. Infix evaluation takes precedence over the prefix evaluation. For example, [[absolute value|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 [[Order of operations|precedence]] over another. For example, <syntaxhighlight lang="smalltalk"> 2 + 3 * 4 </syntaxhighlight> returns 20, while an evaluation giving precedence to multiplication would yield 14. All operators have prefix versions. <code>Do</code> usually evaluates arguments before passing them to a function. So, the below expression: <div class="plainlinks"> print read http://en.wikipedia.org/wiki/Rebol </div> first reads the Wikipedia Rebol page and then passes the result to the <code>print</code> function. Parentheses can be used to change the order of evaluation. Using [[Polish notation|prefix notation]], the usage of parentheses in expressions can be avoided.<ref name="OG" /> 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 [[transliteration|transliterated]] 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<ref name="RD" /> ====parse==== The <code>parse</code> function is preferably used to specify, validate, transform and interpret dialects. It does so by matching ''parse expressions'' at run time.<ref name="RD" /> ''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 [[terminal symbol|nonterminals]], infix parsing operators don't have prefix equivalents and use precedence rules (''sequence'' has higher precedence than ''choice'').<ref name="RD" /> Actions can be included to be taken during the parsing process as well and the <code>parse</code> function can be used to process blocks or strings. At the ''string parsing'' level <code>parse</code> must handle the "low level" parsing, taking into account [[character (computing)|characters]] and delimiters. ''Block parsing'' is higher level, handling the scanning at the level of Rebol values.<ref name="RD" /> The parse dialect belongs to the family of grammars represented by the [[top-down parsing language]] or the [[parsing expression grammar]] (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 [[Parsing expression grammar#Examples|PEG example]] that parses an arithmetic expression: <syntaxhighlight lang="smalltalk"> Digit: charset [#"0" - #"9"] Value: [some Digit | "(" Expr ")"] Product: [Value any [["*"| "/"] Value]] Sum: [Product any [["+"| "-"] Product]] Expr: Sum parse/all "12+13" Expr</syntaxhighlight> ==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]].<ref name="lic" /> 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]] edition, is about 650 KB in size. ''Rebol/View'' provides [[cross-platform|platform-independent]] graphics and sound access, and comes with its own windowing toolkit and extensible set of styles ([[GUI widget]]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.{{Citation needed|date=September 2016}} ==Legacy== * Rebol was named by [[Douglas Crockford]] as one of the inspirations of [[JavaScript Object Notation]].<ref name="JSON" /> * Rebol inspired the open-source Orca project, which is an interpreted Rebol-like language.<ref>The [http://freecode.com/projects/rebol-orca/ rebol-orca project] at [[Freecode]]</ref> * [http://urlan.sourceforge.net/boron/ 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)|Red programming language]] was directly inspired by Rebol, yet the implementation choices of Red were geared specifically to overcoming its perceived limitations.<ref>The [https://github.com/red/red/blob/master/README.md#red-programming-language Red project] at [[GitHub]]</ref> ==See also== * [[Domain-specific language]] * [[Language-oriented programming]] ==References== {{Reflist}} ==Further reading== * {{cite news|last=Mikes|first=Nora|title=A REBOL incursion: It's not a scripting language, not a programming language -- and not a new Amiga, either. Or is it?|url=http://www.linuxworld.com/linuxworld/lw-1999-10/lw-10-rebol.html|newspaper=LinuxWorld|date=November 20, 1999|archive-url=https://web.archive.org/web/20050324001942/http://linuxworld.com/linuxworld/lw-1999-10/lw-10-rebol.html|archive-date=March 24, 2005|url-status=dead|df=mdy-all}} * {{cite news|last=Story|first=Derrick|title=Rebol Might Be the Language for the Rest of Us|url=http://webreview.com/pub/1999/08/27/feature/index.html|newspaper=[[Web Review]]|date=Aug 27, 1999|archive-url=https://web.archive.org/web/19991012182529/http://webreview.com/pub/1999/08/27/feature/index.html |archive-date=October 12, 1999}} == External links == * [http://re-bol.com/rebol.html A REBOL tutorial] * [http://learnrebol.com/rebol3_book.html Rebol 3 Tutorial] * [https://github.com/Oldes/Rebol3 Rebol 3 (Oldes' fork) sources] {{Data Exchange}} {{Authority control}} {{DEFAULTSORT:Rebol}} [[Category:Programming languages]] [[Category:AmigaOS 4 software]] [[Category:Dynamic programming languages]] [[Category:Dynamically typed programming languages]] [[Category:Functional languages]] [[Category:Prototype-based programming languages]] [[Category:Scripting languages]] [[Category:Extensible syntax programming languages]] [[Category:Formerly proprietary software]] [[Category:Programming languages created in 1997]] [[Category:High-level programming languages]] [[Category:Homoiconic programming languages]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Authority control
(
edit
)
Template:Blockquote
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:Comma separated entries
(
edit
)
Template:Data Exchange
(
edit
)
Template:IPAc-en
(
edit
)
Template:ISBN
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Main other
(
edit
)
Template:Reflist
(
edit
)
Template:Respell
(
edit
)
Template:Short description
(
edit
)
Template:Use mdy dates
(
edit
)