🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4623

Re: Gawk v24.7: Why Bother???

#4623
From: Tom Christiansen
Date: Wed, 19 Apr 1995 00:00
96 lines
5348 bytes
In comp.unix.shell, 
    manson@magnus.acs.ohio-state.edu (Bob Manson) writes:
:I'll demonstrate my bozo nature, and follow up...

Quite.

:Perl!=gawk!=nawk!=awk!=(POSIX awk). If you want to use perl, use
:perl. If you want to use gawk, use gawk. If you want to use
:nawk, use nawk...

No, I'm sorry, but that just doesn't make sense.  It's in
anyone's interest to be diversifying awk dialects.  There should
be POSIX awk, end of story.  Period.  Full stop.  That's it.
If you want a new language, fine, but DON'T CALL IT AWK!

:It seems like Tom is trying to say "gee, Perl does all this, just use
:Perl, and forget about enhancing gawk". 

No.

What I said -- or tried to say -- was that in ALMOST EVERY SINGLE
MISERABLE CASE, all the "enhancements" to that GNU planned to add to awk
were things that WERE ALREADY TAKEN CARE of for you in perl.  It's not
just the fact that both lisp and C allow function definitions, for
example, but a much more obvious and clear case of convergent evolution.
It seems like a stupid and needless waste of time and energy to turn
awk into perl.  Start over.  Leave awk as awk.  If you want perl, use it.
But don't put it all into your own special perlian awk dialect.

:Many folks don't like Perl,
:because of confused syntax trying to look like TECO or other bizarre
:feeps, so that's not necessarily a terribly helpful or useful
:suggestion.

I understand that folks without a proper C background despise
things like braces and assignment ops, that folks with a proper regular
expression background despise seeeing /^([0-9_]+).*\1$/ patterns in code,
that those without a proper HLL background despise automatic
declare-upon-use variables, that those with an HLL background despise
having to declare things at all, that those with an IBM I/O background
despise typeless byte streams, and that those both with and without a
proper assembler background despise there have being anything like
pointers in a language.

Well, life is hard, but tough luck.

The folks who say "make perl like awk or C and get rid of those dollar
signs" have NOT THOUGHT about these matters very much.  They would force
us either into a flat data structure model or else a declare everything's
type and size and bloodtype model, neither of which are desirable.  

The folks who want say C is so pretty and clean haven't considered that a
comma operator has both an array and scalar context even in C, that
sometimes arrays in C work like pointers and sometimes they don't, etc.
They forget that referencing and dereferencing ops, bitwise ops, ternary
ops, and assignment ops have given rise to code like this:

    A[0] = (((B[0]>>1) & CMask) | r1) & D_Mask;
    while((*pat_ptr = buf[i++]) != '\n') pat_ptr++;
    hash=(hash<<4)+(tr1[*(text-i)]);
    while(tr[patt[pat_index][j]] == tr[*(qx++)]) j++;
    while(*(--text) != '\n');
    --matching_line)[-1] != '\n'
    if ((exp->tlast = strdup((char *)cmdp->argv[0])) == NULL) {
    *win->lines[y]->firstchp
    gv_fetchpv(SvPVnx(GvSV((GV*)(*stack_sp--))
    (**++argv)
    (*++*argv)
    (*valuePtr->pv.expandProc)(&valuePtr->pv, shortfall);
    result = (*mathFuncPtr->proc)(mathFuncPtr->clientData, interp, args, &funcResult);   
    if (&p[strlen(&eventPtr->command[bytesSeen]) + 1] > &newCommand[size]) {
    cm[*--us2]
    *(*buf)++ = *++tmp - '@';
    (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)

:I don't like the idea of adding every bug/feature in the known
:universe to gawk either, but rather than suggest "use Perl" I'll
:suggest thinking about what gawk is good at and improving those
:features, instead of trying to add lots of useless and obscure feeps
:in order to turn it into a sploding mass of seeting putrid
:obscenities.

Putrid obscenities?  You're starting to wax hyperbolic Bob.

I'll say it again for the logic impaired: the list of things that are
intended to be put into gawk are already in perl, and people all excited
about them should think very very hard on why they wish to devote so very
much time to reinvent something that was better constructed from the start
than they have a chance at implementing.  You see, perl began a ground
zero starting point without a legacy to preserve, so those features got
added there much more cleanly and coherently that shall ever be even
POSSIBLE in awk.  It's similar to (part of) why there are disgusting
abominations in ksh: he decided to be still handle sh scripts, rather than
throwing the cruddy code out and getting a fresh start as they did in rc.

--tom
Technical Details
Message-ID: <3n3j81$600@csnews.cs.colorado.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3mpj9f$d1h@csnews.cs.colorado.edu> <3n1b4r$qjb@crchh327.bnr.ca> <jerry.798265970@tivoli.com> <3n3d0m$3i2@charm.magnus.acs.ohio-state.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1012a6,4df32fd703a6b724
X-Google-Attributes: gid1012a6,public
X-Google-Thread: 1025b4,4df32fd703a6b724
X-Google-Attributes: gid1025b4,public
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Gawk v24.7: Why Bother???
Date: 1995/04/19
Message-ID: <3n3j81$600@csnews.cs.colorado.edu>
X-Deja-AN: 101270465
references: <3mpj9f$d1h@csnews.cs.colorado.edu> <3n1b4r$qjb@crchh327.bnr.ca> <jerry.798265970@tivoli.com> <3n3d0m$3i2@charm.magnus.acs.ohio-state.edu>
organization: Perl Consulting and Training
reply-to: tchrist@mox.perl.com (Tom Christiansen)
newsgroups: comp.unix.shell,gnu.misc.discuss
originator: tchrist@mox