The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-09  2:30 Norman Wilson
  2017-01-09  3:31 ` Steve Johnson
  0 siblings, 1 reply; 21+ messages in thread
From: Norman Wilson @ 2017-01-09  2:30 UTC (permalink / raw)


Doug McIlroy:

  There was some pushback which resulted in the strange compromise
  of if-fi, case-esac, do-done. Alas, the details have slipped from
  memory. Help, scj?

====

do-od would have required renaming the long-tenured od(1).

I remember a tale--possibly chat in the UNIX Room at one point in
the latter 1980s--that Steve tried and tried and tried to convince
Ken to rename od, in the name of symmetry and elegance.  Ken simply
said no, as many times as it took.  I don't remember who I heard this
from; anyone still in touch with Ken who can ask him?

Norman Wilson
Toronto ON


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09  2:30 [TUHS] Unix stories, Stephen Bourne and IF-FI in C code Norman Wilson
@ 2017-01-09  3:31 ` Steve Johnson
  2017-01-09 15:30   ` Marc Rochkind
  2017-01-11  6:00   ` Brantley Coile
  0 siblings, 2 replies; 21+ messages in thread
From: Steve Johnson @ 2017-01-09  3:31 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

I wasn't directly involved in this, but I do remember Dennis telling
me essentially the same story.  I don't recall him mentioning Ken's
name, just that "we couldn't use _od_ because that was already taken".

Steve B and I had adjacent offices, so I overheard a lot of the
discussions about the Bourne shell.  The quoting mechanisms, in
particular, got a lot of attention, I think to good end.  There was a
lot more thought there than is evident from the surface...

Steve (not Bourne)

----- Original Message -----
From: "Norman Wilson" <norman@oclsc.org>
To:<tuhs at tuhs.org>
Cc:
Sent:Sun, 08 Jan 2017 21:30:03 -0500
Subject:Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code

 Doug McIlroy:

 There was some pushback which resulted in the strange compromise
 of if-fi, case-esac, do-done. Alas, the details have slipped from
 memory. Help, scj?

 ====

 do-od would have required renaming the long-tenured od(1).

 I remember a tale--possibly chat in the UNIX Room at one point in
 the latter 1980s--that Steve tried and tried and tried to convince
 Ken to rename od, in the name of symmetry and elegance. Ken simply
 said no, as many times as it took. I don't remember who I heard this
 from; anyone still in touch with Ken who can ask him?

 Norman Wilson
 Toronto ON

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170108/e08a256c/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09  3:31 ` Steve Johnson
@ 2017-01-09 15:30   ` Marc Rochkind
  2017-01-09 15:45     ` arnold
                       ` (2 more replies)
  2017-01-11  6:00   ` Brantley Coile
  1 sibling, 3 replies; 21+ messages in thread
From: Marc Rochkind @ 2017-01-09 15:30 UTC (permalink / raw)


Just a quick note about Algol vs. Algol 68: The two are used
interchangeably (it seems) in this thread, but they're very different
languages, with very different control structures. Someone mentioned he had
studied Algol in school, which is plausible. If he in fact studied Algol
68, that's worth a story in its own right!

[Whoops... forgot to properly terminate that last sentence.]

fi

--Marc

On Sun, Jan 8, 2017 at 8:31 PM, Steve Johnson <scj at yaccman.com> wrote:

> I wasn't directly involved in this, but I do remember Dennis telling me
> essentially the same story.  I don't recall him mentioning Ken's name, just
> that "we couldn't use *od* because that was already taken".
>
> Steve B and I had adjacent offices, so I overheard a lot of the
> discussions about the Bourne shell.  The quoting mechanisms, in particular,
> got a lot of attention, I think to good end.  There was a lot more thought
> there than is evident from the surface...
>
> Steve (not Bourne)
>
>
> ----- Original Message -----
> From:
> "Norman Wilson" <norman at oclsc.org>
>
> To:
> <tuhs at tuhs.org>
> Cc:
>
> Sent:
> Sun, 08 Jan 2017 21:30:03 -0500
> Subject:
> Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
>
>
>
> Doug McIlroy:
>
> There was some pushback which resulted in the strange compromise
> of if-fi, case-esac, do-done. Alas, the details have slipped from
> memory. Help, scj?
>
> ====
>
> do-od would have required renaming the long-tenured od(1).
>
> I remember a tale--possibly chat in the UNIX Room at one point in
> the latter 1980s--that Steve tried and tried and tried to convince
> Ken to rename od, in the name of symmetry and elegance. Ken simply
> said no, as many times as it took. I don't remember who I heard this
> from; anyone still in touch with Ken who can ask him?
>
> Norman Wilson
> Toronto ON
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170109/c6496a84/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 15:30   ` Marc Rochkind
@ 2017-01-09 15:45     ` arnold
  2017-01-09 15:59       ` ron minnich
  2017-01-09 16:03       ` Clem Cole
  2017-01-09 18:48     ` Derek Fawcus
  2017-01-09 20:35     ` Steve Johnson
  2 siblings, 2 replies; 21+ messages in thread
From: arnold @ 2017-01-09 15:45 UTC (permalink / raw)


I remember the Bournegol well; I did some hacking on the BSD shell.

In general, it wasn't too unusual for people from Pascal backgrounds to
do similar things, e.g.

	#define repeat		do {
	#define until(cond)	} while (! (cond))

(I remember for me personally that do...while sure looked weird for
my first few years of C programming. :-)

(Also, I would not recommend doing that; I'm just noting that
people often did do stuff like that.)

FWIW, it was the USG guys who de-Algolized the sh code, at SVR2,
I believe. I think it was also done by the Research guys at a
later point, but without V8/V9/V10 to look at it, it's hard to know.

If we're talking about langauge design, the Ada guys borrowed a
page from Algol 68's book and let the keywords do the grouping
instead of requiring begin-end.  I personally find that somewhat
more elegant.

Arnold

Marc Rochkind <rochkind at basepath.com> wrote:

> Just a quick note about Algol vs. Algol 68: The two are used
> interchangeably (it seems) in this thread, but they're very different
> languages, with very different control structures. Someone mentioned he had
> studied Algol in school, which is plausible. If he in fact studied Algol
> 68, that's worth a story in its own right!
>
> [Whoops... forgot to properly terminate that last sentence.]
>
> fi
>
> --Marc
>
> On Sun, Jan 8, 2017 at 8:31 PM, Steve Johnson <scj at yaccman.com> wrote:
>
> > I wasn't directly involved in this, but I do remember Dennis telling me
> > essentially the same story.  I don't recall him mentioning Ken's name, just
> > that "we couldn't use *od* because that was already taken".
> >
> > Steve B and I had adjacent offices, so I overheard a lot of the
> > discussions about the Bourne shell.  The quoting mechanisms, in particular,
> > got a lot of attention, I think to good end.  There was a lot more thought
> > there than is evident from the surface...
> >
> > Steve (not Bourne)
> >
> >
> > ----- Original Message -----
> > From:
> > "Norman Wilson" <norman at oclsc.org>
> >
> > To:
> > <tuhs at tuhs.org>
> > Cc:
> >
> > Sent:
> > Sun, 08 Jan 2017 21:30:03 -0500
> > Subject:
> > Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
> >
> >
> >
> > Doug McIlroy:
> >
> > There was some pushback which resulted in the strange compromise
> > of if-fi, case-esac, do-done. Alas, the details have slipped from
> > memory. Help, scj?
> >
> > ====
> >
> > do-od would have required renaming the long-tenured od(1).
> >
> > I remember a tale--possibly chat in the UNIX Room at one point in
> > the latter 1980s--that Steve tried and tried and tried to convince
> > Ken to rename od, in the name of symmetry and elegance. Ken simply
> > said no, as many times as it took. I don't remember who I heard this
> > from; anyone still in touch with Ken who can ask him?
> >
> > Norman Wilson
> > Toronto ON
> >
> >


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 15:45     ` arnold
@ 2017-01-09 15:59       ` ron minnich
  2017-01-09 16:03       ` Clem Cole
  1 sibling, 0 replies; 21+ messages in thread
From: ron minnich @ 2017-01-09 15:59 UTC (permalink / raw)


On Mon, Jan 9, 2017 at 7:47 AM <arnold at skeeve.com> wrote:

> I remember the Bournegol well; I did some hacking on the BSD shell.
>
> In general, it wasn't too unusual for people from Pascal backgrounds to
> do similar things, e.g.
>
>         #define repeat          do {
>         #define until(cond)     } while (! (cond))
>

*was* not unusual? This kind of stuff is still everywhere. In fact there's
probably more of it each month.  It seems to be especially popular in "high
level" languages like C++ but you see tons of it in kernels too.

Some of the worst cpp abuse I've seen is in C++ in fact. One reason I'm
glad Go has no preprocessor.

>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170109/da690d5f/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 15:45     ` arnold
  2017-01-09 15:59       ` ron minnich
@ 2017-01-09 16:03       ` Clem Cole
  2017-01-10 18:44         ` Lawrence Stewart
  1 sibling, 1 reply; 21+ messages in thread
From: Clem Cole @ 2017-01-09 16:03 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

On Mon, Jan 9, 2017 at 10:45 AM, <arnold at skeeve.com> wrote:

> I remember the Bournegol well; I did some hacking on the BSD shell.
>
​Yep - lots of strange things in source debuggers.​



>
> In general, it wasn't too unusual for people from Pascal backgrounds to
> do similar things,
>
​When we did Magnolia & Tektronix the ex-Xerox/Alta guys lusted for
Cedar/Mesa et al - and quickly discovered the Bournegol idea.  ​

I shook my head/shrugged my shoulders, but it made them happy and they
quickly wrote some pretty cool tools, like an ECAD system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170109/c0ac9629/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 15:30   ` Marc Rochkind
  2017-01-09 15:45     ` arnold
@ 2017-01-09 18:48     ` Derek Fawcus
  2017-01-09 20:35     ` Steve Johnson
  2 siblings, 0 replies; 21+ messages in thread
From: Derek Fawcus @ 2017-01-09 18:48 UTC (permalink / raw)


On Mon, Jan 09, 2017 at 08:30:58am -0700, Marc Rochkind wrote:
> If he in fact studied Algol 68, that's worth a story in its own right!

Surrey University, 1986-1990; reading EE,  we had a set of programming
lectures where we were required to learn it (to some extent) as we had
to submit course work written in it.

I tended to do the work in C on the dept Gould running unix,  then
transliterate to Algol 68 for the final submission.  This was because
the compiler was only available as a batch submission process,  and we'd
have long turn arounds just to get past syntax checks.  Especially when
100 of us were trying to submit jobs at the same time.

I still recall the frustration of a few hours turn around just to get
an error about 'semi-colon not required here', which would then complain
'semi-colon required once one removed it'.

I actually quite liked it,  just it was a bit verbose,  and I never figured
out how to do pointers or dynamic allocation in it at the time,  so some
conversions ended up being less than optimal.

As I recall one could convert the ternary op to an IF expression,  and the
loop construct combined all of 'while' 'for' and 'do while' depending upon
which syntax elements one used.

DF


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 15:30   ` Marc Rochkind
  2017-01-09 15:45     ` arnold
  2017-01-09 18:48     ` Derek Fawcus
@ 2017-01-09 20:35     ` Steve Johnson
  2017-01-10 12:24       ` Tony Finch
  2 siblings, 1 reply; 21+ messages in thread
From: Steve Johnson @ 2017-01-09 20:35 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3529 bytes --]

I can certainly confirm that Steve Bourne not only knew Algol 68, he
was quite an evangelist for it.  When he came to the labs, he got a
number of people, including me, to plough through the Algol 68 report,
probably the worst written introduction to anything Ive ever read. 
They were firmly convinced they were breaking new ground and
consequently invented new terms for all kinds of otherwise familiar
ideas.  It was as if the report had been written in Esperanto...  
There were some very cool ideas, particularly the way the type system
worked.  After the simplicity of C, though, we mostly found the
syntax to be off-putting.  Also, as I recall, there really was no
portability strategy for the language, and I think that held it back,
since there were so many different architectures in play at that
time.  Languages like C and Pascal, that had implementations that
could be easily ported, quickly left non-portable languages like Algol
68 and Bliss in the dust...

(Lest I sound like I'm tooting my own horn here, Dennis' PDP-11 C was
based on an intermediate language somewhat like P-code, and was in
fact ported to a couple of different machines before PCC came along...
I learned from the master...)

Steve  

----- Original Message -----
From:
 "Marc Rochkind" <rochkind at basepath.com>

To:

Cc:
"The UNIX Historical Society" <tuhs at tuhs.org>
Sent:
Mon, 9 Jan 2017 08:30:58 -0700
Subject:
Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code

Just a quick note about Algol vs. Algol 68: The two are used
interchangeably (it seems) in this thread, but they're very different
languages, with very different control structures. Someone mentioned
he had studied Algol in school, which is plausible. If he in fact
studied Algol 68, that's worth a story in its own right!

[Whoops... forgot to properly terminate that last sentence.]

fi

--Marc

On Sun, Jan 8, 2017 at 8:31 PM, Steve Johnson <scj at yaccman.com [1]>
 wrote:
I wasn't directly involved in this, but I do remember Dennis telling
me essentially the same story.  I don't recall him mentioning Ken's
name, just that "we couldn't use _od_ because that was already taken".

Steve B and I had adjacent offices, so I overheard a lot of the
discussions about the Bourne shell.  The quoting mechanisms, in
particular, got a lot of attention, I think to good end.  There was a
lot more thought there than is evident from the surface...

Steve (not Bourne)

----- Original Message -----
From:
 "Norman Wilson" <norman at oclsc.org [2]>

To:
<tuhs at tuhs.org [3]>
Cc:

Sent:
Sun, 08 Jan 2017 21:30:03 -0500
Subject:
Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code

 Doug McIlroy:

 There was some pushback which resulted in the strange compromise
 of if-fi, case-esac, do-done. Alas, the details have slipped from
 memory. Help, scj?

 ====

 do-od would have required renaming the long-tenured od(1).

 I remember a tale--possibly chat in the UNIX Room at one point in
 the latter 1980s--that Steve tried and tried and tried to convince
 Ken to rename od, in the name of symmetry and elegance. Ken simply
 said no, as many times as it took. I don't remember who I heard this
 from; anyone still in touch with Ken who can ask him?

 Norman Wilson
 Toronto ON

 

Links:
------
[1] mailto:scj at yaccman.com
[2] mailto:norman at oclsc.org
[3] mailto:tuhs at tuhs.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170109/fbd11a53/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 20:35     ` Steve Johnson
@ 2017-01-10 12:24       ` Tony Finch
  0 siblings, 0 replies; 21+ messages in thread
From: Tony Finch @ 2017-01-10 12:24 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1786 bytes --]

Steve Johnson <scj at yaccman.com> wrote:

> I can certainly confirm that Steve Bourne not only knew Algol 68, he
> was quite an evangelist for it.  When he came to the labs, he got a
> number of people, including me, to plough through the Algol 68 report,
> probably the worst written introduction to anything Ive ever read. 

This is a bit off topic, sorry, but a couple more Algol 68 observations...

> They were firmly convinced they were breaking new ground and
> consequently invented new terms for all kinds of otherwise familiar
> ideas.  It was as if the report had been written in Esperanto...  

Or maybe Latin with the way it inflects words e.g. the -ETY suffix being
sort for "or empty", i.e. an optional thing. Though I don't know what
would be a good comparison for all the elision, e.g. MOID = MODE or VOID,
MODINE = MODE or ROUTINE. (a MODE is what they call a type...)

There's a nicely te-typeset version at
http://www.eah-jena.de/~kleine/history/languages/Algol68-RevisedReport.pdf

The other classic of Algol 68 literature was the Informal Introduction, in
which the structure of the book was arranged in two orthogonal dimensions.
The table of contents is a sight to behold.

http://www.softwarepreservation.org/projects/ALGOL/book/Lindsey_van_der_Meulen-IItA68-Revised-ContentsOnly.pdf

One of my ex-colleagues (now retired) was Chris Cheney, who worked with
Steve Bourne on the Algol 68C project. I think it was on that project
where he invented his beautiful compacting copying garbage collector
algorithm.

Tony.
-- 
f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/  -  I xn--zr8h punycode
Trafalgar: North 5 to 7, occasionally 4 at first. Slight or moderate, becoming
rough or very rough except in far southeast. Occasional rain. Moderate or
good.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09 16:03       ` Clem Cole
@ 2017-01-10 18:44         ` Lawrence Stewart
  0 siblings, 0 replies; 21+ messages in thread
From: Lawrence Stewart @ 2017-01-10 18:44 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]


> On 2017, Jan 9, at 11:03 AM, Clem Cole <clemc at ccc.com> wrote:
> 
> 
> On Mon, Jan 9, 2017 at 10:45 AM, <arnold at skeeve.com <mailto:arnold at skeeve.com>> wrote:
> I remember the Bournegol well; I did some hacking on the BSD shell.
> ​Yep - lots of strange things in source debuggers.​
> 
>  
> 
> In general, it wasn't too unusual for people from Pascal backgrounds to
> do similar things,
> ​When we did Magnolia & Tektronix the ex-Xerox/Alta guys lusted for Cedar/Mesa et al - and quickly discovered the Bournegol idea.  ​
> 
> I shook my head/shrugged my shoulders, but it made them happy and they quickly wrote some pretty cool tools, like an ECAD system.
> 
> 

Speaking as an ex-Xerox/Alto guy, there was some flow in the other direction as well.  Cedar started with a Tenex CMD JSYS derived command line, like the Alto OS before it, but having received the True Word from V7 at Stanford, I wrote a Cedar shell with standard I/O and redirection and shell scripts.  I don’t think I did pipes.  It did become the standard command line interface.  Then Warren Teitelman added DWIM to it which was highly entertaining at times.

-L

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170110/d8ac1821/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09  3:31 ` Steve Johnson
  2017-01-09 15:30   ` Marc Rochkind
@ 2017-01-11  6:00   ` Brantley Coile
  1 sibling, 0 replies; 21+ messages in thread
From: Brantley Coile @ 2017-01-11  6:00 UTC (permalink / raw)


I asked Ken and Steve about this yesterday. 

Ken remembers the request to rename od(1) but not who asked. Steve remembers vaguely asking but suspects he just used do - od and found out the hard way he needed to change it to done. Neither remembers the episode very well so it must not have been a big deal to them at the time. 

   Brantley

> On Jan 8, 2017, at 10:31 PM, Steve Johnson <scj at yaccman.com> wrote:
> 
> I wasn't directly involved in this, but I do remember Dennis telling me essentially the same story.  I don't recall him mentioning Ken's name, just that "we couldn't use od because that was already taken".
> 
> Steve B and I had adjacent offices, so I overheard a lot of the discussions about the Bourne shell.  The quoting mechanisms, in particular, got a lot of attention, I think to good end.  There was a lot more thought there than is evident from the surface...
> 
> Steve (not Bourne)
> 
> ----- Original Message -----
> From:
> "Norman Wilson" <norman at oclsc.org>
> 
> To:
> <tuhs at tuhs.org>
> Cc:
> 
> Sent:
> Sun, 08 Jan 2017 21:30:03 -0500
> Subject:
> Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
> 
> 
> Doug McIlroy:
> 
> There was some pushback which resulted in the strange compromise
> of if-fi, case-esac, do-done. Alas, the details have slipped from
> memory. Help, scj?
> 
> ====
> 
> do-od would have required renaming the long-tenured od(1).
> 
> I remember a tale--possibly chat in the UNIX Room at one point in
> the latter 1980s--that Steve tried and tried and tried to convince
> Ken to rename od, in the name of symmetry and elegance. Ken simply
> said no, as many times as it took. I don't remember who I heard this
> from; anyone still in touch with Ken who can ask him?
> 
> Norman Wilson
> Toronto ON
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170111/4757c346/attachment.html>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-10 13:50 Noel Chiappa
  0 siblings, 0 replies; 21+ messages in thread
From: Noel Chiappa @ 2017-01-10 13:50 UTC (permalink / raw)


    > From: Tony Finch

    > The other classic of Algol 68 literature

No roundup of classic Algol 68 literature would be complete without Hoare's
"The Emperor's Old Clothes".

I assume everyone here has read it, but on the off-chance there is someone
who hasn't, a copy is here:

  http://zoo.cs.yale.edu/classes/cs422/2014/bib/hoare81emperor.pdf

and I cannot recommend it more highly.

	Noel


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-10  4:40 Rudi Blom
  0 siblings, 0 replies; 21+ messages in thread
From: Rudi Blom @ 2017-01-10  4:40 UTC (permalink / raw)


>Date: Mon, 09 Jan 2017 08:45:47 -0700
>From: arnold at skeeve.com
>To: rochkind at basepath.com
>Cc: tuhs at tuhs.org
>Subject: Re: [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
>Message-ID: <201701091545.v09FjlXE027448 at freefriends.org>
>Content-Type: text/plain; charset=us-ascii
>
>I remember the Bournegol well; I did some hacking on the BSD shell.
>
>In general, it wasn't too unusual for people from Pascal backgrounds to
>do similar things, e.g.
>
>        #define repeat          do {
>        #define until(cond)     } while (! (cond))
>
>(I remember for me personally that do...while sure looked weird for.
>my first few years of C programming. :-)
>
>(Also, I would not recommend doing that; I'm just noting that
>people often did do stuff like that.)

When the Philips computer division worked on MPX (multi-processor
UNIX) in late 80tish they had an include file 'syntax.h' which did a
lot of that Pascal-like mapping.

Here part of it:

/* For a full explanation see the file syntax.help */

#define IF		if(
#define THEN		){
#define ELSIF		}else if(
#define ELSE		}else{
#define ENDIF		}
#define NOT		!
#define	AND		&&
#define	OR		||
#define CASE		switch(
#define OF		){
#define ENDCASE		break;}
#define WHEN		break;case
#define CWHEN		case
#define IMPL		:
#define COR		:case
#define BREAK		break
#define WHENOTHERS	break;default
#define CWHENOTHERS	default
#define SELECT		do{{
#define SWHEN		}if(
#define SIMPL		){
#define ENDSELECT	}}while(0)
#define SCOPE		{
#define ENDSCOPE	}
#define BLOCK		{
#define ENDBLOCK	}
#define FOREVER		for(;;
#define FOR		for(
#define SKIP
#define COND		;
#define STEP		;
#define LOOP		){
#define ENDLOOP		}
#define NULLOOP		){}
#define WHILE		while(
#define DO		do{
#define UNTIL		}while(!(
#define ENDDO		))
#define EXITWHEN(e)	if(e)break
#define CONTINUE	continue
#define RETURN		return
#define GOTO		goto


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
       [not found] <mailman.1.1484013601.5032.tuhs@minnie.tuhs.org>
@ 2017-01-10  3:11 ` Paul McJones
  0 siblings, 0 replies; 21+ messages in thread
From: Paul McJones @ 2017-01-10  3:11 UTC (permalink / raw)


> On Jan 9, 2017, at 6:00 PM,"Steve Johnson" <scj at yaccman.com> wrote:
> 
> I can certainly confirm that Steve Bourne not only knew Algol 68, he
> was quite an evangelist for it.

Bourne had led the Algol68C development team at Cambridge until 1975. See http://www.softwarepreservation.org/projects/ALGOL/algol68impl/#Algol68C .



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-09  1:06 Doug McIlroy
@ 2017-01-09  2:18 ` Random832
  0 siblings, 0 replies; 21+ messages in thread
From: Random832 @ 2017-01-09  2:18 UTC (permalink / raw)


On Sun, Jan 8, 2017, at 20:06, Doug McIlroy wrote:
> >  if-fi and case-esac notation from Algol came to shell [via Steve Bourne]
> 
> There was some pushback which resulted in the strange compromise
> of if-fi, case-esac, do-done. Alas, the details have slipped from
> memory. Help, scj?

My guess would be that it was because od already existed as the octal
dump tool. I think I heard it from someone else who was guessing on the
same basis actually.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-09  1:06 Doug McIlroy
  2017-01-09  2:18 ` Random832
  0 siblings, 1 reply; 21+ messages in thread
From: Doug McIlroy @ 2017-01-09  1:06 UTC (permalink / raw)


>  if-fi and case-esac notation from Algol came to shell [via Steve Bourne]

There was some pushback which resulted in the strange compromise
of if-fi, case-esac, do-done. Alas, the details have slipped from
memory. Help, scj?

doug


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-08 20:37 Walter F.J. Mueller
  2017-01-08 21:12 ` Larry McVoy
  2017-01-08 21:54 ` Kay Parker   
@ 2017-01-08 23:14 ` Adam Sampson
  2 siblings, 0 replies; 21+ messages in thread
From: Adam Sampson @ 2017-01-08 23:14 UTC (permalink / raw)


"Walter F.J. Mueller" <w.f.j.mueller at retro11.de> writes:

> [...] to enjoy C with an Algol-look.

For those who enjoy Bournegol, can I also recommend the source code to
David Turner's KRC, which was ported from (EMAS) BCPL to C using a
similar approach. A sample from main.c:

STATIC VOID
DISPLAYCOM()
{  TEST HAVEID()
   THEN TEST HAVE(EOL)
        THEN DISPLAY(THE_ID,TRUE,FALSE); OR
        TEST HAVE((TOKEN)DOTDOT_SY)
        THEN {  ATOM A = THE_ID; LIST X=NIL;
                ATOM B = HAVE(EOL) ? (ATOM)EOL :>       // BUG?
                        HAVEID() && HAVE(EOL) ? THE_ID :
                        0;
                TEST B==0 THEN SYNTAX();
                OR X=EXTRACT(A,B);
                UNTIL X==NIL
                DO {  DISPLAY((ATOM)HD(X),FALSE,FALSE);
                      X=TL(X);  }  } //could insert extra line here between groups 
        OR SYNTAX();
   OR SYNTAX();
}  

http://krc-lang.org/

-- 
Adam Sampson <ats at offog.org>                         <http://offog.org/>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-08 20:37 Walter F.J. Mueller
  2017-01-08 21:12 ` Larry McVoy
@ 2017-01-08 21:54 ` Kay Parker   
  2017-01-08 23:14 ` Adam Sampson
  2 siblings, 0 replies; 21+ messages in thread
From: Kay Parker 	  @ 2017-01-08 21:54 UTC (permalink / raw)


Thanks Walter!
I already read about Algol like C in the Bourne area and now know what
it means. I also read elsewhere that it was a act of freedom when the
Bell Lab boys freed finally themselves from the Bourne 'Algol'
influence.

On Sun, Jan 8, 2017, at 12:37 PM, Walter F.J. Mueller wrote:
> There was thread 'Unix stories' were Stephen Bourne played role.
> 
> Here another story about Stephen Bourne. He worked first on Algol 68,
> than joined the Unix team at Bell labs and wrote sh and adb. It's well
> known that the if-fi and case-esac notation from Algol came to shell
> syntax this way.
> 
> Maybe less know is that Bourne tried as hard as he could to make the
> C code of sh and adb look like Algol, with the help of preprocessor
> macros. I stumbled across this when I looked into the 2.11BSD code
> base some time ago. Look at
> 
>    http://www.retro11.de/ouxr/211bsd/usr/src/bin/sh/main.c.html
>    http://www.retro11.de/ouxr/211bsd/usr/src/bin/adb/main.c.html
> 
> to enjoy C with an Algol-look. The definitions are in
> 
>    http://www.retro11.de/ouxr/211bsd/usr/src/bin/sh/mac.h.html
>    http://www.retro11.de/ouxr/211bsd/usr/src/bin/adb/defs.h.html
> 
> 
> 		Cheers, 	Walter


-- 
  Kay Parker       
  kayparker at mailite.com

-- 
http://www.fastmail.com - Send your email first class



^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-08 21:12 ` Larry McVoy
@ 2017-01-08 21:26   ` Dave Horsfall
  0 siblings, 0 replies; 21+ messages in thread
From: Dave Horsfall @ 2017-01-08 21:26 UTC (permalink / raw)


On Sun, 8 Jan 2017, Larry McVoy wrote:

> > to enjoy C with an Algol-look. 
> 
> "enjoy" :)

Good grief...  I can actually read that, having learned Algol back in my
Computer Science days.

-- 
Dave Horsfall DTM (VK2KFU)  "Those who don't understand security will suffer."


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
  2017-01-08 20:37 Walter F.J. Mueller
@ 2017-01-08 21:12 ` Larry McVoy
  2017-01-08 21:26   ` Dave Horsfall
  2017-01-08 21:54 ` Kay Parker   
  2017-01-08 23:14 ` Adam Sampson
  2 siblings, 1 reply; 21+ messages in thread
From: Larry McVoy @ 2017-01-08 21:12 UTC (permalink / raw)


On Sun, Jan 08, 2017 at 09:37:41PM +0100, Walter F.J. Mueller wrote:
> to enjoy C with an Algol-look. 

"enjoy" :)


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [TUHS] Unix stories, Stephen Bourne and IF-FI in C code
@ 2017-01-08 20:37 Walter F.J. Mueller
  2017-01-08 21:12 ` Larry McVoy
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Walter F.J. Mueller @ 2017-01-08 20:37 UTC (permalink / raw)


There was thread 'Unix stories' were Stephen Bourne played role.

Here another story about Stephen Bourne. He worked first on Algol 68,
than joined the Unix team at Bell labs and wrote sh and adb. It's well
known that the if-fi and case-esac notation from Algol came to shell
syntax this way.

Maybe less know is that Bourne tried as hard as he could to make the
C code of sh and adb look like Algol, with the help of preprocessor
macros. I stumbled across this when I looked into the 2.11BSD code
base some time ago. Look at

   http://www.retro11.de/ouxr/211bsd/usr/src/bin/sh/main.c.html
   http://www.retro11.de/ouxr/211bsd/usr/src/bin/adb/main.c.html

to enjoy C with an Algol-look. The definitions are in

   http://www.retro11.de/ouxr/211bsd/usr/src/bin/sh/mac.h.html
   http://www.retro11.de/ouxr/211bsd/usr/src/bin/adb/defs.h.html


		Cheers, 	Walter


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-01-11  6:00 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-09  2:30 [TUHS] Unix stories, Stephen Bourne and IF-FI in C code Norman Wilson
2017-01-09  3:31 ` Steve Johnson
2017-01-09 15:30   ` Marc Rochkind
2017-01-09 15:45     ` arnold
2017-01-09 15:59       ` ron minnich
2017-01-09 16:03       ` Clem Cole
2017-01-10 18:44         ` Lawrence Stewart
2017-01-09 18:48     ` Derek Fawcus
2017-01-09 20:35     ` Steve Johnson
2017-01-10 12:24       ` Tony Finch
2017-01-11  6:00   ` Brantley Coile
  -- strict thread matches above, loose matches on Subject: below --
2017-01-10 13:50 Noel Chiappa
2017-01-10  4:40 Rudi Blom
     [not found] <mailman.1.1484013601.5032.tuhs@minnie.tuhs.org>
2017-01-10  3:11 ` Paul McJones
2017-01-09  1:06 Doug McIlroy
2017-01-09  2:18 ` Random832
2017-01-08 20:37 Walter F.J. Mueller
2017-01-08 21:12 ` Larry McVoy
2017-01-08 21:26   ` Dave Horsfall
2017-01-08 21:54 ` Kay Parker   
2017-01-08 23:14 ` Adam Sampson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).