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
29
votes
2 answers

What are terminal and nonterminal symbols?

I am reading Rebol Wikipedia page. "Parse expressions are written in the parse dialect, which, like the do dialect, is an expression-oriented sublanguage of the data exchange dialect. Unlike the do dialect, the parse dialect uses keywords…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
17
votes
3 answers

Is there a overall explanation about definitional scoping in Rebol and Red

From the REBOL/Core Users Guide, and What is Red, I have learned that both Rebol and Red use definitional scoping. From the guide, I know it is a form of static scoping, "the scope of a variable is determined when its context is defined", and is…
Wayne Cui
  • 835
  • 7
  • 15
10
votes
3 answers

String searching in Rebol or Red

I'm interested in searching on a lot of long strings, to try and hack out a sed-like utility in rebol as a learning exercise. As a baby step I decided to search for a character: >> STR: "abcdefghijklmopqrz" >> pos: index? find STR "z" == 18 >>…
gnat
  • 101
  • 1
  • 6
10
votes
1 answer

Is it possible to write a Windows DLL in Red?

I'd like to write a plugin for some Windows application, and it must be a DLL. I'd really love to try doing it in a mix of Red & Red/System. But asking on Rebol&Red chatroom here on SO, I got mixed responses as to whether it is currently possible in…
akavel
  • 4,789
  • 1
  • 35
  • 66
8
votes
2 answers

|Red Programming Language| How to get Cookies from a Webpage?

I searched a lot on Google as well as Stackoverflow. I could not find How to get Cookies (or in general, The HTTP Headers)from a Webpage and then edit it and send it back? [I know how to make POST/GET requests using read/write but Cookies idk]
8
votes
1 answer

REBOL3 - what is the difference between the different branches?

What are the differences between the different Rebol 3 branches, especially with the new REN branch? Is it the platforms they'll run on, the feature set, code organization, the C standard compliance?
Maarten
  • 127
  • 1
  • 7
7
votes
2 answers

How to parse and translate DSL using Red or Rebol

I'm trying to see if I can use Red (or Rebol) to implement a simple DSL. I want to compile my DSL to source code for another language, perhaps Red or C# or both - rather than directly interpreting and executing it. The DSL has only a couple of…
guraaku
  • 205
  • 1
  • 7
7
votes
1 answer

type of literal words

I was reading Bindology and tried this: >> type? first ['x] == lit-word! >> type? 'x == word! I expected type? 'x to return lit-word! too. Appreciate any insights.
RAbraham
  • 5,956
  • 8
  • 45
  • 80
7
votes
1 answer

"How to apply Red to compile-time optimization of this Lisp code?"

This is a pattern of optimization in Lisp code that I want to achieve in Red: (defmacro compute-at-compile (x) `(+ ,(* pi 2) ,x)) (macroexpand '(compute-at-compile 1)) ; => (+ 6.283185307179586 1) How do I express this in Red? (I realize it may…
Jacob Good1
  • 176
  • 1
  • 6
6
votes
3 answers

Remove special characters from string in Red language

I want to remove all characters in a string except: - or _ or . A thru Z a thru z 0 to 9 space On linux command line, using sed I would do this: $ echo "testing-#$% yes.no" | sed 's/[^-_.a-zA-Z0-9 ]//g' Output: testing- yes.no How can I achieve…
rnso
  • 23,686
  • 25
  • 112
  • 234
6
votes
1 answer

How do I use the Red cURL binding?

I am just getting started with Red and I need help to get the cURL binding working. The cURL link from the main red-lang site takes you here http://red.esperconsultancy.nl/Red-cURL/dir?ci=tip But there is only a small example using Red/System hence…
redbot
  • 63
  • 5
6
votes
1 answer

Pointers to an 'array' in Red/System

How do I make a pointer to the first element in an array in Red/System? Assigning an address to a pointer is no problem: my-integer: 1 ptr: declare pointer! [integer!] ptr: :my-integer The array is declared. buffer: as int-ptr! allocate 1009 *…
iArnold
  • 333
  • 2
  • 10
5
votes
1 answer

Rebol/RED parsing. Save ASCII codes from parsed string to variable?

I stumbled into RED language the other day and spend (more or less literally) the last 24h "learning" it. I exhausted my googling skills trying to find solution for a simple problem that just evades my skills and logic, so hopefully somebody here…
5
votes
1 answer

Simpler way to do repeated `back back series`

Sometimes, I tend to do next next a (repeatedly) to get at a particular element. This works well when you need 2 or less traversals. However, it gets cumbersome pretty soon. A loop is too much overhead for this simple case. Fortunately you can do at…
Geeky I
  • 751
  • 6
  • 22
5
votes
2 answers

How to Convert a Red/Rebol String into a Series

I would like to know if there is a way to convert a string into a series. I'm trying to extract data using parse, and I want to break some of that captured data down into smaller fragments so that I can do IF, CASE or SWITCH statement. Below is a…
1
2 3
16 17