https://github.com/red/red Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} red / red * Notifications * Star 4.6k * Fork 385 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! red-lang.org View license 4.6k stars 385 forks Star Notifications * Code * Issues 502 * Pull requests 18 * Discussions * Actions * Wiki * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 24 branches 27 tags Code Clone HTTPS GitHub CLI [https://github.com/r] Use Git or checkout with SVN using the web URL. [gh repo clone red/re] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @qtxie qtxie FIX: gui-console: issue #2679 (prin does not work correctly with ask ... ... f53815f Jul 14, 2021 FIX: gui-console: issue #2679 (prin does not work correctly with ask ... ...command). f53815f Git stats * 13,521 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Update issue templates Mar 18, 2021 bridges FEAT: move dotNET bridge to red/code repository Apr 19, 2019 build FIX: remove folder build/bin Dec 24, 2020 docs FIX: issue #4790 (Loading C1 codepoints messes up system/words.) Jan 29, 2021 environment FIX: gui-console: issue #2679 (prin does not work correctly with ask ... Jul 14, 2021 libRed FIX: adds checks for persistent system/thrown values throughout the r... Jul 2, 2021 modules/view FIX: adds checks for persistent system/thrown values throughout the r... Jul 2, 2021 quick-test FIX: tests failed on each mode. May 10, 2021 runtime FIX: issue #4908 (Money accessors don't implement write support) Jul 3, 2021 system FIX: crashing issue in stack-trace low-level debugging function. Jun 25, 2021 tests TESTS: moves test for #4260 to the right place. Jul 3, 2021 utils FEAT: avoid compiled path words rebinding. Feb 15, 2021 .appveyor.yml FIX: renaming appveyor config file. Jul 2, 2016 .editorconfig Add .editorconfig. Mar 30, 2017 .gitattributes-sample .gitattributes-sample file added Sep 27, 2020 .gitignore-sample DOC: added .gitignore-sample Mar 19, 2018 .travis.yml FIX: switches to ubuntu images for ARMhf Travis target. May 4, 2021 BSD-3-License.txt FIX: BSD license file was not updated last year to the new copyright. Jun 28, 2019 BSL-License.txt FEAT: moved BSL license file to root folder. Oct 27, 2012 CODE_OF_CONDUCT.md Minor fixes Oct 28, 2020 CONTRIBUTING.md Minor fixes Oct 28, 2020 README.md FIX: a typo. Nov 1, 2020 boot.red FIX: image! is unset on Linux without view module. Nov 11, 2020 compiler.r FIX: adds checks for persistent system/thrown values throughout the r... Jul 2, 2021 lexer.r FIX: issue #4730 (Using decimal pair leads to invalid values for pair... Nov 27, 2020 red.r FIX: issue #4889 (Driver Internal Error: Script Error : status needs ... May 14, 2021 run-all.r FIX: quick-test typo in code handling --binary Jul 25, 2020 usage.txt FIX: a typo. Nov 1, 2020 version.r Remove newline from version.r. Can't seem to do it directly in github. Nov 21, 2018 View code Red Programming Language Making a Red "Hello World" Running the Red REPL Running Red from the sources (for contributors) Contributing Git integration with console built from sources Anti-virus false positive License README.md Join the chat at https://gitter.im/red/red Windows build Windows build 2 macOS build Linux build ARMel build ARMhf build Red Programming Language Red is a new 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, while providing modern support for concurrency and multi-core CPUs. Red has its own complete cross-platform toolchain, featuring two compilers, an interpreter, and a linker, not depending on any third-party library, except for a Rebol2 interpreter, required during the bootstrap phase. Once complete, Red will be self-hosted. The Red software stack also contains another language, Red/System, which is a low-level dialect of Red. It is a limited C-level language with a Red look'n' feel, required to build Red's runtime library and be the target language of Red's compiler. More information at red-lang.org. Making a Red "Hello World" The Red toolchain comes as a single one-megabyte executable file that you can download from here for the big-3 platforms. 1. Put the downloaded red binary in the working folder. 2. In a code or text editor, write the following Hello World program: Red [ Title: "Simple hello world script" ] print "Hello World!" 3. Save it under the name: hello.red 4. From a terminal (works from DOS too), run it with: $ red hello.red 5. You should see the Hello World! output. 6. Want to generate a compiled executable from that program? $ red -c hello.red $ ./hello 7. Want to generate a compiled executable from that program with no dependencies? $ red -r hello.red $ ./hello 8. Want to cross-compile to another supported platform? $ red -t Windows hello.red $ red -t Darwin hello.red $ red -t Linux-ARM hello.red The command-line syntax is: red [command] [options] [file] [file] any Red or Red/System source file. If no file and no option is provided, the graphical interactive console will be launched. If a file with no option is provided, the file will be simply run by the interpreter (it is expected to be a Red script with no Red/System code). Note: On Non-Windows platforms, the REPL runs by default in CLI mode. But on Windows, the default is to run in GUI mode. To run it in the command line mode, invoke the red binary with the option --cli. [options] -c, --compile : Generate an executable in the working folder, using libRedRT. (development mode) -d, --debug, --debug-stabs : Compile source file in debug mode. STABS is supported for Linux targets. -dlib, --dynamic-lib : Generate a shared library from the source file. -e, --encap : Compile in encap mode, so code is interpreted at runtime. Avoids compiler issues. Required for some dynamic code. -h, --help : Output this help text. -o , --output : Specify a non-default [path/][name] for the generated binary file. -r, --release : Compile in release mode, linking everything together (default: development mode). -s, --show-expanded : Output result of Red source code expansion by the preprocessor. -t , --target : Cross-compile to a different platform target than the current one (see targets table below). -u, --update-libRedRT : Rebuild libRedRT and compile the input script (only for Red scripts with R/S code). -v , --verbose : Set compilation verbosity level, 1-3 for Red, 4-11 for Red/System. -V, --version : Output Red's executable version in x.y.z format. --catch : Stay in the REPL after the script finishes. --cli : Run the command-line REPL instead of the graphical console. --config [...] : Provides compilation settings as a block of `name: value` pairs. --no-console : Do not launch the REPL after console compilation. --no-compress : Omit Redbin format compression. --no-runtime : Do not include runtime during Red/System source compilation. --no-view : Do not include VIEW module in the CLI console and the libRedRT. --red-only : Stop just after Red-level compilation. Use higher verbose level to see compiler output. (internal debugging purpose) --show-func-map : Output an address/name map of Red/System functions, for debugging purposes. [command] build libRed [stdcall] : Builds libRed library and unpacks the libRed/ folder locally. clear [] : Delete all temporary files from current or target folder. Cross-compilation targets: MSDOS : Windows, x86, console (+ GUI) applications Windows : Windows, x86, GUI applications WindowsXP : Windows, x86, GUI applications, no touch API Linux : GNU/Linux, x86, console (+ GUI) applications Linux-GTK : GNU/Linux, x86, GUI only applications Linux-musl : GNU/Linux, x86, musl libc Linux-ARM : GNU/Linux, ARMv5, armel (soft-float) RPi : GNU/Linux, ARMv7, armhf (hard-float) RPi-GTK : GNU/Linux, ARMv7, armhf (hard-float), GUI only applications Darwin : macOS Intel, console-only applications macOS : macOS Intel, applications bundles Syllable : Syllable OS, x86 FreeBSD : FreeBSD, x86 NetBSD : NetBSD, x86 Android : Android, ARMv5 Android-x86 : Android, x86 Note: Running the Red toolchain binary from a $PATH currently requires a wrapping shell script (see relevant tickets: #543 and # 1547). Running the Red REPL 1. Just run the red binary with no option to access the REPL. ---== Red 0.6.3 ==-- Type HELP for starting information. >> 2. You can use it to test rapidly some Red code: >> 1 + 2 == 3 >> inc: func [n][n + 1] == func [n][n + 1] >> inc 123 == 124 Notes: * On Windows, the REPL runs by default in GUI mode. To run it in the command line, invoke the red binary as red --cli. * Wine has some issues with the GUI-Console. Install the Consolas font to fix the problem. Running Red from the sources (for contributors) The compiler and linker are currently written in Rebol. Please follow the instructions for installing the compiler toolchain in order to run it from sources: 1. Clone this git repository or download an archive (ZIP button above or from tagged packages). 2. Download a Rebol interpreter suitable for your OS: Windows, Linux (or Linux), Mac OS X, FreeBSD, OpenBSD, Solaris. 3. Extract the rebol binary, put it in the root folder, that's all! 4. Let's test it: run ./rebol, you'll see a >> prompt appear. Windows users need to double-click on the rebol.exe file to run it. 5. From the REBOL console type: >> do/args %red.r "%tests/hello.red" The 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. To see the intermediary Red/System code generated by the compiler, use: >> do/args %red.r "-v 2 %tests/hello.red" You can also compile the Red console from source: >> do/args %red.r "-r %environment/console/CLI/console.red" To compile the Windows GUI console from source: >> do/args %red.r "-r -t Windows %environment/console/GUI/gui-console.red" Note: 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). The -r argument is needed when compiling the Red console to make additional runtime functions available. Note: 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 .gitignore-sample file will ignore these generated files. Contributing If you want to contribute code to the Red project be sure to read the guidelines first. It 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. Satisfied with the results of your change and want to issue a pull request on Github? Make 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): >> do %run-all.r Git integration with console built from sources If you want git version included in your Red console built from sources, use this command: call/show "" ;-- patch call bug on Windows save %build/git.r do %build/git-version.r ;-- lookup git version if available do/args %red.r "-r %environment/console/CLI/console.red" ;-- build Console write %build/git.r "none^/" ;-- restore git repo status Anti-virus false positive Some anti-virus programs are a bit too sensitive and can wrongly report an alert on some binaries generated by Red (see here for the details). If that happens to you, please report it to your anti-virus vendor as a false positive. License Both Red and Red/System are published under BSD license, runtime is under BSL license. BSL is a bit more permissive license than BSD, more suitable for the runtime parts. About 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! red-lang.org Topics toolchain language programming-language gui interpreter native compiler repl red reactive-programming rebol Resources Readme License View license Releases 27 Simple GC Latest Nov 22, 2018 + 26 releases Packages 0 No packages published Contributors 53 * @dockimbel * @qtxie * @9214 * @PeterWAWood * @bitbegin * @greggirwin * @hiiamboris * @rcqls * @earl * @Oldes * @endo64 + 42 contributors Languages * Red 85.2% * Rebol 14.4% * C 0.2% * VBA 0.1% * Java 0.1% * Shell 0.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.