One of the things which surprised me when I first looked into Ren-C was the number of WORD variants it has. By my count, this includes:
- plain WORD
- :GET-WORD
- SET-WORD:
-
@THE-WORD
* - ^META-WORD
- &TYPE-WORD
- #ISSUE
- 'QUOTED
- ~ANTIFORM~
- …and probably more that I’ve forgotten.
* monospaced so Discourse doesn’t think it’s a ping
Now, in many ways this is perfectly expected for a language like Ren-C. Firstly, dialecting means we value having as many syntactic options as possible. Secondly, Ren-C has a lot of different kinds of values — plain, quoted, anti and quasi, and now bound and unbound versions of each — and most of these words are simply making it easier to deal with that huge variety.
But, on the other hand, I feel we’re starting to encounter some problems with the current way of doing things. Most notably:
- None of this is compositional. When we run into a situation where we’d like to, say, have a word which is both META- and THE-, it’s impossible.
- Some dialects would like to use words outside this fixed inventory. For instance, it would be nice to have $WORDs to use in a shell dialect.
The root cause of both is the same: the inventory of word-like datatypes is hard-coded into the interpreter. If you want to use something outside that set, you can’t, no matter how similar to the existing types it may seem.
I can imagine a hypothetical design which would avoid this. This would allow some characters to be freely added to the beginning and end of words — let’s call those special characters ‘sigils’, like in Perl. Every combination of sigils would then specify a separate datatype. So you would still have :WORDs and ^WORDs and ~WORD~s, but also $WORDs and ^@WORDs and ~#WORD&s and whatever else you could imagine. This would quite easily solve both of the problems I mentioned.
One might even contemplate generalising this ‘sigil’ idea to non-word types. We already have {GET,SET,THE,META}-{BLOCK,GROUP}s, so it would make sense to allow arbitrary sigils on blocks and groups too.
Unfortunately, I’m not sure this would work with the current design of Ren-C. At the moment, there is currently a hard maximum of (as I recall) 256 possible datatypes, whereas this proposal obviously allows for an infinite amount of datatypes. However, I do think it’s at least worth thinking about, for the simple reason that it would give us a lot more flexibility than we currently have.