Re: [dwm] problem with dmenu3.1

From: Sander van Dijk <a.h.vandijk_AT_gmail.com>
Date: Wed, 23 May 2007 23:03:10 +0200

On 5/23/07, Marek Bernat <marek.bernat_AT_gmail.com> wrote:
> On 5/23/07, Sander van Dijk <a.h.vandijk_AT_gmail.com> wrote:
> > That's how it used to be, and I do believe that represents the
> > original UNIX spirit (do one thing, and do that right) much better
> > than the way it is in UNIX-like systems today. To me, conceptual
> > simplicity is much more important than performance gains through what
> > I percieve to be "speedhacks".
>
> Testing inside the language isn't a speed hack.
> How many languages have you seen that would call external program to test
> logic? None. Because it's stupid.

Have you seen any language that make calls to tr, sed, awk, cut, cat,
etc.? Of course not. One could abuse the system() call of C to do
that, but that would just be stupid.
Then why do we continuously do this with the shell? Because the
original purpose of the shell was to act as _programglue_. The basic
idea behind the UNIX userland was to create a lot of small,
specialized programs (somewhat like functions), all using a standard
interface for communication (stdin/stdout), and then use a "top-level"
program (the shell) to make them interact.
The shell should do as much as it has to to perform that function, but
no more than that. Things like test, echo, kill, printf, fall
completely outside its scope. The shell's function is to tie programs
together, not to be an all encompassing programming language. Trying
to promote sh(1) to that is stupid, you could then just as well use
java/python/ruby whatever you prefer.

> On the other hand kill, echo and other programs like this should of course
> be outside the shell.

Yes, and test with that. The if/then/else mechanism belongs in the
shell, the test itself (whether it is succes or failure of sleep, cat,
cut, vi, or test doesn't matter) should _not_ be part of the shell.

> But I believe this is not about UNIX philosophy, but about designing a clean
> and effective language (even a shell) and keeping everything that is not a
> part of the language itself in external libraries/programs.

Indeed, and like I said, the test itself belongs outside the shell.
"test" doesn't even come close to covering the things you could
possibly want to test anyway.

Greetings, Sander.
Received on Wed May 23 2007 - 23:03:12 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:42:38 UTC