[REBOL] Re: Rebol Product Suggestion.
From: g:santilli:tiscalinet:it at: 24-Jun-2001 23:12
On 24-Giu-01, you wrote:
JN> IMHO the game is about simply raising the costs high enough
JN> that most people won't bother. That's why I suggest the
JN> Nice! (But you didn't show how that change would affect the
JN> shrouded copy! ;-)
Left as an exercise to the reader
JN> I can think of all sorts of interesting benchmarks for the
JN> behavior of CLEAR, COPY, and APPEND (the hidden allocations)
JN> but the surface-level trade-off would seem to be a variation
JN> on the classical time-for-space. If an abnormally large
JN> result occurred early in a long-running process, then option
JN> two would keep that amount of memory tied up and subsequently
JN> unused forever (i.e., until REBOL quits).
I think so...
JN> That being the case, does
JN> result: make string! some-normally-large-enough-size
JN> sound like a middle-ground compromise to you?
Yep. But it's not always that easy to choose
some-normally-large-enough-size in a way that makes everyone happy.
(Of course. :)
Anyway, I just thought that it would have been useful to point out
that there are many possibilities to choose from, and your
analisys will surely help choosing!
JN> Agreed. I had been thinking about the "full blown" problem of
JN> taking an arbitrary REBOL source file and trying to shroud
JN> it. Unfortunately, the task of figuring out which words were
JN> my words versus system words (versus somebody-else's words?)
JN> began to look quite hairy given the possibility of DO and
JN> BIND appearing in the code.
I think an acceptable solution could be the following:
* the programmer puts all the code together in a huge script.
* the tool loads the script and checks words versus what is in
system/words; if a word is in system/words, it is put in the
list of words to be aliased.
* the tool spits out some unreadable and tricky code to alias the
words in the list.
* all the other words are simply substituted.
What is more difficult is to find a way to automatically substitute
simple expressions or literal values with trickier ones. I think
this will need at least some human assistance. Any idea?
JN> ply: func [print [series!] = [string! char!] /local
JN> probe word? ] [ probe: copy word?: "" foreach to
JN> print [ repend probe [ word? to ] word?: = ] probe ]
This is nice, too. But I'm afraid it would be almost impossible to
do automatically... (as you point out, too)
Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/