From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 02d0174d for ; Wed, 8 Jan 2020 16:04:26 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id D85EF9BCCF; Thu, 9 Jan 2020 02:04:24 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id CAAD99BCBE; Thu, 9 Jan 2020 02:03:15 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="AWWmHnVL"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id AF8A59BCA9; Thu, 9 Jan 2020 02:03:11 +1000 (AEST) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by minnie.tuhs.org (Postfix) with ESMTPS id 2B7029BCA9 for ; Thu, 9 Jan 2020 02:03:09 +1000 (AEST) Received: by mail-qk1-f179.google.com with SMTP id z14so3058884qkg.9 for ; Wed, 08 Jan 2020 08:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=yXYzYG49QMhZWNcmtU1HaTcsW4VVCsc+yZrKWi6H6Ko=; b=AWWmHnVLyffGjNn8YwPY7kxFjauDB5yvPYAG7obqGya0SNW1znwZppzAGJbp2XTVyw R1ZdiWB0xFSUjSgJkMRuOhc44ptKh6R3yUbs7nbLop9Jt2rmpPihl9F1Y6z263ftJGjg Ny+RiFBgh4oz8J8q4ExR1c51PFVP5L1YIkXhE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=yXYzYG49QMhZWNcmtU1HaTcsW4VVCsc+yZrKWi6H6Ko=; b=j4e99QJyAMmosCY9EDv2nOijVBK7EJOClYd9jT87Ik1K4jcH7b6TS3BMfXI0MoFhcC 5AMLcytbHITk4ugEcmz7GC/tH/GfrcxmhM6MZrmD7NboXzEFq7YQG8YiPqb2O2pBBKd5 e2jsrQKFzUEqsGaZVBeyAWiyZ6OeG/J8zBVtjH8z94MYyS720a8Q/dOjF90Ygedr8Zom 3pXS64D7Gy5Y0KDUgIAHe8v8IaBtm2eVm3NTytV3He1wVieaOYi0J87hd0CztyMbgrgy cevdyUhrc9YpYnuOgNhEshV9BMQbocaEO6YJUCl3cYK9mvKipn8M7ZvZYt3xdp09vlbm NA7w== X-Gm-Message-State: APjAAAWh3gxYFBxlxffAGEm/ctPbX9tgEqplrtmkG7k5tlGZdUwooYzu /FXVPxBnLdEpjUiHvuPZkNtnqCTKNvM9rrTx9SJi7Y5YSQwHDA== X-Google-Smtp-Source: APXvYqz8PveQvpc+gVWA+mUfw8Uk1zC1Vaj3VGnO3n0oEtAfjV++OL1aOq9Rw9Mlnj+lXJmPrEpKSuCBDAQarboMUZc= X-Received: by 2002:a05:620a:6cc:: with SMTP id 12mr5154005qky.307.1578499387969; Wed, 08 Jan 2020 08:03:07 -0800 (PST) MIME-Version: 1.0 From: Clem Cole Date: Wed, 8 Jan 2020 11:02:41 -0500 Message-ID: To: Brian Walden Content-Type: multipart/alternative; boundary="0000000000004c69a6059ba30755" Subject: Re: [TUHS] [TUHS -> moving to COFF] # and the Preprocessor X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Computer Old Farts Followers , TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000004c69a6059ba30755 Content-Type: text/plain; charset="UTF-8" below... -- warning veering a little from pure UNIX history, but trying to clarify what I can and then moving to COFF for follow up. On Wed, Jan 8, 2020 at 12:23 AM Brian Walden wrote: > .... > > - CMU's ALGOL68S from 1978 list all these ways -- > co comment > comment comment > pr pragmat > pragmat pragmat > # (comment symbol) comment > :: (pragmat symbol) pragmat > (its for UNIX v6 or v7 so not surprising # is a comment) > http://www.softwarepreservation.org/projects/ALGOL/manual/a68s.txt/view Be careful of overthinking here. The comment in that note says was it was for* PDP-11's *and lists V6 and V7 was *a possible target*, but it did not say it was. Also, the Speach and Vision PDP-11/40e based systems ran a very hacked v6 (which a special C compiler that supported CMU's csv/cret instructions in the microcode), which would have been the target systems. [1] To my knowledge/memory, the CMU Algol68 compiler never ran anywhere but Hydra (and also used custom microcode). IIRC there was some talk to move it to *OS (Star OS for CM*) I've sent a note to dvk to see if he remembers it otherwise. I also ask Liebensperger what he remembers, he was hacking on *OS in those days. Again, IIRC Prof. Peter Hibbard was the mastermind behind the CMU Algol68 system. He was a Brit from Cambridge (and taught the parallel computing course which I took from him at the time). FWIW: I also don't think the CMU Algol68 compiler was ever completely self-hosting, and like BLISS, required the PDP-10 to support it. As to why it was not moved to the Vax, I was leaving/had left by that time, but I suspect the students involved graduated and by then the Perq's had become the hot machine for language types and ADA would start being what the gvt would give research $s too. > > > ... > > But look! The very first line of that file! It is a single # sitting all > by itself. Why? you ask. Well this is a hold over from when the C > preprocessor was new. C orginally did not have it and was added later. > PL/I had a %INCLUDE so Ritchie eventaully made a #include -- but pre 7th > Edition the C preprocessor would not be inkoved unless the very first > character of the C source file was an # > That was true of V7 and Typesetter C too. It was a separate program ( /lib/cpp) that the cc command called if needed. > Since v7 the preprocessor always run on it. The first C preprocessor was > Ritchie's work with no nested includes and no macros. v7's was by John > Reiser which added those parts. > Right, this is what I was referring too last night in reference to Sean comments. As I said, the /bin/cc command was a shell script and it peaked at the first character to see if it was #. I still find myself starting all C programs with a # on a line by itself ;-) Note that the Ritchie cpp was influenced by Brian's Ratfor work, so using # is not surprising. This leads to a question/thought for this group, although I think needs to move to COFF (which I have CC'ed for follow up). I have often contended, that one of the reasons why C, Fortran, and PL/1 were so popular as commercial production languages were because they could be preprocessed. For a commercial place where lots of different targets is possible, that was hugely important. Pascal, for instance, has semantics that makes writing a preprocessor like cpp or Ratfor difficult (which was one of the things Brian talks about in his "*Why Pascal is not my favorite Programming Language *" paper). [2] So, if you went to commercial ISV's and looked at what they wrote in. It was usually some sort of preprocessed language. Some used Ratfor like a number of commercial HPC apps vendors, Tektronix wrote PLOT10 in MORTRAN. I believe it was Morgan-Stanley had a front-end for PL/1, which I can not recall the name. But you get the point ... if you had to target different runtime environments, it was best for your base code to not be specific. However ... as C became the system programming language, the preprocessor was important. In fact, it even gave birth the other tools like autoconfig to help control them. Simply, the idiom: #ifdef SYSTEMX #define SOME_VAR (1) ... do something specific #endif /* SYSTEMX */ While loathsome to read, it actually worked well in practice. That fact is I hate the preprocessor in many ways but love it for what it for the freedom it actually gave us to move code. Having programmed since the 1960s, I remember how hard it was to move things, even if the language was the same. Today, modern languages try to forego the preprocessor. C++'s solution is to throw the kitchen sink into the language and have 'frameworks', none of which work together. Java's and its family tries to control it with the JVM. Go is a little too new to see if its going to work (I don't see a lot of production ISV code in it yet). Note: A difference between then and now, is 1) we have few target architectures and 2) we have fewer target operating environments, 3) ISV don't like multiple different versions of their SW, they much prefer very few for maintenance reasons so they like # 1 and #2 [i.e. Cole's law of economics in operation here]. So ... my question, particularly for those like Doug who have programmed longer and at least as long as I, what do you think? You lived the same time I did and know the difficulties we faced. Is the loss of a preprocessor good or bad? Clem [1] Historical footnote about CMU. I was the person that brought V7 into CMU and I never updated the Speach or Vision systems and I don't think anyone did after I left. We ran a CMU V7 variant mostly on the 11/34s (and later on a couple of 11/44s I believe) that had started to pop up. Although later if it was a DEC system, CS was moving to Vaxen when they could get the $s (but the Alto's and Perq's had become popular with the CMU SPICE proposal). Departments like bio-engineering, mech ee, ran the cheaper systems on-site and then networked over the Computer Center's Vaxen and PDP-20's when they needed address space). [2] Note: Knuth wrote "Web" to handle a number of the issues, Kernighan talks about - but he had to use an extended Pascal superset and his program was notable for not being portable (he wrote for it for the PDP-10 Pascal). [BTW: Ward Cunningham, TW Cook and I once counted over 8 different 'Tek Pascal' variants and 14 different 'HP Basics']. --0000000000004c69a6059ba30755 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
below...=C2=A0= -- warning veering a little from pure UNIX history, but trying to clarify = what I can and then moving=C2=A0to COFF for follow up.
On Wed, Jan 8, 2020 at 12:23 AM Brian Walden <tuhs@cuzuco.com> wrote:
= ....

- CMU's ALGOL68S from 1978 list all these ways --
=C2=A0 co=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comment
=C2=A0 comment=C2=A0 =C2=A0 =C2=A0 =C2=A0comment
=C2=A0 pr=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pragmat
=C2=A0 pragmat=C2=A0 =C2=A0 =C2=A0 =C2=A0pragmat
=C2=A0 #=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(comment symbol) co= mment
=C2=A0 ::=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (pragmat symbol) pragmat=
=C2=A0 (its for UNIX v6 or v7 so not surprising # is a comment)
=C2=A0 http://www.softwarepre= servation.org/projects/ALGOL/manual/a68s.txt/view
Be careful=C2=A0of overthinking here.=C2=A0 = =C2=A0The comment in that note says was it was for PDP-11's and = lists V6 and V7 was a possible target, but it did not say it was.=C2= =A0 Also, the Speach and Vision PDP-11/40e based systems ran a very hacked = v6 (which a special C compiler that supported CMU's csv/cret instructio= ns in the microcode), which would have been the target systems. [1]<= /span>=C2=A0

=
To my knowledge/memory, the CMU Algo= l68 compiler never ran anywhere but Hydra (and also used custom microcode).= =C2=A0 IIRC there was some talk to move it to *OS (Star OS for CM*)=C2=A0 I= 've sent a note to dvk to see if he remembers it otherwise. I also ask = Liebensperger what he remembers, he was hacking on *OS in those days.=C2=A0= Again, IIRC Prof. Peter Hibbard was the mastermind behind the CMU Algol68 = system.=C2=A0 He was a Brit from Cambridge (and taught the parallel computi= ng course which I took from him at the time).
<= font color=3D"#0000ff">
FWIW: I also don't think the CMU Algol68 compiler was ever complet= ely self-hosting, and=C2=A0like BLISS, required the PDP-10 to supp= ort it.=C2=A0 As to why it was not moved to the Vax, I was leaving/had = left by that time, but I suspect the students involved graduated and= by then the Perq's had become the hot machine for language types a= nd ADA would start being what the gvt would give research $s too.=C2=A0=C2=A0
=C2=A0


...

But look! The very first line of that file! It is a single # sit= ting all by itself.=C2=A0 Why? you ask. Well this is a hold over= from when the C preprocessor was new. C orginally did not have = it and was added later. PL/I had a %INCLUDE so Ritchie eventaully made a #include -- but pre 7th Edition the C preprocessor would not be inkoved unless the very first character of the C source file was a= n #
That was true of V7 and Types= etter C too.=C2=A0 It was a separate program (/lib/cpp) that the cc command called i= f needed.

=C2=A0
Since v7 the preprocessor always run on it. The first C preprocessor was Ritchie's work with no nested includes and no macros. v7's= was by John Reiser which added those parts.
Right, this is what I was re= ferring too last night in reference to Sean comments.=C2=A0 As I said, the = /bin/cc= c= ommand was a shell script and it peaked at the first character to see if it= was #.=C2=A0 =C2=A0I still find myself starting all C programs with a # on= a line by itself ;-)

N= ote that the Ritchie cpp was influenced by Brian's Ratfor work, so usin= g # is not surprising.

This leads to a question/thought for this gr= oup, although I think needs to move to COFF (which I have CC'ed for fol= low up).

I have often contended, that one of = the reasons why C, Fortran, and PL/1 were so popular as commercial producti= on languages were because they could be preprocessed.=C2=A0 For a commercia= l place where lots of different targets is possible, that was hugely import= ant.=C2=A0 Pascal, for instance, has semantics that makes writing a preproc= essor like cpp or Ratfor difficult (which was one of the things Brian talks= about in his "Why Pascal is not my favorite Programming Language" pap= er). [2]

So, if you went to commercial ISV= 9;s and looked at what they wrote in.=C2=A0 =C2=A0It was usually some sort = of preprocessed language.=C2=A0 =C2=A0Some used Ratfor like a number of com= mercial=C2=A0HPC apps vendors, Tektronix wrote PLOT10 in MORTRAN.=C2=A0 =C2= =A0I believe it was Morgan-Stanley had a front-end for PL/1, which I can no= t recall the name.=C2=A0 But you get the point ... if you had to target dif= ferent runtime environments, it was best for your base code to not be speci= fic.

However= ... as C became the system programming language, the preprocessor was impo= rtant.=C2=A0 In fact, it even gave birth the other tools like autoconfig to= help control them.=C2=A0 Simply, the idiom:
#ifdef SYSTEMX
#define SOME_VAR (1)
... do something specific
#endif /* SYSTEMX */

While loathsome to read, it= actually worked well in practice.=C2=A0

That fact is I hat= e the preprocessor in many ways but love it for what it for the freedom it = actually gave us to move code.=C2=A0 Having programmed since the 1960s, I r= emember how hard it was=C2=A0to move things, even if the language was the s= ame.

Today, modern languages try to forego the preprocessor.=C2=A0 = =C2=A0C++'s solution=C2=A0is to throw the kitchen sink into the languag= e and have 'frameworks', none of which work together.=C2=A0 =C2=A0J= ava's and its family tries to control it with the JVM.=C2=A0 Go is a li= ttle too new to see if its going to work (I don't see a lot of producti= on ISV code in it yet).

Note: A difference between then and = now, is 1) we have few target architectures and 2) we have fewer target ope= rating environments, 3) ISV don't like multiple different versions of t= heir SW, they much prefer=C2=A0very few for maintenance reasons so they lik= e # 1 and #2 [i.e. Cole's law of economics in operation here].

= So ... my question, particularly for those like Doug who have programmed lo= nger and at least as long as I, what do you think?=C2=A0 =C2=A0You lived th= e same time I did and know the difficulties we faced.=C2=A0 =C2=A0Is the lo= ss of a preprocessor good or bad?
Clem

[1] Historical footnote about CMU.=C2=A0 =C2=A0I was the p= erson that brought V7 into CMU and I never updated the Speach or Vision sys= tems and I don't think anyone did after I left.=C2=A0 We ran a CMU V7 v= ariant mostly on the 11/34s (and later on a couple of 11/44s I believe) tha= t had started to pop up.=C2=A0 Although later if it was a DEC system, CS wa= s=C2=A0moving to Vaxen when they could get the $s (but the Alto's and P= erq's had become popular with the CMU SPICE proposal).=C2=A0 Department= s like bio-engineering, mech ee, ran the cheaper systems on-site and then n= etworked over the Computer Center's Vaxen and PDP-20's when they ne= eded address space).
=
[2]=C2=A0Note: Knuth wrote "Web" to handle a number of the issues, Ker= nighan talks about - but he had to use an extended Pascal superset and his = program was notable for not being portable (he wrote for it for the PDP-10 = Pascal).=C2=A0 [BTW: Ward Cunningham, TW Cook and I once counted over 8 dif= ferent 'Tek Pascal' variants and 14 different 'HP Basics'].=

--0000000000004c69a6059ba30755--