[comp.lang.c] Correction

eric@snark.UUCP (Eric S. Raymond) (01/06/88)

In <145@snark.UUCP> I wrote:
>The name 'C' was assigned because the original DMR compiler on the PDP-11 was
>written as the successor to an interpreted language called 'B' that Ritchie
>had been hacking with on the original PDP-7 proto-Unix.

Arnold Robbins points out that my phrasing is misleading, implying that DMR
wrote B. My apologies to anyone confused; Ken Thompson designed and wrote B.

Also, I expanded 'BCPL' to 'British Common Programming Language'. Mr. Robbins
thinks the correct name is '*Basic* Common Programming Language' and may well
be right -- I once knew the exact name, when I was doing the research for
the history section in _Portable_C_And_Unix_Systems_Programming_, but may have
misremembered it.

BTW, I am given to understand that BCPL is still sort of alive on one machine
with a fairly large user base, the Commodore Amiga. A friend who develops for
Amigas claims that parts of the AmigaDOS lower levels were lifted from TRIPOS,
an OS developed at Cambridge University in BCPL. He says that this has still-
visible consequences in the C interfacing. Can anyone else verify this?

-- 
      Eric S. Raymond
      UUCP:  {{seismo,ihnp4,rutgers}!cbmvax,sdcrdcf!burdvax,vu-vlsi}!snark!eric
      Post:  22 South Warren Avenue, Malvern, PA 19355    Phone: (215)-296-5718

jim@coplex.UUCP (Jim Sewell) (01/08/88)

> BTW, I am given to understand that BCPL is still sort of alive on one machine
> with a fairly large user base, the Commodore Amiga. A friend who develops for
> Amigas claims that parts of the AmigaDOS lower levels were lifted from TRIPOS,
> an OS developed at Cambridge University in BCPL. He says that this has still-
> visible consequences in the C interfacing. Can anyone else verify this?
> -- 
>       Eric S. Raymond
>       UUCP:  {{seismo,ihnp4,rutgers}!cbmvax,sdcrdcf!burdvax,vu-vlsi}!snark!eric

I have not had any experience with the lower level AmigaDOS development, but I
have neither had, nor heard of anyone having, trouble writing common every day
type C code on the Amiga.  It is common knowledge in the Amiga circles that
AmigaDOS commands are all written in BCPL and I have heard in several reliable
places of it being based on TRIPOS.  I believe, but don't quote me 8-), that
the devolopers scratched the first attempt at an op-sys and used TRIPOS as a 
basis for the one they eventually released.  As a related note, there is a
project going on called the "AmigaDOS Replacement Project" which is an attempt
to replace the BCPL commands with C versions which will run faster, compile C
smaller, and interface better.  Please forgive my inability to remember by who
and where this work is being done.
==============================================================================
Jim Sewell					"Make knowledge free!"

ok@quintus.UUCP (Richard A. O'Keefe) (01/08/88)

In article <146@snark.UUCP>, eric@snark.UUCP (Eric S. Raymond) writes:
> In <145@snark.UUCP> I wrote:
> Also, I expanded 'BCPL' to 'British Common Programming Language'. Mr. Robbins
> thinks the correct name is '*Basic* Common Programming Language' and may well
> be right -- I once knew the exact name, when I was doing the research for
> the history section in _Portable_C_And_Unix_Systems_Programming_, but may
> have misremembered it.

Let's get this right once and for all.  According to the book
	BCPL - the language and its compiler
	Martin Richards & Colin Whitby-Strevens
	Cambridge University Press 1980
	ISBN 0 521 28681 6
	Price: five pounds sterling

    "BCPL was designed by .. Richards .. in 1967.
     It underwent substantial development over the next five years,
     but since then has remained relatively stable.
     ...
     The language BCPL (Basic CPL) was originally developed as a
     compiler-writing tool and, as its name suggests, is closely
     related to CPL (Combined Programming Language) which was
     jointly developed at Cambridge and London Universities."

Much of the flavour of BCPL has been retained in C.  For example,
the first program in the book is (with one change)
	GET "LIBHDR"
	LET START() BE WRITES("Hello, World*N")
which is the exact analogue of
	#include <stdio.h>
	main()
	    {
		printf("Hello, World\n");
	    }
BCPL has end-of-line comments introduced by "//".  I wonder whether the
reintroduction of this into C++ is a coincidence?

Even the idea of having a separate "lint" program was first reported for
BCPL.

The book includes source code for the first pass of a BCPL compiler.
It used to be quite easy to get a tape with a BCPL->OCODE compiler in
source form, an OCODE->INTCODE translator, and an INTCODE interpreter.
There was also a "ed"-like editor called CHEF.

The biggest difference between BCPL and C was that BCPL was designed
before byte-addressing became popular, so Array!Subscript adds a word
offset to the array address, which meant lots of multiplication by 4.
(Array%ByteOffset was added for the /370.)

If you are interested in operating systems, there was a small operating
system called OS6 written in BCPL.  The source code and commentary are
available as
	The Text of OSPub
	Christopher Strachey & Joseph Stoy
	Technical Monographs PRG-9 (t) and PRG-9 (c)
	July 1972
	Oxford University Computing Laboratory
	Programming Research Group
	45 Banbury Road,
	Oxford, Englang.
I wonder whether there has ever been another operating system without any
'goto's?