So I've been thinking about making a JS-NATIVE variant which makes it so you can write WebAssembly directly as the body of a function.
Looking at the WebAssembly Text Format, it seems Ren-C is rather well-geared to be able to just LOAD it.
(module
(table 2 funcref)
(func $f1 (result i32)
i32.const 42)
(func $f2 (result i32)
i32.const 13)
(elem (i32.const 0) $f1 $f2)
(type $return_i32 (func (result i32)))
(func (export "callByIndex") (param $i i32) (result i32)
local.get $i
call_indirect (type $return_i32))
)
It's cool to be able to have that "just work" and wind up with a code format that you can manipulate, compose, process, analyze... all using mechanisms that are a sunk cost.
Historical Rebol didn't have $var-words
and tu.ple
(Redbol allows dots in names, so something like i32.const
would be legal, but you'd have no particular conveniences to pick it apart.
I've seen some examples where the symbols have more embedded $ signs, like $FUNCSIG$ii
:
(module
(type $FUNCSIG$ii (func (param i32) (result i32)))
(import "env" "puts" (func $puts (param i32) (result i32)))
(table 0 anyfunc)
(memory $0 1)
(data (i32.const 16) "Hello World\00")
..........further text....
..........
It occurs to me that we can allow this--kind of like how we allow embedded apostrophes--or apostrophes at the tail of words.
>> word: first [f$]
== f$
>> word? word
== ~true~ ; anti
>> to var-word! word
== $f$
It's ugly but if it doesn't create any mechanical paradoxes or contradictions.
What can't be legal is things like $
or $$
as a WORD!, because you start down a rabbit hole of asking if $$
is its own WORD! or the VAR-WORD! variation of $
. So you can't have a leading $ followed by another $. But other limits are arbitrary...and here's a reason to allow them.