News for hackers. Stuff that matters.
Re:Red: A programming language inspired by REBOL by Bluestein on Wednesday July 14, 2021 @01:06PM (#27835426)
REBOL was so far ahead of its time ...
Re:Red: A programming language inspired by REBOL by vincent-toups on Friday July 16, 2021 @01:24PM (#27858702)
As an old Lisp/Scheme guy all I can think whenever I try to figure out what is going on with Rebol/Red is "What a mess."
Re:Red: A programming language inspired by REBOL by ducktective on Friday July 16, 2021 @02:52PM (#27859807)
Can you please elaborate? ;) As a person who has 0 knowledge on the likes of PROLOG, LISP, etc...What makes LISP and LISP-like languages so great? I tried to search YouTube on the merits of LISP or this notion of "data as code" but nothing tangible came up... I mean LISP is one of the oldest languages with really weird features w.r.t to C-like languages but in practice we only see C-likes...even Rust is not so different from this family of languages...
Re:Red: A programming language inspired by REBOL by chriswarbo on Friday July 16, 2021 @04:06PM (#27860643)
> I mean LISP is one of the oldest languages with really weird features w.r.t to C-like languages but in practice we only see C-likes

Scripting languages are much closer to Lisp than to C (e.g. compare Python to Racket).

IIRC Ruby, Javascript and Smalltalk (the latter inspiring a lot of OOP languages) were all explicitly designed to be like Lisp.

Re:Red: A programming language inspired by REBOL by freemint on Saturday July 17, 2021 @02:12PM (#27867609)
I gave a lightning talk in (German) about meta programming and equivalence of code and data in PicoLisp by example. 16:16 https://media.ccc.de/v/froscon2018-2322-lightning_talks#t=97...

It should give you place to get started. The cliff node what I did is the I wrote a function that replaces things in a list of lists/a tree and used that rewrite the definition of the function to make it more readable. While it is an toy example I hope it helps.

Re:Red: A programming language inspired by REBOL by yawn on Friday July 16, 2021 @02:05PM (#27859220)
What mess do you mean? The language, what happened to the language because of Rebol Technologies, or something else?
Re:Red: A programming language inspired by REBOL by xvilka on Friday July 16, 2021 @01:43PM (#27858941)
I think modern concept-equivalent would be Racket with its visual features out of the box. In practice, though, it's unsustainable because of different OS graphics stack, complexity of frameworks like Qt and GTK that themselves changing often, the speed of changes in underlying draw technologies, etc.
Re:Red: A programming language inspired by REBOL by 9214 on Friday July 16, 2021 @08:13PM (#27862568)
Re:Red: A programming language inspired by REBOL by jibbit on Friday July 16, 2021 @01:20PM (#27858643)
One of my modest ambitions is to finally understand how Scopes work in REBOL
Re:Red: A programming language inspired by REBOL by greggirwin on Friday July 16, 2021 @03:21PM (#27860155)
One of our team summed it up very nicely: Pragmatically, this design notion comes from Red being a data format first (code is data and data can be used as code). To mimick scoping at data level, context has to be implicit. As a consequence, any block of code e.g. [take the spoon] can be passed around, evaluated on demand in any place, used in user-defined custom loops, without losing the original meaning even if all it's words `take`, `the` and `spoon` were defined differently in those loops or other functions.

Rebol's designer called this "definitional scoping". What it means is that where a word (variable) exists is important. The "where" part leads to https://github.com/red/red/wiki/%5BDOC%5D-Why-you-have-to-co... and is one of the big things that messes with your head when you come to Red from other langs. :^) For many people this stays invisible forever and things just work. But it doesn't take much for people to step off the ledge and into deep water, because things look so easy and it seems like you should be able to just pass blocks around and have everything work magically. It's internally consistent in how it works, but that's hard to see without tooling we have yet to build.

Re:Red: A programming language inspired by REBOL by wizzwizz4 on Friday July 16, 2021 @05:20PM (#27861367)
Oh, so it's like Rust's `macro_rules!` identifier rule?

Rust's `macro_rules!` macros operate on ASTs, so the `x` inside a macro definition is different to the `x` in the scope where the macro is used, even though the textual representation of the identifier the macro inserts into the place it's used might be identical. This means that:

  macro_rules! add_two {
      ($i: ident) => {
          let x = 2;
          $i += x;
      }
  }

  fn main() {
      let mut x = 5;
      add_two!(x);
      println!("{}", x);
  }
appears to become:

  fn main() {
      let mut x = 5;
      let x = 2;
      x += x;
      println!("{}", x);
  }
but it still prints 7, not 4, because they're two different `x`s. (Of course, Red has first-class metaprogramming, so it's a lot better.)
Re:Red: A programming language inspired by REBOL by greggirwin on Friday July 16, 2021 @05:53PM (#27861668)
Something like that, yes. Red has macros as well, with a key difference being that at compile time, for all macros, there is no runtime context to bind to. Sometimes this helps, sometimes it's a limitation. For example, interpolation at runtime can be tricky, but isn't as flexible if done with macros.
Re:Red: A programming language inspired by REBOL by macintux on Friday July 16, 2021 @01:08PM (#27858452)
Any recommended reading?
Re:Red: A programming language inspired by REBOL by sreekotay on Friday July 16, 2021 @01:22PM (#27858665)
The main site pretty good.

http://www.rebol.com/docs.html

Note, OP likely talking about Rebol 2.

Rebol 3 and Red were/are (sort of) forks...

Re:Red: A programming language inspired by REBOL by snvzz on Friday July 16, 2021 @07:07PM (#27862169)
So was AmigaOS.

Carl Sassenrath apparently got a knack for pulling that off.

Re:Red: A programming language inspired by REBOL by Bluestein on Saturday July 17, 2021 @02:58PM (#27867945)
> So was AmigaOS.

Absolutely.-