[TUHS] TUHS Digest, Vol 32, Issue 8

John Cowan cowan at ccil.org
Sat Jun 10 16:28:33 AEST 2006


Evan de Riel scripsit:

> Q:  ... do you think the idea of "one tool doing one job" has been  
> abandoned? ...
> A:  Those days are dead and gone and the eulogy was delivered by Perl.
> 
> I think his point is that what Perl and its friends--the other high- 
> level, interpreter languages like Python, Ruby, and maybe (ick) PHP-- 
> have gotten to the point where they can be used as a single framework  
> for writing short, ad-hoc programs in these languages that replace  
> combinations of the whole mess of Unix utilities like grep, cat, sed,  
> awk, uniq, sort, column, rs, head, tail, and maybe even more complex  
> tools like wget or hexdumps.

Well, I don't have a problem with replacing the shell-and-utilities
framework with a more consistent one.  The trouble is that the essential
idea of that framework, what I called "coarse-grained dataflow"
in the last posting, and which has been called "plumbing" since the
earliest days, gets lost in the process.  Perl-level programming is only
incrementally better than C-level (admittedly the increments are good
ones, like garbage collection and simple strings and dynamic typing).

The only consistent framework I know of that preserves plumbing as a
functional programming approach is scsh <http://www.scsh.net/>, and much
as I love Scheme personally, it's just too alien to mainstream ways of
thinking to have a real chance of survival as anything but a niche of
a niche.

What I'd really like to see is something that merges Lua and rc(1), a
lightweight but powerful language with a lightweight but powerful shell,
in a clean way.  I even messed around with constructing a unified Yacc
grammar to use them jointly, with the notion that a top-end parser could
compile the hybrid into pure Lua using a Posix library.  But I got bogged
down and never went back there.

Lua might be *too* lightweight, though:  Python comes with a big library
of useful stuff, is a fair approximation to Lisp (as Lua is also), and
could perhaps be transmogrified into a shell somehow, given how dynamic
everything in Python is (even the variable and function declarations
are really executable statements).  I'll think on it further.

-- 
Barry gules and argent of seven and six,        John Cowan
on a canton azure fifty molets of the second.   cowan at ccil.org
        --blazoning the U.S. flag               http://www.ccil.org/~cowan



More information about the TUHS mailing list