Re: syntax extension, was Why context-free? (Nick Maclaren)
1 Nov 2005 21:43:14 -0500

          From comp.compilers

Related articles
Why context-free? (2005-10-06)
Re: Why context-free? (glen herrmannsfeldt) (2005-10-09)
Re: Why context-free? (2005-10-13)
Re: syntax extension, was Why context-free? (toby) (2005-11-01)
Re: syntax extension, was Why context-free? (2005-11-01)
Re: syntax extension, was Why context-free? (Karsten Nyblad) (2005-11-01)
Re: syntax extension, was Why context-free? (glen herrmannsfeldt) (2005-11-02)
Re: syntax extension, was Why context-free? (2005-11-02)
Re: syntax extension, was Why context-free? (toby) (2005-11-04)
Re: language design, syntax extension, was Why context-free? (Oliver Wong) (2005-11-12)
Re: language design, syntax extension, was Why context-free? (Ivan Boldyrev) (2005-11-15)
[6 later articles]
| List of all articles for this month |

From: (Nick Maclaren)
Newsgroups: comp.compilers
Date: 1 Nov 2005 21:43:14 -0500
Organization: University of Cambridge, England
References: 05-10-053 05-10-068 05-10-075 05-11-006
Keywords: parse, design, comment
Posted-Date: 01 Nov 2005 21:43:13 EST

  toby <> wrote:
>But TeX (like METAFONT) is closely tailored to its domain, and within
>that domain, is quite elegant. Of course it can be 'ghastly' for tasks
>of a different character - Knuth himself gives several examples in The
>TeXbook. Anything is *possible* but not necessarily easy.

No, that wasn't my point. One of the "gotchas" is that spaces are
syntactically significant, and you cannot introduce layout (ANY form
of layout) for clarity without changing the meaning of the program.
And, because TeX doesn't have a precise description (merely a guide on
how to use it), it is very hard to analyse a program for why it
doesn't do what you understand the TeX book to say that it should do.

>Similarly I find that many people who complain about Perl -
>especially comparing it to languages such as Ruby or Python - have
>missed the point. Perl has its sweet spot domains (as a child of sed,
>C, sh, etc) and while it is a powerful general purpose programming
>language, that was not its guiding principle. It was highly adapted
>from birth.

Again, you have missed the point. Perl is bad, even for the purposes
that it was designed for and is most often used for - system scripts.
People who care about RAS really, really do NOT want a privileged
script to do something unexpected. Humans make errors, but Perl is
such that most errors make it do something unpredictable rather than
issuing an error message.

People may have heard before, but my first and last Perl program was
20 lines long, with every branch tested both for correctness of the
condition and that each path was being correctly executed. It gave
wrong answers the first time I used it.

I had misunderstood the manual, and typed completely broken syntax.
This behaved as I expected during my tests and not on real data.

Not really related to that, I also half converted it to MVS, ISO C
and EBCDIC (don't ask), and so had to stufy its code. I have rarely
seen anything so bad, and its quality made it very clear why it was
likely to behave in that sort of way. I could go into details, but
they are irrelevant. I have heard that newer versions are better,
but my reaction is that they could scarcely fail to be.

Nick Maclaren.

[You keep mentioning your failure to write a correct perl program on
the first try, but I can't figure out what conclusion we're supposed
to draw. That someone who is a skilled programmer in some languages
is still a novice in languages he doesn't know? That you aren't very
good at learning languages from the manual? That preconceptions make
it hard to learn new or different languages? I don't think my first
perl program worked either, nor did my first Lisp, C, Basic, Algol 60,
PL/I, Fortran, or Varian 620 assembler program, but I don't think it
was the languages' fault. (Well, maybe for C.)

Oh, by the way, I wrote a python program using my favorite text editor
which has four character tab stops. It didn't work, so nobody should
use python. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.