Talk:B (programming language)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject C/C++ (Rated Start-class, Low-importance)
WikiProject icon This article is within the scope of WikiProject C/C++, a collaborative effort to improve the coverage of C/C++ on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the quality scale.
 Low  This article has been rated as Low-importance on the importance scale.
Taskforce icon
This article falls within the scope of C.


Is it really NPOV to say that B "probably should have died" but "survived because [some] poor deprived (and depraved) systems didn't have anything better"? I've never used B, but I kind of like typeless languages like FORTH. (I find the Lions book Unix kernel code more readable that much modern C largely because of the aBsence of type annotations in the code.) -- Kragen

Not completely NPOV :-) But B is a real pain to implement and use on most modern computers. Its whole notion of "address" and "word" just doesn't match modern hardware. (I have "writing a B compiler for 386" on my list of "silly projects to do sometime", so i have given these issues some thought.)

It's neither NPOV nor accurate, based on my four years programming with it on a dual CPU Honeywell 66/60 mainframe in the 1981-85 period, working with the Mollusc CLI. C is definitely better but not that much better. B had all of the core concepts required for systems programming in that environment, though it definitely lacked some C refinements I appreciate. I didn't have any significant character type issues using it with 9 bit bytes and 36 bit machine words. Was certainly way better than doing systems programming in FORTRAN...:) The greater impediment on that system was the line editor, which taught me regular expressions very well but was a real pain to use for editing. The line editor was the best editor available on the system. I've read a rather better history of the evolution of the language and I'll update the article a bit more after doing the necessary research to find it again.JamesDay 20:12, 12 Sep 2003 (UTC)

Just did that and added links to the sources. JamesDay 19:25, 25 Oct 2003 (UTC)

When one introduces terms such as "better" or "worse", that is injecting an opinion. And that, by definition, cannot be NPOV. Having used B (a little), C, C++, ... I can say that many of the statements in the article, and also within this "talk" section are simply false. The "history" about the ++ / -- operations are also untrue .. because those are clearly direct derivatives of the DEC PDP instruction set, or at the very least, were inspired by them. That's obvious to anyone who's ever written code for or even looked at an old PDP-7 (or later) programming manual. The PDP-7 was most certainly around when the B language was developed. There's too much wrong with this article to even know where to begin actually. I agree, in its current form it's practically useless for either a novice, or a computer engineer - since it contains so many errors and omissions. — Preceding unsigned comment added by (talk) 23:31, 30 September 2016 (UTC)

A non-specialist’s complaint[edit]

I would so like to comprehend this article. A general encyclopedia is meant to enlighten and explain but I am afraid this is well beyond me. B programming language is not best-known to me. What did BCPL have that is now stripped away to become language B and that Ken Thompson felt he could do without? Is there a lesser-known language that might have equally been of use? What are GCOS that are being run by Honeywell 36 bit mainframes?

These are only a few questions that might be asked by someone uninitiated in the finer arts of computer-speak. You might start like: “B programming language was a transitional phase between BCPL and C. BCPL consisted of …. but was felt to be redundant by … Ken Thompson…. because …”, etc. Who was Ken Thompson, anyway? The article as it stands is next to useless because there are so many things unexplained. Dieter Simon 01:16, 18 Jun 2004 (UTC)

"Character data type"?[edit]

The article says:

The typeless nature of B made sense on the Honeywell, PDP-7 and many older computers, but was a problem on the PDP-11 because it was difficult to elegantly access the character data type that the PDP-11 and most modern computers fully support.

What does the "character data type" refer to? (Just some notion of a single byte type that allows 7-bit ASCII plus extensions to be represented, or something more complex?) I think it would be worth elaborting on what this feature is and why it wasn't convenient to use with B. Neilc 10:32, 19 Jun 2005 (UTC)

(Not sure if this belongs on the page. Hard-core techies already know, and most others don't care, but here's the answer: here "character data type" just refers to a simple byte type, typically 8 or 9 bits in B implementations, though at least one also supported 6 bit characters. The difficulty arises with addresses. When B words are interpreted as addresses, they are the addresses of words (variously 16, 18, or 36 bits on known implementations). Incrementing an address gives you the address of the following word. This is the same as the hardware addressing scheme on the PDP-7 and Honeywell machines, but different to almost anything modern, where addresses are of bytes. Addresses are very important in B (as in C), for instance they are the only way to do call-by-reference, to refer to dynamically allocated objects etc. So it can be a pain that you can't obtain the address of a byte, especially on a modern machine where the hardware does support that. BTW, the way characters were handled in B was via a pair of library functions char(string, i) which gave as result the i'th character of a string which started at the word address string, and lchar(string, i, ch) which updated i'th character of string to have value ch. )

Source of name "B"?[edit]

Dan Gookin claims in "C For Dummies Volume One" (in the antiquitated version that I have) that B stood for Bell Labs. Is that not correct? -- 16:03, 3 August 2006 (UTC)

Dennis Ritchie (who worked with Thompson on B) doesn't think so. He claims that it is a contraction of BCPL. -- Derek Ross | Talk 06:53, 22 October 2006 (UTC)

Weird stuff in History section.[edit]

"Ken Thompson wrote B basing it mainly on the BCPL language he had used to write Unix while in the Multics project." I think we need to lose the "to write Unix". Then the sentence makes sense and is in agreement with B history as remembered by Dennis Ritchie. (talk) 16:13, 6 December 2011 (UTC)

I agree. Dennis Ritchie's <The Development of the C Language> , states that, "While wanting to use a higher-level language, he [Thompson] wrote the original Unix system in PDP-7 assembler." This is not consistent with the information on this page. Therefore I think changing the sentence to, "Ken Thompson wrote B basing it mainly on the BCPL language he had used in the Multics project.", is justifiable. ctype.h 18:09, 9 November 2012 (UTC)