Specs for 'B' language 
Author Message
 Specs for 'B' language

I'm looking for a reference that gives the specifications (grammar and
semantics) of the 'B' language (predecessor of 'C'). The language has
been discussed on Usenet in general terms, but I'd be interested in the
level of detail needed actually to implement it (if you _must_ know,
it's a small retrocomputing project, just for hack value).




PGP key available via finger (to df.lth.se) or on request.



Sat, 01 Mar 1997 03:22:07 GMT  
 Specs for 'B' language
|> I'm looking for a reference that gives the specifications (grammar and
|> semantics) of the 'B' language (predecessor of 'C'). The language has

Dennis Ritchie wrote a description of the history of C for an HOPL
(History of Programming Languages) conference.  It's reprinted in
SIGPLAN Notices, Vol 28, No 3, March '93.  He gives a few little
B expression and talks at some length about the things added to
get C.  Taking those things out of C might give you a good start.
He also references a paper by Johnson and Kernighan "The Programming
Language B," Comp. Sci. Tech. Report #8, AT&T Bell Labs (Jan, 1973).
Of course, you may not still be able to get it.  There's also a
reference to a CACM article.  It's not clear if it's about the B
implementation or if B's implementation was infulenced by it:  J. R. Bell,
"Threaded Code," CACM 16(6) pp370-372.

Brian L. Stuart
Math/CS Dept, Rhodes College, Memphis, TN



Sun, 02 Mar 1997 03:30:18 GMT  
 Specs for 'B' language

Quote:


>>I'm looking for a reference that gives the specifications (grammar and
>>semantics) of the 'B' language (predecessor of 'C'). The language has
>>been discussed on Usenet in general terms, but I'd be interested in the
>>level of detail needed actually to implement it (if you _must_ know,
>>it's a small retrocomputing project, just for hack value).

>The language you seek is BCPL not B.

Actually, the geneology, as I understand it is:

       CPL          (Common Programming Language)
        |
      BCPL          (Better CPL)
        |
        B           (Just plain Better :-])
        |
        C          

From my understanding B is like BCPL except that it`s syntax was
cleaned up (made C-like) and complicated features like VALOF were
removed. A thing to note is that both languages were uni-typed
(i.e. the only type was the integer cell) like FORTH. I don't know
much else about B.

Quote:
> I have seen books on it but their names
>escape me. A search for BCPL at a decent library might help.

I remember seeing the book too. It might actually be a good place
to start. The correspondence between BCPL and C features is fairly
obvious, and a language with the common subset of features would
likely be very similar to B.

Quote:

>regards,
>dave.

>------_-_----------------------------------------------------------------------
>|     o o      |              David Rose,                    |      .--_|\    |
>|      !       |      Fly By Night Programming,              |     /      \   |
>|   '''=```    |              Australia.                     |     \_.--.*/   |
>-------~-----------------------------------------------------------------v-----
>Most people I know think that I am crazy            (.. Billy Thorpe circa 1973)
>Especially the "application programmers" on comp.databases.pick  (me circa 1994)

Take care
   Robert
--
/----------------------------------+------------------------------------------\
| Robert N. Deviasse               |"If we have to re-invent the wheel,       |

+----------------------------------+------------------------------------------/


Tue, 04 Mar 1997 22:33:07 GMT  
 Specs for 'B' language

Quote:

>I'm looking for a reference that gives the specifications (grammar and
>semantics) of the 'B' language (predecessor of 'C'). The language has
>been discussed on Usenet in general terms, but I'd be interested in the
>level of detail needed actually to implement it (if you _must_ know,
>it's a small retrocomputing project, just for hack value).

The language you seek is BCPL not B. I have seen books on it but their names
escape me. A search for BCPL at a decent library might help.

regards,
dave.

------_-_----------------------------------------------------------------------
|     o o      |              David Rose,                    |      .--_|\    |
|      !       |      Fly By Night Programming,              |     /      \   |
|   '''=```    |              Australia.                     |     \_.--.*/   |
-------~-----------------------------------------------------------------v-----
Most people I know think that I am crazy            (.. Billy Thorpe circa 1973)
Especially the "application programmers" on comp.databases.pick  (me circa 1994)



Tue, 04 Mar 1997 19:18:51 GMT  
 Specs for 'B' language
: I'm looking for a reference that gives the specifications (grammar and
: semantics) of the 'B' language (predecessor of 'C'). The language has
: been discussed on Usenet in general terms, but I'd be interested in the
: level of detail needed actually to implement it (if you _must_ know,
: it's a small retrocomputing project, just for hack value).

Capital idea!  I will certainly want this for the Retrocomputing Museum.

I assume you're planning to write a B-to-C translator?
--



Wed, 05 Mar 1997 00:05:40 GMT  
 Specs for 'B' language

Quote:


[of the language B]
>: level of detail needed actually to implement it (if you _must_ know,
>: it's a small retrocomputing project, just for hack value).
>Capital idea!  I will certainly want this for the Retrocomputing Museum.
>I assume you're planning to write a B-to-C translator?

That will be tough; functions are first-class objects in B.  For instance,

        x() {
          return 0;
        }

        y() {
          return 1;
        }

        main() {
          x = y;
          printf( "The answer is %d\n", x() );
          return;
        }

is (as rusty memory permits) a legal B programme; it prints "The
answer is 1".  I remember total amazement when I first saw this.  The
amazement is only compounded by the observation that B is typeless.

regards,
Ross

--


Television is chewing gum for the eyes. -- Frank Lloyd Wright



Wed, 05 Mar 1997 14:31:10 GMT  
 Specs for 'B' language

Quote:


>: I'm looking for a reference that gives the specifications (grammar and
>: semantics) of the 'B' language (predecessor of 'C'). The language has
>: been discussed on Usenet in general terms, but I'd be interested in the
>: level of detail needed actually to implement it (if you _must_ know,
>: it's a small retrocomputing project, just for hack value).

>Capital idea!  I will certainly want this for the Retrocomputing Museum.

The Retrocomputing Museum - is that the FTP site that you mentioned in
your announcement of the new Intercal release? I had a look around
there and downloaded a few intersting things, among them your Pilot
implementation (which insists on dumpin core at me when I try to run
it on BSD-derived systems - I've mailed a bug report to you).

I did notice a lack of emulators, though. Surely at least some emulator
projects must qualify as 'retrocomputing', at least the ones that aim
not just at emulating a certain processor, but to re-create the programming
environment of some old (and preferably weird) system. An excellent example
of this is Lars Gislen's SMIL emulator (available for Macintosh only, from
leif.thep.lu.se as pub/Misc/smil.sit.hqx).

Quote:
>I assume you're planning to write a B-to-C translator?

Yes, that seems the natural thing to do, considering that B and C are som
similar. (They're, fortunately, not sufficiently similar for the translation
to be trivial).


======================================================
To define 32-bit array number 7 as 3-dimensional, the first dimension being
seven, the second being the current value of 16-bit variable number seven,
and the third being the current value of the seventh element of 16-bit array
number seven (which is one-dimensional) mingled with the last three bits of
32-bit variable number seven, one would write (just before they came to take
him away):
        ;7 <- #7 BY .7 BY ",7SUB#7"c /':7~#7'
--- The Intercal Reference Manual



Wed, 05 Mar 1997 20:29:17 GMT  
 Specs for 'B' language
Robert N. Deviasse:
        ...
   From my understanding B is like BCPL except that it`s syntax was
   cleaned up (made C-like) and complicated features like VALOF were
   removed. ...

an authoritative discussion of the progression from BCPL to B to C is
in a paper by Ritchie:

        The Development of the C Language
        Second History of Programming Languages Conference,
        Cambridge, Mass. April 1993.

this paper is also vailable on netlib somewhere, but i cannot
remember its coordinates. [ps: it  mentions a bell labs tech report
[#8/1972] on B, but i doubt anyone would be able to find a copy.]

oz




Wed, 05 Mar 1997 08:59:12 GMT  
 Specs for 'B' language

Quote:


>>I'm looking for a reference that gives the specifications (grammar and
>>semantics) of the 'B' language (predecessor of 'C'). [...]
>The language you seek is BCPL not B. I have seen books on it but their names
>escape me. A search for BCPL at a decent library might help.

As an old B hacker, I read this with some amu{*filter*}t.  B and BCPL *are*
two different languages.  B doesn't have `valof', f'rinstance.

regards,
Ross
--


Television is chewing gum for the eyes. -- Frank Lloyd Wright



Wed, 05 Mar 1997 14:26:36 GMT  
 Specs for 'B' language

Quote:
>       CPL          (Common Programming Language)

And then there's CPL (Conversational Programming Language) from DEC,
for DEC-10 and DEC-20 at least. I have the language manual. :->
(DEC-10-LCPLA-B-D) Seems to be something similar to PL/I ... Argh!
--

/* Carpe noctem! Carpe tenebras! */


Thu, 06 Mar 1997 01:01:34 GMT  
 Specs for 'B' language

Quote:



>>>I'm looking for a reference that gives the specifications (grammar and
>>>semantics) of the 'B' language (predecessor of 'C'). The language has
>>>been discussed on Usenet in general terms, but I'd be interested in the
>>>level of detail needed actually to implement it (if you _must_ know,
>>>it's a small retrocomputing project, just for hack value).

>>The language you seek is BCPL not B.

>Actually, the geneology, as I understand it is:

>       CPL          (Common Programming Language)
>        |
>      BCPL          (Better CPL)
>        |
>        B           (Just plain Better :-])
>        |
>        C          

>From my understanding B is like BCPL except that it`s syntax was
>cleaned up (made C-like) and complicated features like VALOF were

                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Quote:
>removed. A thing to note is that both languages were uni-typed
>(i.e. the only type was the integer cell) like FORTH. I don't know
>much else about B.

Removing valof when C was designed was a really _bad idea_.  I can
show you tons of errors that are caused by C macros which incorrectly
evaluate their arguments twice.  valof would have solved this problem
cleanly and elegantly, by providing C _expressions_ which can allocate
temporary variables and compute things exactly once.

By the way, CPL was the mother of BCPL only in the sense that
necessity is the mother of invention.  After CPL (whose complexity
rivalled PL/I) was designed, no one had the stomach to try to
implement it in assembly language.  Hence BCPL (Basic CPL) was born as
an implementation language.



Thu, 06 Mar 1997 10:39:53 GMT  
 Specs for 'B' language
: The Retrocomputing Museum - is that the FTP site that you mentioned in
: your announcement of the new Intercal release? I had a look around
: there and downloaded a few intersting things, among them your Pilot
: implementation (which insists on dumpin core at me when I try to run
: it on BSD-derived systems - I've mailed a bug report to you).

Try compiling with TERMCAP off.

: I did notice a lack of emulators, though. Surely at least some emulator
: projects must qualify as 'retrocomputing', at least the ones that aim
: not just at emulating a certain processor, but to re-create the programming
: environment of some old (and preferably weird) system. An excellent example
: of this is Lars Gislen's SMIL emulator (available for Macintosh only, from
: leif.thep.lu.se as pub/Misc/smil.sit.hqx).

You're right, such emulators would qualify.  I simply haven't collected any
as yet.
--



Thu, 06 Mar 1997 05:04:54 GMT  
 Specs for 'B' language
   I did notice a lack of emulators, though. Surely at least some emulator
   projects must qualify as 'retrocomputing', at least the ones that aim
   not just at emulating a certain processor, but to re-create the programming
   environment of some old (and preferably weird) system. An excellent example
   of this is Lars Gislen's SMIL emulator (available for Macintosh only, from
   leif.thep.lu.se as pub/Misc/smil.sit.hqx).

Hmm. I don't know any of the internals, and it might have already been
done (but so what?), but how about an interpreter for the old Scott
Adams adventures that ran on the very early home computers, usually
from casette tape?
--

Myrias Computer Technologies Inc.   (403) 463-1337



Sat, 08 Mar 1997 22:47:00 GMT  
 Specs for 'B' language


Quote:
>Ross Alexander writes:
>> >I assume you're planning to write a B-to-C translator?
>> That will be tough; functions are first-class objects in B.  For instance,

>>        x() {
>>          return 0;
>>        }

>>        y() {
>>          return 1;
>>        }

>>        main() {
>>          x = y;
>>          printf( "The answer is %d\n", x() );
>>          return;
>>        }

>> is (as rusty memory permits) a legal B programme; it prints "The
>> answer is 1".

>Somebody please correct me if I'm wrong, but I think that the only
>thing which keeps this from being a valid ANSI C program with the same
>result is that C function names are implicitly declared const.

>True?

Not quite. In C, a function name is a pointer when used as an rvalue.
If I've understood everything correctly, th efollowing code fragments
should be equivalent:

C:

int foo(int i) { return i+1; }

main(void)
{
    int (*bar)(int);
    int i;

    bar = foo;
    i = (*bar)(1);

Quote:
}

B:

foo(i) { return i +1; }

main()
{
    auto bar;
    auto i;

    bar = foo;
    i = bar(1); /* That's the crucial difference! */

Quote:
}




PGP key available via finger (to df.lth.se) or on request.


Mon, 10 Mar 1997 16:32:36 GMT  
 Specs for 'B' language

Quote:
> Actually, the geneology, as I understand it is:

>        CPL          (Common Programming Language)
>         |
>       BCPL          (Better CPL)

Actually that should be "Basic CPL" since it was trimmed down to what
was "needed" and easy to implement.  It did grow again some after this
t{*filter*}.


Tue, 11 Mar 1997 01:13:44 GMT  
 
 [ 19 post ]  Go to page: [1] [2]

 Relevant Pages 

1. FTP'able specs for HP/GL and CalComp 906/907 vector drawing languages

2. expect: bs and del don't work

3. BS on sun-3's, fix for multiplication primitive

4. Chuck's new F21 Detail Specs

5. AMD's Sledgehammer specs are out

6. AMD's Sledgehammer specs are out

7. Wanted: Opcode specs for P5's

8. 'AWK Programming Language'

9. CFP: ECOOP'97 Workshop on Language Support for Design Patterns and Frameworks (LSDF'97)

10. Book announcement - ``Eiffel: The Language''

11. Programming Language 'ONE'

 

 
Powered by phpBB® Forum Software