100 Helloslanguages
Home / Languages / REBOL

REBOL

1997fraglet
scriptingimperativefunctionalmetaprogramming.r.reb
docker run --rm --platform="linux/amd64" 100hellos/rebol:latest

MCP + fragletc

MCPstdinargs
This language supports code execution via MCP and the fragletc CLI. Stdin piping and argument passing are both supported.
Install fragletc →

Rebol is a homoiconic language that was designed by Carl Sassenrath. It is a descendant of Lisp and Forth, and it is known for its simplicity and ease of use. Rebol is a cross-platform language that can be used for a variety of tasks, including scripting, web development, and data processing.

From Wikipedia:

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, in that it's all built upon a representation of data which is then executable as programs" and as one of JSON's influences.

Hello World

REBOL [Title: "Example"]
; BEGIN_FRAGLET
print "Hello World!"
; END_FRAGLET
quit

Coding Guide

Language Version

REBOL 3.18.0

Execution Model

  • Interpreted, runs directly from source
  • Code executes at the top level

Key Characteristics

  • Homoiconic language (code is data)
  • Dynamic typing
  • Case-insensitive keywords (but case-sensitive strings)
  • Minimal syntax with block notation
  • Built-in data types: strings, integers, blocks, words, etc.

Fragment Authoring

Write valid REBOL statements. Your fragment becomes the script body. Code runs at the top level.

Available Libraries

Standard REBOL library is available. No additional modules are pre-installed.

Common Patterns

  • Print: print "message" or print {message}
  • Variables: name: "Alice"
  • Blocks: [1 2 3 4 5]
  • Functions: add: func [a b] [a + b]
  • Conditionals: if condition [code]
  • Loops: foreach item block [code]
  • String concatenation: rejoin ["Hello " name]

Examples

; Simple output
print "Hello, World!"

; Variables and expressions
name: "Alice"
age: 30
print rejoin ["Hello, " name "! You are " age " years old."]

; Function definition
greet: func [name] [
    rejoin ["Hello, " name "!"]
]
print greet "Bob"

; Block processing
numbers: [1 2 3 4 5]
sum: 0
foreach num numbers [sum: sum + num]
print rejoin ["Sum: " sum]

; Conditional
x: 10
if x > 5 [
    print "x is greater than 5"
]

; String operations
text: "Hello World"
print uppercase text
print length? text

Caveats

  • REBOL keywords are case-insensitive, but strings are case-sensitive
  • Blocks use square brackets [] for code and data
  • Words (identifiers) don't need quotes
  • Use rejoin for string concatenation

Fraglet Scripts

Echo Args

#!/usr/bin/env -S fragletc --vein=rebol
print rejoin ["Args: " system/script/args]

Stdin Upper

#!/usr/bin/env -S fragletc --vein=rebol
line: input
print uppercase line

Test

#!/usr/bin/env -S fragletc --vein=rebol
print "Hello World!"

Connections

influenced by

Container Info

image100hellos/rebol:latest
build scheduleSaturday
fragletenabled