HOME

TheInfoList



OR:

Red is a
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
designed to overcome the limitations of the programming language Rebol. Red was introduced in 2011 by Nenad Rakočević, and is both an imperative and
functional programming In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declar ...
language. Its syntax and general usage overlaps that of the interpreted Rebol language. The implementation choices of Red intend to create a full stack programming language: Red can be used for extremely high-level programming (
DSL Digital subscriber line (DSL; originally digital subscriber loop) is a family of technologies that are used to transmit digital data over telephone lines. In telecommunications marketing, the term DSL is widely understood to mean asymmetric dig ...
s and
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
s) as well as low-level programming (
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
s and
device driver In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabling operating systems and ot ...
s). Key to the approach is that the language has two parts: ''Red/System'' and ''Red''. * ''Red/System'' is similar to C, but packaged into a Rebol lexical structure for example, one would write instead of . * ''Red'' is a homoiconic language capable of meta-programming, with Rebol-like semantics. Red's runtime library is written in Red/System, and uses a hybrid approach: it compiles what it can deduce statically and uses an embedded interpreter otherwise. The project roadmap includes a
just-in-time compiler In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may cons ...
for cases in between, but this has not yet been implemented. Red seeks to remain independent of any other
toolchain In software, a toolchain is a set of programming tools that is used to perform a complex software development task or to create a software product, which is typically another computer program or a set of related programs. In general, the tools form ...
; it does its own code generation. It is therefore possible to
cross-compile A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross c ...
Red programs from any platform it supports to any other, via a command-line switch. Both Red and Red/System are distributed as
open-source software Open-source software (OSS) is computer software that is released under a license in which the copyright holder grants users the rights to use, study, change, and distribute the software and its source code to anyone and for any purpose. Op ...
under the
modified BSD license BSD licenses are a family of permissive free software licenses, imposing minimal restrictions on the use and distribution of covered software. This is in contrast to copyleft licenses, which have share-alike requirements. The original BSD lice ...
. The runtime library is distributed under the more permissive
Boost Software License Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It conta ...
. As of version 0.6.4 Red includes a
garbage collector A waste collector, also known as a garbageman, garbage collector, trashman (in the US), binman or (rarely) dustman (in the UK), is a person employed by a public or private enterprise to collect and dispose of municipal solid waste (refuse) and r ...
"the Simple GC".


Introduction

Red was introduced in the
Netherlands ) , anthem = ( en, "William of Nassau") , image_map = , map_caption = , subdivision_type = Sovereign state , subdivision_name = Kingdom of the Netherlands , established_title = Before independence , established_date = Spanish Netherl ...
in February 2011 at the ''Rebol & Boron conference'' by its author Nenad Rakočević. In September 2011, the Red programming language was presented to a larger audience during the
Software Freedom Day Software Freedom Day (SFD) is an annual worldwide celebration of Free Software organized by the Digital Freedom Foundation (DFF). SFD is a public education effort with the aim of increasing awareness of Free Software and its virtues, and enc ...
2011. Rakočević is a long-time Rebol developer known as the creator of the Cheyenne
HTTP server An HTTP server is a computer (software) program (or even a software component included in an other program) that plays the role of a server in a client–server model by implementing the ''server part'' of the HTTP and/or HTTPS network protocol ...
.« What is Cheyenne? »
Last referenced Nov 2017.


Features

Red's syntax and semantics are very close to those of Rebol. Like Rebol, it strongly supports
metaprogramming Metaprogramming is a programming technique in which computer programs have the ability to treat other programs as their data. It means that a program can be designed to read, generate, analyze or transform other programs, and even modify itself ...
and domain-specific languages ( DSLs) and is therefore a highly efficient tool for dialecting (creating embedded DSLs). Red includes a dialect called Red/System, a C-level language which provides system programming facilities. Red is easy to integrate with other tools and languages as a DLL (libRed) and very lightweight (around 1 MB). It is also able to cross-compile to various platforms (see Cross Compilation section below) and create packages for platforms that require them (e.g., .APK on Android). Red also includes a fully reactive cross-platform GUI system based on an underlying reactive dataflow engine, a 2D drawing dialect comparable to SVG, compile-time and runtime macro support, and more than 40 standard datatypes.


Goals

The following is the list of Red's Goals as presented on the
Software Freedom Day Software Freedom Day (SFD) is an annual worldwide celebration of Free Software organized by the Digital Freedom Foundation (DFF). SFD is a public education effort with the aim of increasing awareness of Free Software and its virtues, and enc ...
2011: * Simplicity ("An IDE should not be necessary to write code.") * Compactness ("Being highly expressive maximizes productivity.") * Speed ("If too slow, it cannot be general-purpose enough.") * Be "Green", Have a Small Footprint ("Because resources are not limitless.") * Ubiquity ("Spread everywhere.") * Portability, Write once run everywhere ("That’s the least expected from a programming language.") * Flexibility ("Not best but good fit for any task!")


Development

Red's development is planned to be done in two phases: # Initial phase: Red and Red/System compilers written in Rebol 2 # Bootstrap phase: Red and Red/System compilers complemented by a Red JIT-compiler, all written in Red


Cross compilation

Red currently supports the following cross-compilation targets: *
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few ope ...
: Windows,
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
, console (and GUI) applications *
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
: Windows, x86, GUI applications *
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
:
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, x86 * Linux-ARM:
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, ARMv5, armel (soft-float) *
Raspberry Pi Raspberry Pi () is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom. The Raspberry Pi project originally leaned towards the promotion of teaching basic ...
:
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, ARMv5,
armhf ARM (stylised in lowercase as arm, formerly an acronym for Advanced RISC Machines and originally Acorn RISC Machine) is a family of reduced instruction set computer (RISC) instruction set architectures for computer processors, configured ...
(hard-float) *
FreeBSD FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
:
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
* Darwin:
OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
Intel, console (and GUI) applications *
Syllable A syllable is a unit of organization for a sequence of speech sounds typically made up of a syllable nucleus (most often a vowel) with optional initial and final margins (typically, consonants). Syllables are often considered the phonological "bu ...
: Syllable OS,
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
* Android: Android, ARMv5 * Android-x86: Android,
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was introd ...
(Note: This list will increase with time and should therefore be considered as incomplete.)


Hello World!

Red itle: "Simple hello world script"print "Hello World!"


Factorial example

IMPORTANT: These are intended as syntax examples. Until Red has
64-bit In computer architecture, 64-bit Integer (computer science), integers, memory addresses, or other Data (computing), data units are those that are 64 bits wide. Also, 64-bit central processing unit, CPUs and arithmetic logic unit, ALUs are those ...
support, the integer example will overflow a
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculation ...
integer very quickly. Changing that to `float!` will go farther, but these are merely to show the syntax of the language. The following is a factorial example in Red: Red itle: "A factorial script" ; Note: The title is optional. factorial: func x_[integer!_;_Giving_the_type_of_an_argument_in_Red_is_optional .html" ;"title="nteger!.html" ;"title=" x [integer!"> x [integer! ; Giving the type of an argument in Red is optional ">nteger!.html" ;"title=" x [integer!"> x [integer! ; Giving the type of an argument in Red is optional either x = 0 [1][x * factorial x - 1] ] The following is the same factorial example in Red/System (in this very simple case, the source code is very similar to Red's version): Red/System itle: "A factorial script" factorial: func x_______[integer!__________________;_This_is_compulsory_in_Red/System return:_[integer!.html" ;"title="nteger!.html" ;"title=" x [integer!"> x [integer! ; This is compulsory in Red/System return: [integer!">nteger!.html" ;"title=" x [integer!"> x [integer! ; This is compulsory in Red/System return: [integer! ; This is compulsory in Red/System ][ either x = 0 [1][x * factorial x - 1] ]


See also

* Rebol


References


External links

*
Red Programming Language
on
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous ...

Redprogramming.com
* {{Programming languages Functional languages Systems programming languages Extensible syntax programming languages Domain-specific programming languages Software using the BSD license Software using the Boost license Programming languages created in 2011 2011 software High-level programming languages Homoiconic programming languages