Red's main features
As a programming language, Red embraces nearly all paradigms:
- Imperative: Providing everything needed for controlling code execution and error-handling (see Chapter 4, Code Controlling Structures and Chapter 5, Working with Series and Blocks)
- Functional: With functions as first class values (see Chapter 6, Using Functions and Objects)
- Object-oriented: Complete with inheritance, but not class-based (see Chapter 6, Using Functions and Objects)
- Concurrency: With async task support and an actor model (from v 0.9.0)
- Symbolic: Being able to manipulate its own code as if it was plain data (all chapters)
- Reactive: Included in the GUI (Graphical User Interface) system (see Chapter 9, Composing Visual Interfaces and Chapter 10, Advanced Red)
Aside from REBOL and LISP, Red has taken inspiration from the following:
- Forth and Logo for its syntax
- Lua, for its capabilities as an embedded language, and its JIT (Just-In-Time) compiler
- Self, for its prototype object-model
- Scala, for its type inference engine and compilation
Although it can be statically compiled, Red has a graphical REPL console (Read Evaluate Print Loop) like other dynamic and scripting languages, to experiment with code interactively. We will explore this console in Chapter 2, Setting Up for Development.
In contrast to REBOL, which is an interpreted language only, Red also compiles to native code through Red/System, thus achieving much better performance, something like Crystal compared to Ruby. Compared to C, at this moment Red/System is 2-4x slower.
Portability
Red runs in the Windows, Linux, Android, macOS, and FreeBSD environments in a 32-bit version (the 64-bit version is planned) with cross-compilation capability. Furthermore, it runs on ARMv5 processors and on the Raspberry Pi and Arduino boards.
Like a Swiss Army knife
The versatility of the Red platform makes it suitable for apps on the entire spectrum, such as:
- High-level scripting (for example, glue code such as Lua)
- Web apps
- GUI desktop applications
- Android apps (from Version 0.7 onward)
- 2D games
- Data processing
- Grammar parsing and constructing specialized languages
- Network/system programming, IoT devices programming, robotics