Questions tagged [red]

The Red language is inspired by the interpreted language Rebol, but is compiled and hence has a wider range of application...from device drivers to high-level purposes. It is functional, imperative and symbolic, with prototype-based object support. Like LISP and Rebol, it is homoiconic and thus its own meta-language. It is both statically and JIT-compiled to native code, with strong support for concurrency and parallelism (actors, parallel collections).

Red is a paradigm-neutral homoiconic language.

Red has a low memory footprint, and has a low disk footprint (< 1MB). Red seeks to be a "full-stack" language whose methodology is independent of any other toolchain. It's goal is to compile that which can be known ahead of time, JIT-compile that which cannot, and embeds a small interpreter into its executables to handle constructions which are not amenable to any compilation.

As an intermediate language (IL) Red uses a C-like language called . Red/System's parser is reused from Red itself...and for which it has its own code generators. The Red executable is able to build Red/System files directly (*.reds) as well as Red files (*.red), and Red/System code may be embedded freely in Red code.

248 questions
5
votes
4 answers

How do I run an Android app I've written in Red?

When I enter this in the Windows CMD... red -c -t Android hello.red ...Red outputs a file called hello with no filename extension. If I transfer this file to my Android device, it doesn't know what to do with it. What additional steps must I follow…
WiseGenius
  • 226
  • 2
  • 9
5
votes
3 answers

Red language console error: libreadline.so.6: cannot open shared object file

I'm new to the Red programming language. I tried to test it by downloading the Linux binary. But when I execute it on the console, I get an error that says: root@xxx-linux:/home/xxx/Downloads# ./red-042 Pre-compiling Red…
gtmaroc.ma
  • 174
  • 1
  • 1
  • 8
5
votes
1 answer

Read non success http data in rebol

Is there a way to read non success http data, for example for a 404, in Rebol? When open gets a non success http response code for an URL it fails with an error, but I would like to read the response instead.
rnyberg
  • 68
  • 5
4
votes
3 answers

Differences between Red's 5 function types, and why does it distinguish them?

In Red, there are functions of datatypes function!, op!, native!, routine! and action!. What are the differences between them? As far as I know function! is used for user-defined functions and op! for infix operators, and routine! for functions…
nickkoro
  • 374
  • 3
  • 15
4
votes
1 answer

What's the inverse of block: load text in rebol / red

Let's say I have some rebol / red code. If I load the source text, I get a block, but how can get back the source text from block ? I tried form block but it doesn't give back the source text. text: { Red [Title: "Red Pretty Printer"] …
user310291
  • 36,946
  • 82
  • 271
  • 487
4
votes
1 answer

Sandbox Red function

I'm planning to write an application for managing a game-server in Red. It should be extendable by using interpreted Red scripts. Now, I want to set restrictions for this scripts (I want to "sandbox" them) and remove specific functionality like I/O,…
nickkoro
  • 374
  • 3
  • 15
4
votes
2 answers

How do I access serial port in RED?

I need to access some weighing machines via serial port. How could I red/write data from/to it using the RED Programming language ?
4
votes
3 answers

Parse string to find first duplicate character - functional vs. prodecural coding style

I want to parse a string to find the first N duplicate characters found in a (character, n) set. For example, for "ozzllluu" and sets ("u" => 2), ("d" => 2), ("l" => 3), and ("r" => 3)... I would want to find "lll", because it is 3 characters and…
OneArb
  • 453
  • 2
  • 14
4
votes
2 answers

What is the difference between `context` and `object`?

In Rebol 3, there are the functions object and context. What's the purpose of the difference? Note : for reference, in red, both are the same, and object doesn't exist in rebol 2 Context: no pun intended Initially, I was wondering why we had context…
Geeky I
  • 751
  • 6
  • 22
4
votes
2 answers

What's the difference between `a: [b 1]` and `a: [b: 1]`, in red?

What is the difference between a: [b 1] ; and a: [b: 1] both give the same results for > a/b 1 they differ for a/1 though. When do you use what? And the 2nd is a set, what is the 1st?
Wolfram Kriesing
  • 1,527
  • 10
  • 7
4
votes
2 answers

red/rebol: Subtracting dates returns days, how can I change that?

Playing with the date type, I was wondering, why a subtraction always returns days, how can I make it return minutes (or seconds, etc.), which could be possible in the second example >> 24-dec-2016 - now == 82 >> 24-dec-2016/0:00 - now == 82 is…
Wolfram Kriesing
  • 1,527
  • 10
  • 7
4
votes
2 answers

Convert a block of strings to a block in Red

How to convert a block of strings into a block? To change this: keep rejoin['circle " " coord " " 5 " "]]] ["circle 10x10 5 " "circle 20x20 5 " "circle 30x30 5 "] to this: [circle 10x10 5 circle 20x20 5 circle 30x30 5] I want to change it so it…
Mufferaw
  • 41
  • 3
4
votes
1 answer

When do Red looping structures require interpretation

Under what circumstances does a looping construct require evaluation by the interpreter in Red? Which looping constructs do not? Update (4/20/2015): Below is an small program I wrote to demo the language to some students. Two of the functions…
iceflow19
  • 752
  • 4
  • 12
4
votes
1 answer

Pass by reference in Red routines

So I'm currently in the process of migrating a descent sized program from Rebol 3 to Red. Said program relies on a large binding to a C library (clang). I have rewritten the binding portion in Red/System, and am interfacing that code with Red…
iceflow19
  • 752
  • 4
  • 12
4
votes
2 answers

Accessing runtime functions from Red/System

So the issue came up while experimenting with marshaling values back and forth between Red and Red/System. I would like to access the guts of an object passed to a routine. I had noticed that there are functions in the Red Runtime for handling…
iceflow19
  • 752
  • 4
  • 12
1
2
3
16 17