9fans archive / 2000 / 11 / 47 / prev next
From: rog@vit...
Subject: Re: [9fans] mash
Date: Fri, 3 Nov 2000 17:25:54 0000
leo caves wrote;
> the lack of adoption sends a confusing message.
> the fact that there is another command shell for inferno without
> these features seeemingly relegates the "make" functionality
> to another special purpose language.
i liked mash, in principle, but i thought its syntax was unnecessarily
complex, leaving behind some of the simplifications that rc had given
us, and adding expressions, for instance. limbo made it very easy to
provide loadable shell modules, but i thought that it should be
possible to do more with less.
i had already written most of an inferno shell before mash, so i dusted
it off, borrowed most of the good ideas from mash, and that became the
inferno shell. it's comparable in size to mash but simpler and more
versatile, i think. the syntax is very small, but still substantially
similar to rc's.
it should be quite possible to write a "make"-style dependency module
for it without changing the syntax at all.
the key being that it allows the passing around of fragments of
shell-script as values, so it would be perfectly possible to write a
built-in shell module that defined a command "dep" (dependency) that
might look something like:
dep x.dis : x.b {
limbo -g x.b
}
or:
dep %.dis : %.b {
limbo -g $stem.b
}
and a "mk" command to do the customary make-style dependency
evaluation, executing recipes as necessary.
in this scheme, you do lose the advantages of having a special syntax
for the make features (e.g. distinguishing between quoted and unquoted
wildcard chars), but the shell syntax isn't cluttered with stuff that's
essentially only good for one application, and only in the way
otherwise. swings and roundabouts.
i don't know how long mash will stay in the inferno distribution, once
i've plundered its "make" code and converted it to sh... but then i'm
completely biased, and probably wrongheaded about all of this as a
result!
cheers,
rog.