Re: Where does the drive to syntax come from?
- From: Ray Dillinger <bear@xxxxxxxxx>
- Date: Wed, 07 Sep 2005 23:01:19 GMT
Sashank Varma wrote:
As a psychologist who studies language comprehension, I've always
viewed Wall's claim as more of a linguistic (or rather, a Wall-ian)
slogan than a scientific claim.
I don't know of any evidence that more syntactic variation leads to
better comprehension. However, there is plenty of evidence that the
more complex a syntactic construction, the more difficult it is to
process. That is, it takes longer to comprehend, is understood less
accurately, elicits more activation in the language areas of the brain,
and is impaired in normal adults with small working memory capacity
and in patients with damage to langugage areas. In fact, there is
evidence that syntactic ambiguity is difficult to process. If there are
several structural interpretations of a word sequence, having to choose
between them has negative behavioral and brain consequences.
And yet everywhere we look, we see that natural languages are
deeply syntactically ambiguous and complex; One would think
that if such fundamental difficulties characterized ambiguity
and complexity, then people would use much simpler languages
amongst themselves.
There are a multitude of very interesting hypotheses that
could be drawn here about some kind of tradeoff or value
realized from all the extra work and difficulty we let
ourselves in for; but most of them are conflicting, few
apply to programming languages, and the design of
experiments to test any or all of them would be extremely
difficult.
I have a favorite hypothesis, but won't go much into it
here as it's pure speculation. I think that a lot of
good ideas emerge from poorly-understood or ambiguously-
communicated bad ideas. So our loose, imprecise,
context-sensitive, ambiguous, complex languages may be
helpful because they give us room to misunderstand
each other's bad ideas. People are forced to think
"what did he mean?" (the extra work you're talking about)
and come up with an answer that, hopefully, makes sense -
in some cases even if what was actually meant makes less
sense. So maybe our difficulties communicating contribute
to the iterative refinement of ideas.
Programming languages cannot yet benefit from that kind
of ambiguity, so whether or not human languages do isn't
really germane to the discussion at hand.
Wall is right in saying that context helps. However, all the
experiments of which I'm aware have studied semantic context, not
syntactic context. So I don't see how Perl's baroque syntax provides
any contextual support.
I remember that learning Perl (As of Perl 4, the last
version I seriously knew) *felt* a lot more like learning
a natural language than a programming language. I
recognized lots of constructions that were clearly just
copied from the complexities of natural languages. There
was a forest of syntax and special cases, but it did seem
to have a sort of grammatical pattern with contexts for
different kinds of programming ideas and the "same" word
doing related things in different contexts.
I also had this feeling that there was a sort of "gestalt"
understanding lurking in the background, as with human
languages; Having had to study French for a whole year or
two before actually starting to think in it, I felt like
I'd reached a new sort of understanding... and learning
Perl felt like that kind of understanding was back there
somewhere, even though I never really got it.
I sort of lost interest in Perl when I saw that Perl 5
was a fairly radical redesign; if I'm going to invest that
kind of effort learning a language, I want the language to
be rock-solid stable in its structure. I'll wait until
it's finished, *then* learn it again.
Bear
.
Relevant Pages
- Re: How Do CLs Macros Differ from Schemes?
... context-sensitive grammars are of little help in programming ... languages and are not widely used at all. ... What is a context-sensitive grammar? ... In a context sensitive grammar we might have stuff like. ... (comp.lang.lisp) - Re: parser
... and by no means is Java some obscure language... ... Java bundles a high-performance concurrent garbage ... I would advocate C# over Java in this context though, ... functional programming languages. ... (comp.programming) - Re: About context sensitivity.
... I heard of Anders Heljsberg eplaining the idea of Data Programming. ... This means semantic net based Semantic ... Level context programming language available? ... > sensitivity and if some programming languages exist that target .NET. ... (microsoft.public.dotnet.framework.clr) - Re: history of generative grammars
... Up you find context sensitive ... Computer languages are often not ... of a context free grammar, ... (comp.theory) - Re: Christian nation? Not now, not ever
... word meanings may be known, idioms, syntax, context, etc are ... for a specific audience. ... specific audience which shared the times and languages. ... the theme and flow and put it into the context for which it was ... (rec.sport.football.college) |
|