[FoRK] Should Exist: a new UNIX shell

Jeff Bone <jbone at place.org> on Wed Jun 6 07:06:47 PDT 2007

On Jun 5, 2007, at 9:30 PM, Russell Turpin wrote:

> Jeff Bone:
>> In fact, the shell can be a *wonderful* functional programming  
>> tool. Idempotency, monadic effects, etc... really quite  
>> sophisticated pipelines on the  command line.
>
> But that really is "on the line." In the large, it's hard to imagine
> languages that encourage more side effects and subtle
> environmental dependencies than shells. Is that necessary?
> Or can it be cured?
>
> Don't know...

Au contraire, most of the kind of thing I tend to write a lot of has  
few side effects --- big pipeline stuff.  As for environmental  
dependencies, true that;  but that can be mitigated somewhat.   
Environment variables are overused typically, and *not* using them is  
easily accomplished;  side-effecting through env vars is a bad idea  
regardless in shell scripts, use local vars and write shell functions  
as pipeline elements, pretend "echo" is equivalent to return, think  
of functions as generators, and figure out better ways to pass status  
than actual UNIX return values whenever possible.  The rest of the  
environment --- i.e. the filesystem --- can be managed fairly easily  
managed, but *most* of the problem there could be ameliorated with a  
decent module system and some conventional "personal environment  
setup" stuff.

I have a sort of pseudo-module system for bash that I use, but  
something better is really needed to allow stuff to scale up...

jb



More information about the FoRK mailing list