Installing Red locally





Here

is a

how to install Red locally:

Download the correct Red binary version for your computer from here (takes only a few seconds, it's less than 1MB). Save into a suitable folder. For Windows users, run it by double-clicking on the Red binary file. It will then automatically build the Red GUI-console. Next time you double-click on the file, the GUI-console will automatically open. For Linux/OSX users, you need to open a terminal app to be able to run Red. Once you have opened the terminal app, change to the directory in which you saved Red. Now do a: chmod u+x <red-binary> which will make sure that Red can be run on your computer. After that simply run Red using ./<red-binary> . This will build the Red console. Next time you run Red, the console will automatically open.



(*) We have a temporary dependency on libcurl3 for Linux platform, so in case it is not installed or if you are running a 64-bit Linux, please check extra instructions from our download page. (*)



Making a "Hello World"





Red comes with a interpreter in addition to the compiler, which can be easily accessed using the built-in REPL. Calling Red binary with no argument will open the console and allow you to interact with the language in live:

red>> print "Hello World!" Hello World!



If you are running Red from Windows, you can also use the built-in GUI system and make a more appealing HelloWorld:

red>> view [text "Hello World!"] If you are running Red from Windows, you can also use the built-in GUI system and make a more appealing HelloWorld:

red>> view [name: field button "Hi" [print ["Hi" name/text]]]





Compiling a "Hello World"

Red [Title: "Simple hello world script"] print "Hello World!"

$ red -c hello.red $ ./hello or from DOS: > red -c hello.red > hello

$ red -c -t Windows hello.red $ red -c -t Darwin hello.red $ red -c -t Linux-ARM hello.red

MSDOS : Windows, x86, console (+ GUI) applications Windows : Windows, x86, GUI applications WindowsXP : Windows, x86, GUI applications, no touch API Linux : GNU/Linux, x86 Linux-ARM : GNU/Linux, ARMv5, armel (soft-float) RPi : GNU/Linux, ARMv5, armhf (hard-float) Darwin : macOS Intel, console-only applications macOS : macOS Intel, applications bundles Syllable : Syllable OS, x86 FreeBSD : FreeBSD, x86 Android : Android, ARMv5 Android-x86 : Android, x86

Compiling a GUI "Hello World"





hello-gui.red

Red [Needs: 'View] view [text "Hello World!"]

hello.red

hello-gui.red

Needs: 'View

View

Going further...

step by step guide ofDone! No installer, no setup, no dependencies(*)! What, that's all? Yes, there was a time when software used to be done right, that's what we aim at bringing back. ;-)Now try something more sophisticated:Yes, GUI programming can beeasy! See more about GUI capabilities in this GUI release post and have a look into the View reference documentation You can also compile your Red programs and get a single binary with no dependencies. You don't have to install anything else, the Red binary you have downloaded already contains a complete toolchain for native compilation! Here is how to use it:1. In a code or text editor, write the following Hello World program:2. Save it under the name: hello.red3. From a terminal (works from DOS too), type:4. You should see the Hello World! output.5. Want to cross-compile to another supported platform?Cross-compilation done right: checked! ;-)Here is a list of currently supported platforms:Save the following code infile:Compile and run it the same way as the firstscript (just replace the filename with). Notice that compiled GUI apps requires adeclaration in the Red header block. This tells the compiler to import themodule, which contains all the GUI supporting code.You can now continue your journey discovering all the great features of Red through the following links:Happy coding/hacking and have fun...that's the whole point! ;-)