{"id":13400097,"url":"https://github.com/red/red","last_synced_at":"2026-01-25T06:42:52.628Z","repository":{"id":1234894,"uuid":"1449773","full_name":"red/red","owner":"red","description":"Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single ~1MB file! ","archived":false,"fork":false,"pushed_at":"2025-03-14T16:50:03.000Z","size":40273,"stargazers_count":5601,"open_issues_count":515,"forks_count":416,"subscribers_count":202,"default_branch":"master","last_synced_at":"2025-03-14T17:37:42.871Z","etag":null,"topics":["compiler","cross-platform","gui","interpreter","language","native","programming-language","reactive-programming","rebol","red","repl","scripting-language","toolchain"],"latest_commit_sha":null,"homepage":"http://red-lang.org","language":"Red","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/red.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-03-07T11:38:19.000Z","updated_at":"2025-03-14T16:50:07.000Z","dependencies_parsed_at":"2024-04-28T08:36:19.929Z","dependency_job_id":"fbd686cb-4488-4647-8641-764efbd8bc91","html_url":"https://github.com/red/red","commit_stats":{"total_commits":13133,"total_committers":91,"mean_commits":144.3186813186813,"dds":0.4960785806746364,"last_synced_commit":"6dbc5d6c7676bd9920b645d8c2c62c6d7817cf90"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red%2Fred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red%2Fred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red%2Fred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red%2Fred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/red","download_url":"https://codeload.github.com/red/red/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245779445,"owners_count":20670684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler","cross-platform","gui","interpreter","language","native","programming-language","reactive-programming","rebol","red","repl","scripting-language","toolchain"],"created_at":"2024-07-30T19:00:48.161Z","updated_at":"2026-01-25T06:42:52.622Z","avatar_url":"https://github.com/red.png","language":"Red","readme":"[![Join the chat at https://gitter.im/red/red](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/red/red?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n![Windows build 2](https://github.com/red/red/actions/workflows/main.yml/badge.svg?branch=master)\n![Linux build 2](https://github.com/red/red/actions/workflows/linux.yml/badge.svg?branch=master)\n![ARMhf build 2](https://github.com/red/red/actions/workflows/RPi.yml/badge.svg?branch=master)\n\n# Red Programming Language\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://static.red-lang.org/images/GUI.png\"\u003e\n\u003c/p\u003e\n\n\n**Red** is a programming language strongly inspired by [Rebol](http://rebol.com), but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting, while providing modern support for concurrency and multi-core CPUs.\n\nRed tackles the software building complexity using a DSL-oriented approach (we call them _dialects_) . The following dialects are built-in:\n\n* [Red/System](https://static.red-lang.org/red-system-specs-light.html): a C-level system programming language compiled to native code\n* [Parse](http://www.red-lang.org/2013/11/041-introducing-parse.html): a powerful PEG parser\n* [VID](https://github.com/red/docs/blob/master/en/vid.adoc): a simple GUI layout creation dialect\n* [Draw](https://github.com/red/docs/blob/master/en/draw.adoc): a vector 2D drawing dialect\n* [Rich-text](https://github.com/red/docs/blob/master/en/rtd.adoc): a rich-text description dialect\n\n\nRed has its own complete cross-platform toolchain, featuring an encapper, a native compiler, an interpreter, and a linker, not depending on any third-party library, except for a Rebol2 interpreter, required during the alpha stage. Once 1.0 is reached, Red will be [self-hosted](http://en.wikipedia.org/wiki/Self-hosting). Currently, Red is still at \u003cu\u003ealpha stage\u003c/u\u003e and \u003cu\u003e32-bit only\u003c/u\u003e.\n\nRed's main features are:\n\n* Human-friendly [syntax](http://www.rebol.com/rebolsteps.html)\n* [Homoiconic](http://en.wikipedia.org/wiki/Homoiconicity) (Red is its own meta-language and own [data-format](http://www.rebol.com/rebolsteps.html))\n* Functional, imperative, [reactive](http://www.red-lang.org/2016/06/061-reactive-programming.html) and symbolic programming\n* Prototype-based object support\n* Multi-typing\n* Powerful pattern-matching [Macros](http://www.red-lang.org/2016/12/entering-world-of-macros.html) system\n* Rich set of built-in datatypes (50+)\n* Both statically and JIT-compiled(*) to native code\n* Cross-compilation [done](https://github.com/red/red/blob/master/encapper/usage.txt) [right](https://github.com/red/red/blob/master/system/config.r)\n* Produces executables of less than 1MB, with no dependencies\n* Concurrency and parallelism strong support (actors, parallel collections)(*)\n* Low-level system programming abilities through the built-in Red/System [DSL](http://en.wikipedia.org/wiki/Domain-specific_language)\n* Powerful [PEG parser DSL](http://www.red-lang.org/2013/11/041-introducing-parse.html) built-in\n* Fast and compacting Garbage Collector\n* Instrumentation built-in for the interpreter, [lexer](https://github.com/red/docs/blob/master/en/lexer.adoc#instrumenting-the-lexer) and parser.\n* Cross-platform native [GUI system](http://www.red-lang.org/2016/03/060-red-gui-system.html), with a [UI layout DSL](http://doc.red-lang.org/gui/VID.html) and a [drawing DSL](http://doc.red-lang.org/gui/Draw.html)\n* Bridging [to the JVM](https://github.com/red/red/blob/master/bridges/java/hello.red)\n* High-level scripting and [REPL](http://en.wikipedia.org/wiki/Read-eval-print_loop) GUI and CLI consoles included\n* Visual Studio Code [plugin](https://marketplace.visualstudio.com/items?itemName=red-auto.red), with many helpful features\n* Highly [embeddable](http://www.red-lang.org/2017/03/062-libred-and-macros.html)\n* Low memory footprint\n* Single-file (~1MB) contains whole toolchain, full standard library and REPL (**)\n* No install, no setup\n* Fun guaranteed!\n\n(*) Not implemented yet.\n(**) Temporarily split in two binaries\n\nMore information at [red-lang.org](https://www.red-lang.org).\n\n# Running the Red REPL\n\n[Download](https://www.red-lang.org/p/download.html) a GUI or CLI console binary suitable for your operating system, rename it at your convenience, then run it from shell or by double-clicking on it (Windows). You should see the following output:\n\n        ---== Red 0.6.5 ==--\n        Type HELP for starting information.\n\n        \u003e\u003e\n\nA simple Hello World would look like:\n\n        \u003e\u003e print \"Hello World!\"\n        Hello World!\n\nIf you are on the GUI console, a GUI Hello World (prompt omitted):\n\n        view [text \"Hello World!\"]\n        \n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"97\" height=\"52\" src=\"https://static.red-lang.org/images/helloworld.png\"\u003e\n\u003c/p\u003e\n\nA more [sophisticated example](https://github.com/red/code/blob/master/Showcase/last-commits2.red) that retrieves the last commits from this repo and displays their log messages in a scrollable list:\n\n        view [\n            text-list data collect [\n                foreach event load https://api.github.com/repos/red/red/commits [\n                    keep event/commit/message\n                ]\n            ]\n        ]\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"439\" height=\"139\" src=\"https://static.red-lang.org/images/commits.png\"\u003e\n\u003c/p\u003e\n\nNote: check also the following [improved version](https://github.com/red/code/blob/master/Showcase/last-commits3.red) allowing you to click on a given commit log and open the commit page on github.\n\n\nYou can now head to see and try some showcasing scripts [here](https://github.com/red/code/tree/master/Showcase) and [there](https://github.com/red/code/tree/master/Scripts). You can run those examples from the console directly using Github's \"raw\" link. E.g.:\n\n        \u003e\u003e do https://raw.githubusercontent.com/red/code/master/Showcase/calculator.red\n\nNote: If you are using the Wine emulator, it has some [issues](https://github.com/red/red/issues/1618) with the GUI-Console. Install the `Consolas` font to fix the problem.\n\n\n# Generating a standalone executable\n\nThe Red toolchain comes as a single executable file that you can [download](https://www.red-lang.org/p/download.html) for the big-3 platforms (32-bit only for now). Rename the file to `redc` (or `redc.exe` under Windows).\n\n1. Put the downloaded **redc** binary in the working folder.\n\n2. In a code or text editor, write the following Hello World program:\n\n        Red [\n            Title: \"Simple hello world script\"\n        ]\n\n        print \"Hello World!\"\n\n3. Save it under the name: **hello.red**\n\n6. Generate a compiled executable from that program: (first run will pre-compile libRedRT library)\n\n        $ redc -c hello.red\n        $ ./hello\n\n7. Want to generate a compiled executable from that program with no dependencies?\n\n        $ redc -r hello.red\n        $ ./hello\n\n8. Want to cross-compile to another supported platform?\n\n        $ redc -t Windows hello.red\n        $ redc -t Darwin hello.red\n        $ redc -t Linux-ARM hello.red\n\n**The full command-line syntax is:**\n\n    redc [command] [options] [file]\n\n`[file]` any Red or Red/System source file.\n\n* The -c, -r and -u options are mutually exclusive.\n\n`[options]`\n\n    -c, --compile                  : Generate an executable in the working\n                                     folder, using libRedRT. (development mode)\n\n    -d, --debug, --debug-stabs     : Compile source file in debug mode. STABS\n                                     is supported for Linux targets.\n\n    -dlib, --dynamic-lib           : Generate a shared library from the source\n                                     file.\n\n    -e, --encap                    : Compile in encap mode, so code is interpreted\n                                     at runtime. Avoids compiler issues. Required\n                                     for some dynamic code.\n\n    -h, --help                     : Output this help text.\n\n    -o \u003cfile\u003e, --output \u003cfile\u003e     : Specify a non-default [path/][name] for\n                                     the generated binary file.\n\n    -r, --release                  : Compile in release mode, linking everything\n                                     together (default: development mode).\n\n    -s, --show-expanded            : Output result of Red source code expansion by\n                                     the preprocessor.\n\n    -t \u003cID\u003e, --target \u003cID\u003e         : Cross-compile to a different platform\n                                     target than the current one (see targets\n                                     table below).\n\n    -u, --update-libRedRT          : Rebuild libRedRT and compile the input script\n                                      (only for Red scripts with R/S code).\n\n    -v \u003clevel\u003e, --verbose \u003clevel\u003e  : Set compilation verbosity level, 1-3 for\n                                     Red, 4-11 for Red/System.\n\n    -V, --version                  : Output Red's executable version in x.y.z\n                                     format.\n\n    --config [...]                 : Provides compilation settings as a block\n                                     of `name: value` pairs.\n\n    --no-compress                  : Omit Redbin format compression.\n\n    --no-runtime                   : Do not include runtime during Red/System\n                                     source compilation.\n\n    --no-view                      : Do not include VIEW module in the CLI console\n                                     and the libRedRT.\n\n    --view \u003cengine\u003e                : Select the VIEW engine (native, terminal, GTK, test)\n\n    --red-only                     : Stop just after Red-level compilation.\n                                     Use higher verbose level to see compiler\n                                     output. (internal debugging purpose)\n\n    --show-func-map                : Output an address/name map of Red/System\n                                     functions, for debugging purposes.\n\n`[command]`\n\n    build libRed [stdcall]         : Builds libRed library and unpacks the\n                                     libRed/ folder locally.\n\n    clear [\u003cpath\u003e]                 : Delete all temporary files from current\n                                     or target \u003cpath\u003e folder.\n\nCross-compilation targets:\n\n    MSDOS        : Windows, x86, console (+ GUI) applications\n    Windows      : Windows, x86, GUI applications\n    WindowsXP    : Windows, x86, GUI applications, no touch API\n    Linux        : GNU/Linux, x86, console (+ GUI) applications\n    Linux-GTK    : GNU/Linux, x86, GUI only applications\n    Linux-musl   : GNU/Linux, x86, musl libc\n    Linux-ARM    : GNU/Linux, ARMv5, armel (soft-float)\n    RPi          : GNU/Linux, ARMv7, armhf (hard-float)\n    RPi-GTK      : GNU/Linux, ARMv7, armhf (hard-float), GUI only applications\n    Pico         : GNU/Linux, ARMv7, armhf (hard-float), uClibc\n    Darwin       : macOS Intel, console-only applications\n    macOS        : macOS Intel, applications bundles\n    Syllable     : Syllable OS, x86\n    FreeBSD      : FreeBSD, x86\n    NetBSD       : NetBSD, x86\n    Android      : Android, ARMv5\n    Android-x86  : Android, x86\n\n_Note_: The toolchain executable (`redc.exe`) relies on Rebol encapper which does not support being run from a location specified in `PATH` environment variable and you get `PROGRAM ERROR: Invalid encapsulated data` error. If you are on Windows try using PowerShell instead of CMD. You can also provide the full path to the executable, put a copy of it in your working folder or wrap a shell script (see relevant tickets: [#543](https://github.com/red/red/issues/543) and [#1547](https://github.com/red/red/issues/1547)).\n\n\n# Running Red from the sources (for contributors)\n\nThe compiler and linker are currently written in Rebol. Please follow the instructions for installing the compiler toolchain in order to run it from sources:\n\n1. Clone this git repository or download an archive (`ZIP` button above or from [tagged packages](https://github.com/red/red/tags)).\n\n1. Download a Rebol interpreter suitable for your OS: [Windows](http://www.rebol.com/downloads/v278/rebol-core-278-3-1.exe), [Linux](http://www.maxvessi.net/rebsite/Linux/) (or [Linux](http://www.rebol.com/downloads/v278/rebol-core-278-4-2.tar.gz)), [Mac OS X](http://www.rebol.com/downloads/v278/rebol-core-278-2-5.tar.gz), [FreeBSD](http://www.rebol.com/downloads/v278/rebol-core-278-7-2.tar.gz), [OpenBSD](http://www.rebol.com/downloads/v278/rebol-core-278-9-4.tar.gz), [Solaris](http://www.rebol.com/downloads/v276/rebol-core-276-10-1.gz).\n\n1. Extract the `rebol` binary, put it in the root folder, that's all!\n\n1. Let's test it: run `./rebol`, you'll see a `\u003e\u003e` prompt appear. Windows users need to double-click on the `rebol.exe` file to run it.\n\n1. From the REBOL console type:\n\n        \u003e\u003e do/args %red.r \"%tests/hello.red\"\n\nThe compilation process should finish with a `...output file size` message. The resulting binary is in the working folder. Windows users need to open a DOS console and run `hello.exe` from there.\n\nYou can compile the Red console from source:\n\n        \u003e\u003e do/args %red.r \"-r %environment/console/CLI/console.red\"\n\nTo compile the Windows GUI console from source:\n\n        \u003e\u003e do/args %red.r \"-r -t Windows %environment/console/GUI/gui-console.red\"\n\nNote: the `-c` argument is not necessary when launching the Red toolchain from sources, as the default action is to compile the input script (the toolchain in binary form default action is to run the input script through the interpreter).\nThe `-r` argument is needed when compiling the Red console to make additional runtime functions available.\n\nNote: The red git repository does not include a `.gitignore` file. If you run the automated tests, several files will be created that are not stored in the repository. Installing and renaming a copy of [`.git/.gitignore-sample`](https://github.com/red/red/blob/master/.gitignore-sample) file will ignore these generated files.\n\n# Contributing\n\nIf you want to contribute code to the Red project be sure to read the [guidelines](https://github.com/red/red/wiki/%5BDOC%5D-Contributor-Guidelines) first.\n\nIt is usually a good idea to inform the Red team about what changes you are going to make in order to ensure that someone is not already working on the same thing. You can reach us through our [chat room](https://gitter.im/red/red).\n\nSatisfied with the results of your change and want to issue a pull request on Github?\n\nMake sure the changes pass all the existing tests, add relevant tests to the test-suite, and please test on as many platforms as you can. You can run all the tests using (from Rebol console, at repository root):\n\n        \u003e\u003e do %run-all-tests.r\n\n# Git integration with console built from sources\n\nIf you want git version included in your Red console built from sources, use this command:\n```Red\ncall/show \"\"                                              ;-- patch call bug on Windows\nsave %build/git.r do %build/git-version.r                 ;-- lookup git version if available\ndo/args %red.r \"-r %environment/console/CLI/console.red\"  ;-- build Console\nwrite %build/git.r \"none^/\"                               ;-- restore git repo status\n```\n\n# Anti-virus false positive\n\nSome anti-virus programs are a bit too sensitive and can wrongly report an alert on some binaries generated by Red (see [here](https://github.com/red/red/wiki/%5BNOTE%5D-Anti-virus-false-positives) for the details). If that happens to you, please report it to your anti-virus vendor as a false positive.\n\nOne known way to reduce the false flagging from anti-viruses is to use the `--no-compress` option when compiling Red binaries. That will prevent the internal Rebin data to be compressed using our CRUSH compressor, reducing that file section entropy.\n\n# License\n\nBoth Red and Red/System are published under [BSD](http://www.opensource.org/licenses/bsd-3-clause) license, runtime is under [BSL](http://www.boost.org/users/license.html) license. BSL is a bit more permissive license than BSD, more suitable for the runtime parts.\n","funding_links":[],"categories":["Red","计算机编程 数据结构与算法","Uncategorized","Resources","programming-language","Compilers and Interpreters","Other"],"sub_categories":["网络服务_其他","Uncategorized","Basics","Serious Projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred%2Fred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fred%2Fred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred%2Fred/lists"}