[REBOL] Threading continued
From: maarten:vrijheid at: 29-Jan-2004 17:05
I have got some code and some questions. I have a working version of
'eval a function that takes a block of code and evaluates it like 'do.
Big deal? Well... it responds to a 'rest word, giving you the restof the
block to be evaluated and the value of the last evaluated expression.
So: eval [ 10 + 10 join "a" "b" rest 20 print "howdy" ]
>> [ "ab" [ 20 print "howdy"]]
Note that the second item (the rest of the code) is the position in the
original code, so a ' head on that gives you the original code back.
Anyway.... this interruptable evaluator run on a block with 10.000 now
invocations 3.5 times slower than do. That's slow, but probably fast
enough for most things. And Moore's law and all...
On top of such an eval function you can easily build a co-op threading
engine. Instead of doing a script you would 'eval it, making it four
times slower but concurrent.
And it would be easy to add all sort of utility threads out-of-the box
for newbies, like a dns reader thread that returns the value to a
function on completion etc.
Question: is this a thing any of you want despite the performance hit of
It is easy for me to get there, but I need to know if there is anybody
who'd like to see it available.