Apologies for butting into this discussion as someone completely new to the project, but I think I have something worth mentioning in this context:
Specifically, I’ve recently been looking into how scoping is implemented in R. I’m no R expert, but my understanding is that scopes in R are first-class values — just a certain kind of object expressing a map from variables to values. To implement lexical scoping, each scope has a pointer to a parent scope.
What’s quite interesting about R is that, like Rebol, it extensively uses unevaluated expressions as a substitute for macros. The implementation is different — putting it in Lisp terms, everything in R is an fexpr — but the end result is reasonably similar. To my understanding, each expression has an associated scope, and by manipulating the scope one can achieve some quite remarkable things (e.g. as done by the tidyverse).
So, in that light, here’s something I came up with the other day: a Rebol-like language where, instead of each word being bound to a variable, we have each block being bound to a scope. This does sacrifice a little bit of flexibility, since individual words can no longer be re-bound — instead, all words with the same spelling must be re-bound at once. But this is probably a desirable feature. And it preserves the much-vaunted ‘definitional scoping‘, since functions can still modify the scopes of blocks passed as arguments. Indeed, this may even make it easier to rebind words, since one can simply make a new scope and set its parent to the previous scope!
That being said, I haven’t very extensively used Rebol (or for that matter Red or Ren-C), and there’s probably stuff I’m missing here. Do you have any thoughts on this?