On Wed Apr 19 20:05:43 CDT 2006, [EMAIL PROTECTED] wrote:
> i had es in mind when i wrote the inferno shell (vita nuova's, not the
> original tiny shell).
the inferno shell is quite nice. good job.
> i thought then that some of the es concepts were nice, but the whole complete
> functional language
> thing was overkill and didn't get one very far (why make it possible to
> redefine
> core shell concepts such as the pipe? - it just confuses everyone if you make
> use of this.)
for starters, it makes a nice paper. ;-) also it was used for the es
debugger. i never found it confusing
(due to lexical bindings) but never made use of it, either.
> for instance:
> > ; if {condition1} {body1} {condition2} {body2}
>
> is not implemented by the core inferno shell, but by an externally loaded
> module (std).
>
pretty nice!
>
> the main problem is that a shell of this style
> has no concept of storage of any item but a string (ok, a list of strings),
> so it is not
> possible to manipulate other data items directly. [...]
>
> i don't think it's possible to address these problems without
> breaking the simplicity of the whole thing; the moment you
> introduce lexical binding, differently typed variables, etc,
> a whole raft of other issues starts to drift into view.
> another kind of language might begin to help, but that's another
> story.
i think you're right. i wrote a shell in college that was similar to rc, but
lists were allowed to contain lists. even this proved to be unworkable, as
"for(i in *.c *.h) echo $i" would print
a.c b.c
x.h y.h z.h
and not what was expected.
>
> just having shell blocks as values is a big win, in my book.
> i don't think it would be hard to do this in rc.
i don't think it would be hard, but it would break td's basic design of
compiling
everything at input time. one way to thinking of es' rewriting is that it is
like rc's bytecode exposed. i don't think it really hangs together though. is
this
a | b
or this
%pipe {a} 0 1 {b}
es code?
also, what does a traditional rc function do with a shell block?
>
> > a trivial grep module could make
> > ; grep {^fn} *.[ch]
> > acceptable syntax.
>
> i'm sorry, i don't see why this is preferable to the original.
> it has the same number of characters.
it doesn't! i didn't intend to imply that it did. it was a trivial example.
- erik