Re: extending a grammar

platon! (A Johnstone)
25 Mar 1996 21:46:49 -0500

          From comp.compilers

Related articles
extending a grammar (1996-03-12)
Re: extending a grammar (1996-03-21)
Re: extending a grammar platon! (1996-03-25)
Re: extending a grammar (1996-03-27)
Re: extending a grammar (1996-03-27)
| List of all articles for this month |

From: platon! (A Johnstone)
Newsgroups: comp.compilers
Date: 25 Mar 1996 21:46:49 -0500
Organization: Royal Holloway, Univ of London
References: 96-03-082
Keywords: syntax

M.M. van der Laan ( wrote:
: Programming languages are never be flexible enough to cover all
: programming tasks. Off course, libraries of functions cover most
: problems, but sometimes one just needs a better grammar.

An excellent note by our moderator: the problem with extensible
languages is that they become write-only. With most languages one can
at least parse a student's program whilst attempting to figure out
what they are trying to do. With an extensible language there is
almost nowhere to start.

There are languages that display this behaviour without needing to
define new chunks of BNF: macro expansion languages in particular have
a very simple syntax (from the point of view of parsing) but with a
little judicious indirection can be given the flavour of extensible
languages. TeX is the classic example: Don Knuth is very clever and
can write good programs in TeX. As for the rest of us poor devils
though, most TeX code is nearly incomprehensible because of the amount
of chasing down definitions in terms of other definitions in terms of ...

This comes from the heart: I wrote a book about LaTeX and how to
customise it by modifying style files and so on. I can program in
maybe ten high level languages and more assembly languages than you
can shake a stick at, but every time I encounter a new problem with
TeX its like starting over as a complete newbie!


PS from my limited experience of it, Forth looks to have a very similar
`write-only' character.

    Dr Adrian Johnstone, Dean of the Science Faculty, Dept of Computer Science,
        Royal Holloway, University of London, Egham, Surrey, TW20 0EX, England.
Email: Tel: +44 (0)1784 443425 Fax: +44 (0)1784 443420

Post a followup to this message

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