Skip to content

g9020/Red

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 a modern support for concurrency and multi-core CPU.

The language is in its early bootstrapping phase. The Red/System low-level DSL is the first focus. It is a limited C-level language with a REBOL look'n feel, required to build Red's runtime library. More information on red-lang.org.

Running the Red/System hello script

The compiler and linker are currently written in REBOL and can produce Windows, Linux, Syllable, Android and Mac OS X executables. So, for now, a REBOL/Core binary is required to compile Red/System programs. Please follow the instructions for installing the compiler tool-chain:

  1. Clone this git repository or download an archive (Downloads menu).

  2. Download a REBOL interpreter suitable for your OS: Windows, Linux, Mac OS X, FreeBSD, OpenBSD, Solaris

  3. Extract the rebol binary, put it in red-system/ folder, that's all!

  4. Let's test it: run ./rebol, you'll see a >> prompt appear. Windows users need to click on the rebol.exe file to run it.

  5. Type: do/args %rsc.r "%tests/hello.reds", the compilation process should finish with a ...output file size message.

  6. The resulting binary is in red-system/builds/, go try it! Windows users need to open a DOS console and run hello.exe from there.

The %rsc.r script is only a wrapper script around the compiler, for testing purpose. It accepts a -v <integer!> option for verbose logs. Try it with:

>> do/args %rsc.r "-v 5 %tests/hello.reds"

Cross-compilation support

Cross-compilation is easily achieved by using a -t command line option followed by a target ID.

Currently supported targets are:

Target IDDescription
MSDOS
Windows, x86, console-only applications
Windows
Windows, x86, native applications
Linux
GNU/Linux, x86
Linux-ARM
GNU/Linux, ARMv5
Darwin
Mac OS X Intel, console-only applications
Syllable
Syllable OS, x86
Android
Android, ARMv5

For example, from Windows, to emit Linux executables:

>> do/args %rsc.r "-t Linux %tests/hello.reds"

From Linux, to emit Windows console executables:

>> do/args %rsc.r "-t MSDOS %tests/hello.reds"

About

Red Programming Language

Resources

Stars

Watchers

Forks

Packages

No packages published