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 <tuhs(a)cuzuco.com> 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 <http://www.lysator.liu.se/c/bwk-on-pascal.html>*"
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'].
U'll Be King of the Stars wrote in <68b3d6df-94f6-625d-39bf-6149b4c177c9\
@andrewnesbit.org>:
|On 08/01/2020 15:15, Steffen Nurpmeso wrote:
|> (But i think emacs is better here, i see one markable
|> emacs developer taking care on the Unicode list, regarding real
|> BiDi support, for example.)
|
|I have been following the emacs-devel mailing list out of interest for
|many years. From this, I think the person you are referring to in your
|comment, is Eli Zaretskii. Is that right?
Yep. Then again i have to say it was a lot of a mistake, because
the OSS man who i referred to and who is known for questions deep
in the material is indeed Karl Williamson of i think Perl.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
This web page has some details about XENIX prior to 1985:
http://seefigure1.com/2014/04/15/xenixtime.html
In particular this chart is intriguing:
http://seefigure1.com/images/xenix/xenix-timeline.jpg
I’d love to have XENIX from the 1980-1985 era in the TUHS archive, as it documents the tail end of the Unix on 16 bits era. It would have been great if MS had released that as part of the Unix-at-50 events.
Paul
Hi,
Does the wump.c source exist for v6? The game's in the distribution and
so is the man page, but I can't find the source. I see it's in v7, but I
don't know the provenance of the game source, hence the question.
I find the following interesting... in the v7 source it says:
/*
* wumpus
* stolen from PCC Vol 2 No 1
*/
But it's actually from PCC Vol 2 No 2 (Nov 1973):
https://archive.computerhistory.org/resources/access/text/2017/09/102661095…
and the basic source is given in the games issue:
https://archive.computerhistory.org/resources/access/text/2017/09/102661095…
The correct volume is noted in the v6 manpage:
This program is based on one described in 2 (No-
vember 1973). It will never replace Space War.
and in the v7 manpage:
This program is based on one described in People's Computer
Company, 2, 2 (November 1973).
BUGS
It will never replace Space War.
I'm curious if it was ported to c for v6, or if it was basic?
Thanks,
Will
--
GPG Fingerprint: 68F4 B3BD 1730 555A 4462 7D45 3EAA 5B6D A982 BAAF
Dave Horsfall wrote:
>On Tue, 7 Jan 2020, Bakul Shah wrote:
>
>> In Algol68 # ... # is one of the forms for block comments!
>
>Interesting... All we had at university though was ALGOL W (as far as I
>know; there were several languages that mere students could not use, such
>as FORTRAN H).
Yes, but when was it implemented? Kernighan is first ever if it is not
before 1974. So I decided to look and it took me down a rabbit hole of
ALGOL taht leads back to Bourne shell and then right back to # (but in C)
By reading the ALGOL 68 wiki page, the laguange seemed to have had a
character set problem since day one, and it seems if you didn't have the
cent-sign you were to use PR for pragmat for comments. And since it
had problems it was continually extened. I just cant find when # was defined.
I looked at various old implementations (none pre 1974 list #) --
- CDC's ALGOL 68 compiler from 1975 you could only use use PR .. PR
(both # and CO were not defined)
http://www.bitsavers.org/pdf/cdc/Tom_Hunter_Scans/Algol_68_version_1_Refere…
- The official revised ALGOL86 spec from 1978 lists all these ways to enter
them (bottom of page 112) in this order --
brief comment symbol: cent-sign
bold comment symbol: comment
style 1 comment symbol: co
style 2 comment symbol: #
bold pragmat symbol: pragmat
style 1 pragmat symbol: pr
seeing # is "style 2" it looks like a later extention to me
http://www.softwarepreservation.org/projects/ALGOL/report/Algol68_revised_r…
- ALGOL68/19 from 1975 list these 4 symbols as comments: # % co pr
http://www.softwarepreservation.org/projects/ALGOL/manual/Gennart_Louis-Alg… 68_19_Reference_Manual.pdf
- DECs ALGOL (1976 printing but first released was 1971) for system10 uses
a ! for a comment as # means "not equal" --
http://www.bitsavers.org/www.computer.museum.uq.edu.au/pdf/DEC-10-LALMA-B-D… decsystem10%20ALGOL%20Programmer's%20Reference%20Manual.pdf
- 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
- Rutgers ALGOL 68 interprter from 1987 for UNIX does not implement
PR nor PRAMAT and says comments are # CO or COMMENT
https://www.renyi.hu/~csirmaz/algol-68/linux/manual
I could not find a freely accessible manual for ALGOL68R (very 1st one) nor
Cambridge's ALGOL68C. What's intresting here is Stephen Bourne was on the
team that made ALGOL68C before he move to Bell Labs. It'd be pretty funny
if he implemented a language that there were 7 or 8 ways to enter a comment
(cent, co, comment, pr, pragmat, #, ::, %) yet there were zero ways
to enter a comment in the Bourne shell.
Also the style of "COMMENT put a note here COMMENT" is very un-ALGOL like
(with DO .. OD, IF .. FI) shouldn't it be like this?
COMMENT put a note here TNEMMOC
CO put a note here OC
PRAGMAT directive here TAMGARP
PR directive here RP
So then I remembered Bourne used the C preprocssor to make C like ALGOL when
he wrote the shell. If you've never seen it, his C looks like this --
case TSW:
BEGIN
REG STRING r = mactrim(t->swarg);
t=t->swlst;
WHILE t
DO ARGPTR rex=t->regptr;
WHILE rex
DO REG STRING s;
IF gmatch(r,s=macro(rex->argval)) ORF (trim(s), eq(r,s))
THEN execute(t->regcom,0);
t=0; break;
ELSE rex=rex->argnxt;
FI
OD
IF t THEN t=t->regnxt FI
OD
END
break;
ENDSW
So I wanted to see if he remapped C comments /* */
I am not even sure you could even do that with the C preprocessor
but took alook anywy and in
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/xec.c
It's first lines are this --
#
/*
* UNIX shell
*
* S. R. Bourne
* Bell Telephone Laboratories
*
*/
#include "defs.h"
#include "sym.h"
So nope, just regular C comments (which came from PL/I btw which was
what multics was programmed in)
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 #
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.
that 1st line with a single # sitting by itself reminds me of the
csh construct as well.
-Brian
A bit more on this.
csh(1) was wrtten around 1978 and yes # as a comment was only for
scrtipts, think it was why would you need to comment interactively?
And the # as an addition to be a comment in Bourne shell had to be around 1980
as that is when Dennis Ritchie added #! to exec(2) in the kernel. From this
point on this forced all UNIX scripting languages to use # as a comment as
it just exec'd the first string after the #! with the name of the current
file being exec'd as the single argument. So things like perl(1) and python(1)
had to use # if they wanted the #! mechanism to work for them too.
So this worked great for shell scripts, it didn't work for awk(1) nor sed(1)
nor s(1)(that is R(1) now) scripts (all needed a -f for input from file)
nor dc(1) scripts as dc had no comment character.
While Research UNIX got !# in 1980, this was after the 7th Edition release
and the 8th Edition wasn't released until 1985), BSD got it around 1982-83,
and System V didn't implement it until 1988. Eventully #! was extented
so #!/usr/bin/awk -f would work.
Also Bill Joy was the first to use # as a comment character in an /etc config
file for his /etc/ttycap (which became /etc/termcap) for vi(1). Most configs
did not have a comment at all at that time, while /etc/master used a * as a
comment (SCCS used * as a comment too btw)
Also before you say wait! ALGOL uses # as comment and is older than
Kernighan' ratfor(1). This is a later addition. The original used the EBCDIC
cent sign character to start and another cent sign to end the comment
(i.e. programmer's two cents). If you were on an ASCII system this became
"co" (for comment) as the original ASCII does not have a cent sign
-Brian
McIlroy:
> [vi] was so excesssive right from the start that I refused to use it.
> Sam was the first screen editor that I deemed worthwhile, and I
> still use it today.
Paulsen:
> my sam build is more than 2 times bigger than Gunnar Ritter's vi
> (or Steve Kirkendall's elvis) and even bigger than Bram Moolenaar's vim.
% wc -c /bin/vi bin/sam bin/samterm
1706152 /bin/vi
112208 bin/sam
153624 bin/samterm
These mumbers are from Red Hat Linux.
The 6:1 discrepancy is understated because
vi is stripped and the sam files are not.
All are 64-bit, dynamically linked.
Clem Cole wrote:
>A heretic!! Believers all know '*Bourne to Program, Type with Joy' *and*
>'One true bracing style' *are the two most important commandments of UNIX
>programmer!
>
>Seriously, I still write my scripts as v7 and use (t)csh as my login shell
>on all my UNIX boxes ;-)
>
>Clem
You know what's amazing? that Bill Joy code to launch either
csh or bourne shell based on the first character of teh file is
still in tcsh codebase today. It even has #! support just in case
your kernel does not. However this code never gets run as
who write scripts without #! anymore .. but here's a little test ---
$ tcsh
You have 2 mail messages.
> cat x1.sh
PATH=/bin
echo $SHELL
> ./x1.sh
/bin/sh
> cat x2.csh
#
setenv path /bin
echo $shell
> ./x2.csh
/usr/local/bin/tcsh
> exit
you can see it in https://github.com/tcsh-org/tcsh/blob/master/sh.exec.c
-Brian
Doug McIlroy wrote:
>Brian Walden's discussion of sh #, etc, is right on.
>However, his etymology for unary * in C can be
>pushed back at least to 1959. * was used for
>indirect addressing in SAP, the assembler for
>the IBM 7090.
Thank you for both the confirmation and also that history update.
-Brian
>
>> From: Warner Losh <imp(a)bsdimp.com>
>
>> There's no wupus source before V7.
>
> If you look at Clem's original message:
>
>>> From: Clem Cole <clemc(a)ccc.com>
>>> Date: Mon, 6 Jan 2020 16:08:50 -0500
>
>>> You got my curiosity up and found the V5 and V6 source code
>
> (the one Will was replying to), Clem's talking about the source to crt0.s,
> etc.
>
> Noel
>
Sorry. I could have been clearer. I thought Clem was saying that he found the Wumpus code in v5/v6. Now, I see that he was just talking about the crt files. When I said I couldn’t find the source prior to v7, I meant the wumpus source :).
On another note, porting the v7 code to MacOS is tricky, lots of minor differences, but I’m giving it a go. Prolly easier to just figure out what it’s supposed to do and do it with modern idioms, but it’s a fun puzzle to try to replicate the same functionality with only minor adjustments.
Will