Red (programming language): Difference between revisions

Content deleted Content added
m Add references
m Consolidate refs and more sources
Line 22:
| file_ext = .red, .reds
}}
'''Red''' is a [[programming language]] designed to overcome the limitations of the programming language [[Rebol]].<ref name="GS">{{cite web |title=Getting Started with GUI Programming using Red Language |url=https://www.studytonight.com/post/getting-started-with-gui-programming-using-red-programming-language |website=Studytonight |access-date=September 17, 2021}}</ref> Red was introduced in 2011 by Nenad Rakočević, and is both an [[imperative programming|imperative]] and [[functional programming]] language. Its syntax and general usage overlaps that of the interpreted Rebol language.<ref>{{cite web |title=Interview with Nenad Rakocevic about Red, a Rebol inspired programming language |url=https://www.notamonadtutorial.com/interview-with-nenad-rakocevic-about-red-a-rebol-inspired-programming-language/ |website=Not a Monad Tutorial| access-date=August 28, 2015}}</ref>
 
The implementation choices of Red intend to create a [[Solution stack|full stack]] programming language: Red can be used for extremely high-level programming ([[Domain-specific language|DSL]]s and [[Graphical user interface|GUI]]s) as well as low-level programming ([[operating system]]s and [[device driver]]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{{snd}} for example, one would write {{Smalltalk|if x > y [print "Hello"]}} instead of {{C-lang|if (x > y) {printf("Hello\n");} }}.
* ''Red'' is a [[homoiconicity|homoiconic language]]<ref name="GS">{{cite web |title=Getting Started with GUI Programming using Red Language |url=https://www.studytonight.com/post/getting-started-with-gui-programming-using-red-programming-language |website=Studytonight |access-date=September 17, 2021}}</ref> capable of meta-programming, with Rebol-like semantics. Red's runtime library is written in Red/System, and uses a hybrid approach: it [[compiled language|compiles]] what it can deduce statically and uses an embedded [[interpreter (computing)|interpreter]] otherwise. The project roadmap includes a [[just-in-time compilation|just-in-time compiler]] for cases in between, but this has not yet been implemented.
 
Red seeks to remain independent of any other [[toolchain]]; it does its own code generation.<ref name="GS">{{cite web |title=Getting Started with GUI Programming using Red Language |url=https://www.studytonight.com/post/getting-started-with-gui-programming-using-red-programming-language |website=Studytonight |access-date=September 17, 2021}}</ref> It is therefore possible to [[cross compiler|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]] 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 collection (computer science)|garbage collector]] "the Simple GC".<ref name=GC>{{Cite web|url=https://www.red-lang.org/2018/12/064-simple-gc-and-pure-red-gui-console.html|title=0.6.4 Simple GC and Pure Red GUI Console|quote=The main feature for 0.6.4 is what we call the Simple GC (Garbage Collector). A more advanced GC is planned for the future |last=lucindamichele|access-date=2018-12-16}}</ref>
Line 39:
 
==Features==
Red's syntax and semantics are very close to those of [[Rebol]].<ref>{{cite web |title=The Dynamic Mapping Architecture |url=https://etd.ohiolink.edu/apexprod/rws_etd/send_file/send?accession=toledo1639760375713532&disposition=inline |website=OhioLINK |date=December 2021}}</ref> Like Rebol, it strongly supports [[metaprogramming]] and ___domain-specific languages ([[___domain-specific language|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&nbsp;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==