comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Examples in Docs, was Re: Escape Sequences in Strings
Date: Thu, 18 Jan 2001 19:53:10 GMT
Date: 2001-01-18T19:53:10+00:00	[thread overview]
Message-ID: <947hj1$o1r$1@nnrp1.deja.com> (raw)
In-Reply-To: Pine.BSF.4.21.0101180808230.9927-100000@shell5.ba.best.com

In article
<Pine.BSF.4.21.0101180808230.9927-100000@shell5.ba.best.com>,
  Brian Rogoff <bpr@shell5.ba.best.com> wrote:
> Well, I am in awe. If I remember correctly, there are a few
> important aspects of SML programming, like evaluation order,
> that are not explicitly stated but have to be deduced. I
> can't imagine anyone getting a  feel for how to program in ML
> from the definition, especially if they were  not familiar
> with functional programming style.

Neither can I :-) Indeed I was completely familiar with
functional programming style (e.g. I knew Miranda well as well
as the whole EFL (English-functional-language) work.

Actually there is a very important point here which is that
examples ARE very valuable for showing style, as opposed to
rules. And indeed, I can't imagine learning style without
learning rules.

An analogy is a piano, you can read a set of specifications
that clearly tell you, press this key to get middle A, which
is 440Hz etc. But you do NOT get an idea of how to play Chopin
from such specs. And even if you were Bach, you might still
find yourself a bit mystefied by a Chopin score without any
examples of how it sounded on a modern piano.

So for stylistic issues etc, I quite agree that examples are
helpful, indeed critical, and actually one of our big failings
in teaching programming is that students do not get to study
large examples of well written programs.

> I agree, but I think mathematics is quite a bit different
> from programming, and I have a decent background in both.

Interesting, people differ on this point. Certainly Lambert
Meertens would disagree with you I think :-)

>(Note to RBKD: that's why I chose SML as an example, since
> it's definition is  the most "mathematical" of any well known
> current programming language).

Well I think the definition of Algol-68 is a whole lot more
difficult in that respect, and actually the PL/1 standard is
pretty mathematical (it's VDL style denotational semantics).


> However, I've found that like most people I learn best
> by example.

And I have strongly agreed with that position from the start.
But this still does not answer the question of whether to put
more or less examples in the RM, because it is also the case
that most people do NOT learn a language from its defining
standard in any case (a point you are essentially arguing :-)
So it is not clear that the above agreed on fact (that most
people learn best from examples) means that examples belong
in the RM, especially trivial examples that assume you do not
know the language at all (which is the nature of most of the
current RM examples -- they are NOT there to illustrate tricky
points in the language).


> > Certainly a BNF grammar is a FAR clearer documentation of
> > syntax than syntactic examples, wouldn't you agree?
>
> Of course! However, when I learn a new programming language,
> to get an idea of the syntax I look at a few representative
> examples first.

Ah well, there we are diffeent, I find it quite sufficient
to scan through the BNF. Part of the trouble in Algol-68 is
that there IS no BNF, only the two level grammar, which
embodies all the syntax AND static semantic information, and
this makes the syntax somewhat inpenetrable (at least at
first).

> Algol: Pascal, Modula-<X>, Oberon-<X>, Ada, Dylan
> C : C++, Objective-C, Java, C#
> Lisp: Scheme, Emacs-Lisp, Common-Lisp...
> Prolog: Erlang, Mercury
> Haskell: Clean, Python, OCCAM ("offset rules")
> ML: SML, OCaml
>
> While I'm not intimately familiar with all of these
languages, a quick
> glance at new language examples allows me to categorize it
(or not!) and
> I find that I can get up to speed *on syntax* quickly. Then,
afterwards, I
> go to the BNF. I take it that you just go straight to the BNF
and skip
> the examples altogether.

OK, I see that point, that makes sense ... I think I have never
come to a new language without knowing in advance which
category it belonged in :-)

> The reason I asked if you teach your way, and if students are
> receptive,  is that I'd be interested in trying it myself. In
> fact, I'll try this with the next PL I learn.

I have not tried to insist on students learning languages from
the standard, but I have tried to insist that they read the
standard. I taught a course on language standards a while ago,
and we looked at several standards, including the COBOL
standard in detail, and some students in the class definitely
learned COBOL from the standard plus lectures.

Going back to Algol-68, I must say this was a huge and
surprising failure for me. I joined a little study group
where we read through the A68 report, and attended several
meetings, and at the end of these meetings I simply had
NO IDEA AT ALL what was going on.

Which is too bad, because I had been interested in doing a
compiler for A68 early on (following off the SPITBOL work),
but I decided it was inpenetrable. It was not till several
years later that I visited Leeds University where there was
an ICL machine with RRE A68 installed, and I read Ian Currie's
wonderful 70 page yellow book covering all of A68. I read it
an evening. Came the next day, wrote a few hundred line A68
program -- worked first time -- great! And then I got fully
involved in A68 (I chaired IFIP WG2.1 and the A68 maintenance
committee for many years, and participated in some of the late
design efforts including the representation standard, and the
modules standard [the latter influenced the Ada design]), but
that delay of several years was a pity.

[interestingly, if I had not read Ian's book, I would never
have got involved in Ada, since my Ada involvement came from
the IFIP connection :-)]

By the end of things, I was one of the relatively few people
who really knew the A68 standard cover to cover.

But some people are MUCH better at reading this kind of
formal document than me. Phil Shaw wrote a thesis describing
a language GYVE for operating system construction. He read
the A68 report, immediately understood and liked it, and
wrote a complete 2 level grammar for GYVE as part of his
thesis.

I must say, I still look for the Ada equivalent of Ian Currie's
little yellow book -- I know, I know, I should write it :-)
[it was of course full of examples, as something like that
should be].

I actually started out a year or so ago with a description of
Ada by example only -- nothing but examples -- no rules at all.
You can see a start of this on the compilers course home page
at www.cs.nyu.edu. It's an interesting approach for those who
like to learn by example.


Sent via Deja.com
http://www.deja.com/



  reply	other threads:[~2001-01-18 19:53 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-15  0:00 Escape Sequences in Strings Jean Cohen
2000-11-15  0:00 ` Preben Randhol
2000-11-15  0:00 ` Marin David Condic
2000-11-16  0:00   ` Ada Streams usage (was Escape Sequences in Strings) Marc A. Criley
2000-11-16  0:00     ` Marin David Condic
2000-11-16  0:00       ` Ted Dennison
2000-11-16  0:00         ` Marin David Condic
2000-11-16  0:00           ` Ted Dennison
2000-11-16  0:00             ` Marin David Condic
     [not found]     ` <igh81t8b3hdrsc167do6qr0h1joa73c1jr@borpin.co.uk>
2000-11-18  0:00       ` Marin David Condic
2000-11-18  0:00         ` David Kristola
2000-11-19  0:00           ` Marin David Condic
2000-11-19  0:00             ` Marin David Condic
2000-11-20  0:00               ` Brian Orpin
2000-11-20  0:00                 ` Marin David Condic
2000-11-19  0:00         ` Ted Dennison
2000-11-19  0:00           ` Marin David Condic
2000-11-19  0:00             ` Robert Dewar
2000-11-20  0:00               ` Marin David Condic
2000-11-21  0:00                 ` Robert Dewar
2000-11-20  0:00               ` Randy Brukardt
2000-11-21  0:00                 ` Ted Dennison
2000-11-21  0:00                   ` Randy Brukardt
2000-11-21  1:31                 ` Robert Dewar
2000-11-21  1:33                 ` Robert Dewar
2000-11-21  0:00                   ` Randy Brukardt
2000-11-22  5:00                     ` Robert Dewar
2000-11-19  0:00             ` Ted Dennison
2000-11-19  0:00               ` Robert Dewar
2000-11-15  0:00 ` Escape Sequences in Strings John English
2000-11-15  0:00   ` Robert Dewar
2000-11-15  0:00     ` Ehud Lamm
2000-11-16  0:00       ` John English
2000-11-16  0:00         ` Tarjei T. Jensen
2000-11-16  0:00           ` Ken Garlington
2000-11-16  0:00             ` Marin David Condic
2000-11-16  0:00             ` Keith Thompson
2000-11-16  0:00         ` Marin David Condic
2001-01-12 13:18 ` Andrew Hately
2001-01-12 20:03   ` Keith Thompson
2001-01-18  8:29     ` Lao Xiao Hai
2001-01-18 15:22       ` Robert Dewar
2001-01-18 22:43         ` Randy Brukardt
2001-01-21 11:54         ` Dale Stanbrough
2001-01-21 22:35           ` directly accessing DOS screen memory (was: Re: Escape Sequences in Strings) Jeffrey Carter
2001-01-12 19:37 ` Escape Sequences in Strings tmoran
2001-01-13  1:38   ` Robert Dewar
2001-01-13  6:48     ` tmoran
2001-01-13 18:36       ` Robert Dewar
2001-01-16  3:30         ` Examples in Docs, was " peter_richtmyer
2001-01-16  5:42           ` Robert Dewar
2001-01-16 20:44             ` mark_lundquist
2001-01-16 22:43               ` Larry Kilgallen
2001-01-17 15:06                 ` mark_lundquist
2001-01-17  2:25               ` Robert Dewar
2001-01-17 15:28                 ` mark_lundquist
2001-01-17 16:20                 ` Brian Rogoff
2001-01-17 18:04                   ` Wayne Lydecker
2001-01-17 19:23                     ` BSCrawford
2001-01-18  0:15                       ` Jerry Petrey
2001-01-19  0:01                     ` tmoran
2001-01-18  3:44                   ` Robert Dewar
2001-01-18 16:45                     ` Brian Rogoff
2001-01-18 19:53                       ` Robert Dewar [this message]
2001-01-18 22:58                         ` Georg Bauhaus
2001-01-19 16:40                           ` Robert Dewar
2001-01-19  7:49                         ` Learning methods Anders Wirzenius
2001-01-19 18:57                         ` Examples in Docs, was Re: Escape Sequences in Strings mark_lundquist
2001-01-21 12:05                         ` Dale Stanbrough
2001-01-21 15:35                           ` Robert Dewar
2001-01-17 22:10                 ` Matthew Woodcraft
2001-01-18  3:52                   ` Robert Dewar
2001-01-16 16:06           ` Examples in Docs Robert C. Leif, Ph.D.
2001-01-16 21:29             ` mark_lundquist
2001-01-18  0:50               ` Randy Brukardt
2001-01-18 16:46                 ` mark_lundquist
2001-01-18 17:24               ` J. David Bryan
2001-01-17  2:43             ` Robert Dewar
2001-01-17 21:17               ` Robert C. Leif, Ph.D.
2001-01-16 20:01           ` Examples in Docs, was Re: Escape Sequences in Strings mark_lundquist
2001-01-17 10:59             ` Peter Richtmyer
2001-01-19 18:55               ` mark_lundquist
2001-01-20 14:24                 ` Robert Dewar
2001-01-20 14:36                   ` Preben Randhol
2001-01-20 15:00                     ` Robert Dewar
2001-01-21 11:24                       ` Preben Randhol
2001-01-22 14:47                         ` Ted Dennison
2001-01-22 20:08                           ` Preben Randhol
2001-01-22 20:14                             ` Preben Randhol
2001-01-20 19:02                   ` Stephen Leake
2001-01-20 19:50                     ` Georg Bauhaus
2001-01-21 11:35                     ` Preben Randhol
2001-01-22 23:58                   ` Mark Lundquist
2001-01-27  1:43                   ` Increasing the readability of Ada was RE: Examples in Docs Robert C. Leif, Ph.D.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox