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 l ...
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 applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
language. Its syntax and general usage overlaps that of the interpreted Rebol language. The implementation choices of Red intend to create a
full stack Full stack, full-stack, fullstack or Full Stack Cloud might refer to; * Full Stack Cloud are those complete Cloud Computing, provided by Cloud Service Provider in the form of integrated software technologies, with or without hardware. Type a Full ...
programming language: Red can be used for extremely high-level programming ( DSLs and GUIs) as well as low-level programming (
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
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 o ...
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 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 for ...
; it does its own code generation. It is therefore possible to cross-compile 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. Ope ...
under the modified BSD license. The runtime library is distributed under the more permissive Boost Software License. As of version 0.6.4 Red includes a garbage collector "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.« 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 oper ...
: Windows, x86, 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 ...
: 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 i ...
:
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 i ...
, 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 i ...
, ARMv5,
armel Armel may refer to: *Armel, Virginia, unincorporated community in Frederick County, Virginia, United States * Saint Armel, early 6th century Breton holy man * Armel, a member of the Wu-Tang Clan affiliates *ARM architecture ARM (stylised ...
(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 i ...
, ARMv5, armhf (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 *
Darwin Darwin may refer to: Common meanings * Charles Darwin (1809–1882), English naturalist and writer, best known as the originator of the theory of biological evolution by natural selection * Darwin, Northern Territory, a territorial capital city i ...
:
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 la ...
Intel, console (and GUI) applications * Syllable: Syllable OS, x86 *
Android Android may refer to: Science and technology * Android (robot), a humanoid robot or synthetic organism designed to imitate a human * Android (operating system), Google's mobile operating system ** Bugdroid, a Google mascot sometimes referred to ...
: Android, ARMv5 * Android-x86: Android, x86 (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 integers, memory addresses, or other data units are those that are 64 bits wide. Also, 64-bit CPUs and ALUs are those that are based on processor registers, address buses, or data buses of that size. A comp ...
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 calcula ...
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 ">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!">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, co ...

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