Hacker News new | comments | ask | show | jobs | submit login
Users' Reference to B (1972) (bell-labs.com)
66 points by enthd 5 months ago | hide | past | web | favorite | 16 comments

Many many moons ago, we were taught in school that the "C" language got its name because it was the successor to the "B" language, and the next big language would be "P" because the computer industry was iterating through "BCPL."

Can anyone confirm that was true at the time? (Obviously that's not how things worked out.)

Bjarne recounted this story to me personally, but I don’t know if he was serious, or retconning. He’s got a vicious sense of humor, and enjoyed ribbing me in front of my advisor, so I always took his recountings with a heavy grain of salt.

PL = perl, maybe. Quoting Larry Wall:

(A little context first. The topic was "Perl, the first postmodern computer language," which explains the reference to Windows still being "Modern age" and bringing up "pm" as an extension. He mentioned "D" as a possible name of a successor to "C" but it didn't exist yet. "D" did show up 2 years later though.)

> Okay, let’s see. "pm" is an abbreviation for Perl Module, which is why, of course, we use ".pm" is the extension for a Perl module. It used to be that we used ".pl" for Perl code. People still do use ".pl" in Windows, but that’s because they’re all still stuck back in the Modern age. Anyway, there’s a funny thing about using ".pl" for the Perl extension. People used to argue a lot about what the next language after C would be. Everone knew that the previous language had been called "B", after the first letter in BCPL, which came even earlier than B. The two proposed candidates for the next language were "D", because that’s what comes after "C" in the alphabet, and "P", because that was the next letter in BCPL.

> Well, as you can see, it didn’t work out either way. One of the successors to C was C++, which is a cute pun on the autoincrement operator, but makes it an absolute pain to try to figure out what the proper extension for a C++ file should be. .C? .cpp? .cxx? I suppose as a postmodern person, I shouldn’t mind the diversity, but somehow I do. I suppose a little inconsistency is good for the soul.

> Anyway, the other successor to C gobbled up two letters instead of one. Which is why many Perl scripts have the extension, ".pl", finishing off BCPL. It’s a pity, in a way. Now there can never be a language named "L". Perhaps it’s just as well. Quite apart from the annual yuletide puns we’d get on "noel, noel", there’s also the problem that people would have confused the language with lex, which already uses a ".l" extension. Since lex had already taken it, noel was available. So to speak. Sorry.


Pascal came out in 1970; C in 1972...

C dates to 1969. It was used to write Unix, the first release of which was 1969.


EDIT: I'm guessing you're getting this factoid from Wikipedia? Looks like an error. The quote it references as justification of the origin of C is misinterpreted. Thompson tried to write an operating system ONLY in C prior to 1972, but failed. Very early Unix was a mixture of C and assembly. Later versions, which Ritchie is referencing, used assembly only for the parts you really can't specify in C -- the boot loader and interrupt handlers. C was kinda a work in progress between 1969 and 1973 (see above link), and still after as it transitioned from K&R C to ANSI C. But there were releases accompanying Unix before it stopped drastically changing circa 1973.

> C dates to 1969. It was used to write Unix, the first release of which was 1969.

Wrong. Early Unix was written in assembly, the machine was too small for anything else and moreover C didn't exist then. From the DMR's chist link (1) that you also refer to:

"Dennis Ritchie turned B into C during 1971-73"

Even B was definitely not used to write the Unix of 1969-1973, but only run on it:

"On the PDP-7 Unix system, only a few things were written in B except B itself, because the machine was too small and too slow to do more than experiment; rewriting the operating system and the utilities wholly into B was too expensive a step to seem feasible."

Unix kernel was rewritten from assembly to C only in 1973:

"By early 1973, the essentials of modern C were complete. The language and compiler were strong enough to permit us to rewrite the Unix kernel for the PDP-11 in C during the summer of that year. "

The first Pascal compiler existed in 1970 which was inspired by Algol 60. Wirth was in its "Working Group 2.1" in 1964. (2) Wirth published an article about Pascal in ACM in 1971.

Finally, in the Go language (from 2009), in which Thompson was also involved, the declarations follow more the Pascal spirit than the C spirit.

1) http://www.bell-labs.com/usr/dmr/www/chist.html

2) http://pascal.hansotten.com/niklaus-wirth/recollections-abou...

I was taught that too, never thought about it again until now!

Well the spiritual successor to C is "D", so...


I wouldn't say that. D is more of a response to c++ and java than to c.

Check out his latest language: https://golang.org/ref/spec

What percentage of involvement was him in the language design?

You might also like Rich Wareham’s B compiler (written in Python with llvm) https://github.com/rjw57/rbc

B was typeless but C is now the very definition of a typed language. B had BCD (Binary coded decimal) constants with backticks. Of course that out of fashion. B had semicolons separating statements.

I wrote a compiler for B some years ago. The code generation is horrible but it was a fun project: https://github.com/aap/abc/ Still mean to port that to the PDP-10 eventually.

The title says "(1996)", but the document itself says "This is a rendition, after scanning, OCR, and editing, of an internal Bell Labs Technical Memorandum dated January 7, 1972."

OK we've rolled it back to 1972. Thanks!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact