From: Steven Ericsson Zenith <zenith@kai.com>
Subject: 239 Re: CSP
Organization: 	Kuck and Associates,
		1906 Fox Drive, Champaign IL USA 61820-7334,
		voice 217-356-2288, fax 217-356-5199
Date: Thu, 16 Jul 1992 12:30:16 -0500


In article <1992Jul13.155331.15756@hubcap.clemson.edu>, Peter Thompson
<thompson@inmos.co.uk> writes:
    [request for CSP programs deleted]

    This is a slightly odd request, since CSP really isn't a programming
    language.  We use quite a bit of CSP here, but as an algebra for
    formal verification of hardware rather than as a means of writing
    `programs'.

Peter is right here but I don't understand why this should be considered
an odd request.

I have just heard that a parser and type checker will become available
from Oxford in the near future. I won't give out an address here because
I don't want to flood someone elses account with enquiries but I will
make a point of either posting more info myself or encouraging Oxford to
do so - when it becomes available.

Hoare's CSP book is excellent work, and I highly recommend it as an
essential read for anyone interested in expressing the behavior of
parallel programs but it doesn't really contain any substantial CSP
"programs" (often called "scripts") the largest example is dining
philosophers as I recall.
 
    On the other hand, there is a programming language called `occam'
    which is based on the ideas of CSP, in which there is a very large
    body of non-trivial programs.

This is not an unreasonable suggestion in itself but it should be made
clear that Occam is only an implementation of a subset of CSP. In my
view you do an injustice to CSP if you consider them equivalent. To do
anything interesting - like reason about traces, interleaving, or stuff
like subordination etc... you are compeled to return to CSP. On the
other hand if you are only interested in processes and message passing
Occam may be fine - but then a conventional language extended with MP
and side effect free process support could do you just as well.

Occam advocates might come back and say "Hey, what about ALT?" and "I
can write subordination if I want to!" To which my reply would be: as
many *interesting* non-trival programs using these features probably
exist in the public domain in CSP as exist in Occam and in those cases
you will certainly gain more by looking at the CSP. CAVEAT: providing
execution isn't important to you right now ;-)

One exception: Some interesting, though a little contrived, examples in
Occam exist in Jones and Goldsmith's book "Programming in Occam 2"
published by Prentice Hall. Whilst they are good Occam examples I think
they (the examples) also highlight many of the problems of the language
- as a programming language - and the message passing style.

One major problem for CSP is notation. The reason you'll find more Occam
programs on the net, and hardly any CSP, is because CSP uses arrows,
subscripts and other wacky symbols not easily reproduced in this medium.

It may also interest you to note that CSP in action is considered more a
declarative language these days than an imperative language - though
this is just a matter of style. Incidently: In Hoare's book
implementation in LISP is considered.

Finally: Peter is right. CSP isn't a programming language really - it is
a formalism, a mathematics for reasoning about program behavior. Now it
would be interesting to hear some discussion in these forums on what
that implies and why it might be important in high performance
computing. CSP isn't the only such language of course - but it's
certainly one that is accessible and has a credible history and
evolution.

Steven Ericsson Zenith

PS. Occam isn't the only programming language whose semantics are based
on a CSP foundation - among them is Ease.



Newsgroups: comp.parallel