[REBOL] Re: REBOL Cookbook in Beta
From: greggirwin:mindspring at: 2-Sep-2003 17:25
Hi Mike,
Thanks for the thoughts! That's exactly the kind of thing I'm trying
to figure out. It's easy enough to create a REBOL script that will
take the entire command line and do all the work itself, or with other
REBOL scripts, basically becoming its own shell with a supporting pipe
dialect. The hard part is how to intersperse other system tools in
that pipeline if you want.
I'm not sure if you can use the shebang approach for general script
usage in a pipeline with REBOL (simple redirection is easy enough, as
is CGI). I seem to recall that my initial attempt at that failed under
Windows. If you can, then it's a simple matter of writing scripts to
work in that environment (i.e. using INPUT and PRINT).
MJM> ...what *is* that paradigm or structure that would
MJM> provide the clean utility of a pipe ? Perhaps
MJM> this is best implemented as an enhancement to REBOL,
MJM> as I believe the idea of a pipe is *very* elegant
MJM> and conducive to problem-solving in a way
MJM> that is very light and natural to understand.
MJM> Maybe the way ports are implemented in REBOL would
MJM> provide a means to implement pipe-like functionality.
I think a dialect is the way to go, because you could do so much with
it. Each app could have its own dialect, basically replacing command
line options, so you could string together long chains of commands
that were easy to understand.
One problem I have is that I'm torn. On one hand, I think being
compatible with standard *nix utilities, and being able to mix them
with REBOL scripts in a pipeline, would be great. On the other hand,
REBOL can easily deal with more structured data that is easier to work
with, richer in meaning, etc. and just making things REBOL functions
is conducive to using them in other scripts, but going the more "pure
REBOL" route isn't going to help many *nix people see its potential or
benefit from it.
Thanks!
-- Gregg