Re: Question about Sun JAVAC

From: Edward G. Nilges (spinoza1111_at_yahoo.com)
Date: 08/29/04


Date: 28 Aug 2004 22:09:38 -0700

Ben Pfaff <blp@cs.stanford.edu> wrote in message news:<874qmnm176.fsf@benpfaff.org>...
> blmblm@myrealbox.com writes:
>
> > In article <f5dda427.0408271754.69403c35@posting.google.com>,
> > Edward G. Nilges <spinoza1111@yahoo.com> wrote:
> >
> >>Does linux in fact enable me to search my entire hard disk let us say
> >>for a files that contain foo OR are larger than 1M while containing
> >>boo?
> >>
> >>I'd say "without programming", but everything is "programming".
> >>Therefore can I enter a simple command
> >>
> >>findFile contains("foo") or size>1M and contains("boo")
> >
> > As you may remember, "grep" can identify files containing specified
> > text, and "find" can identify files over a particular size.
>
> And find can use grep:
> find . \( \( -exec grep -q foo '{}' \; \) -o \( -size +10k -a -exec grep -q boo '{}' \; \) \) -print

OK this is cool. The problem is that the language looks like an
explosion in a gnome factory.

I discuss this problem in my book "Design Your Own .Net Language and
Compiler" (Apress 2004). It's clear from your example that regular
expressions in particular and the unix (now Linux) approach in general
provide users with the fixin's but not what is needed.

My book contains a discussion of regular expressions which attempts to
put them into perspective, because their gnomic (almost machine
language like) notation is simply made to perform too many tasks.

The book contains in fact a regular expression "laboratory" for
documenting and for testing regular expressions. It's pretty simple:
the laboratory lets the developer store text about regular
expressions.

But the problem with wrapping syntactic sugar around gnomic
expressions is that it so sharply separates the two activities when in
fact they should be ONE.

Lawyers, CPAs, FBI agents, hell, even Chicago cops, know what they
mean when, let's say, Chicago cops say "the gemoke either went to the
Cubs game on the day OR the defendANT was at Joe's Bar and Grill". But
they shouldn't have to learn unix.
>
> > (Anyone know whether there was ever an effort to add to "find" a
> > "contains" criterion? That would make this job easier, though it
> > would still require the ability to use "find", not one of the easier
> > commands ....)
>
> No need for a "contains" criterion, because -exec converts the
> exit status of the program it runs into a true/false value. A
> -grep or -contains predicate might be useful syntactic sugar
> though.

I don't know if Dijkstra ever attacked the usage "syntactic sugar" but
I get the impression from his papers that he felt that programming
wasn't making something ugly...and then sprinkling it with "syntactic
sugar".

Too many engineers are sexually threatened by the very idea that they
might "waste time" on "elegance"; but Dijsktra said, "elegance is not
a dispensable luxury: it is a matter of life and death". This is
because educated in the Kantian tradition, Dijkstra knew that human
beings need to integrate the cognitive, ethical and aesthetic plane.

Indeed and in my own experience, it's usually faster for me to develop
something knew as opposed to trying to beat crap "tools" into shape.

I was last spring engaged in work which involved frequently searching
servers for files including files designed by a software vendor to
deliberately violate the "rules" for file identifiers such that their
violation meant they were 'special files', and files using unicode
characters.

You'd set the oh so high tech Windows search on these files only to
have it sort of stare at you slack jawed for hours, in the great
tradition of Microsoft Bob.

I then (1) developed a class for file identifier parsing enforcing a
highly general syntax and using recursive descent to parse this syntax
and (2) developed a program to read, scan, and parse an expression for
searching that at execution time used a Polish interpreter.

End of story.

When I was a kid, they said it couldn't be done: my fourth grade
teacher laid into me for reading a book about kids who used a computer
to do their homework because she said it was "foolish science
fiction".

Now the favorite riposte is that it has somehow been done...when it
was undone at the FBI, and the lack of a simple facility combined with
the systematic hounding of John O'Neill and Bush's incompetence to
slaughter 3000 people.



Relevant Pages

  • Re: The Regex Story
    ... pattern they're trying to match. ... language unrelated to normal maths syntax for doing so: ... regular expressions -- even Perl's regular ...
    (comp.lang.python)
  • Re: acceptance of forth (was: Re: continued fractions)
    ... But most every scripting language these days offers one ... this is provided by the language itself. ... is classic regular expressions are "greedy" so matching on shortest- ... string in that language and execute it), here are some of the big ...
    (comp.lang.forth)
  • Re: Class::The::XML::Parser
    ... you use a specialized language (with expressions like ... approach if we write a class that does anything else apart from XML ... recommend XML::Rules just for XML parsing when creating or filtering ...
    (comp.lang.perl.modules)
  • Re: Dangers of web apps written in Tcl
    ... Are you saying that these two statements are not the same? ... Your TCL ... company allows anywhere near a programming language should immediately ... didn't originally know about bracing my expressions. ...
    (comp.lang.tcl)
  • Re: American as creolish [was] Re: Baltic Is Gothic
    ... > language and language evolution. ... Forming "regular" preterits, participles, and plurals in English ... > introduces redundancy with formal tokens. ... expressions became "normal", driving out the old expressions with no ...
    (sci.lang)