[TUHS] Software written in B

Angelo Papenhoff aap at papnet.eu
Thu Jun 8 01:05:27 AEST 2023


Sebastien,
I'm not aware of any old UNIX B code beyond the examples from the
documentation and one or two short programs for the PDP-7 (this is older
B).

As Lars already mentioned, some people have written their own B
compilers, even in B.
My compiler (https://github.com/aap/b) generates the same threaded
code that ran on the PDP-11 and I implemented it on a few platforms,
(pdp-11, amd64, mips32, riscv64), notably it runs on UNIX v6. 
Robert Swierczek has written a B compiler that is compatible with the
PDP-7 runtime:
https://github.com/DoctorWkt/pdp7-unix/blob/master/src/other/b.b

With B you pretty much have to write your own code unfortunately. Would
be great if some bigger programs (like the compiler and yacc) were found.

best,
Angelo

On 07/06/23, Sebastien F4GRX wrote:
> Hello everyone,
> 
> this is my first post on this list.
> 
> 
> After looking at the archives for this mailing list, I have seen that 
> the B language has been discussed several times already.
> 
> After viewing Ken Thompson's interview by Brian Kernighan at VCF East 
> 2019, I became interested in the B language, as it seemed full-featured 
> for system programming, close to C, and simple enough to write a parser 
> for it without a code generation tool.
> 
> So for fun and self-education, I am now writing a (or yet another) B 
> compiler, in C, after reading Jack Crenshaw's "Let's build a compiler" 
> documentation ( https://compilers.iecc.com/crenshaw/ )
> 
> Here it is: https://git.sr.ht/~f4grx/bpars
> 
> It is now starting to generate code for the 68hc11 8-bit platform. It 
> can also generate C code.
> 
> 
> I have written some test programs, found some B examples, but I thought 
> it would be great to use my compiler with actual B software.
> 
> Of course, B was a "transition" language, that did not have a continued 
> use as soon as it evolved into C. so if any software remains, it will be 
> quite hard to find.
> 
> And here is my question, is any of you aware of original B source code 
> archives? or are in touch with people that would know?
> 
> 
> In particular, I read on this document written by Dennis Ritchie: 
> https://www.bell-labs.com/usr/dmr/www/chist.html
> 
>  > After the TMG version of B was working, Thompson rewrote B in itself 
> (a bootstrapping step).
> 
> 
> I have also read that the YACC tool was initially written in B.
> 
> There might be other historical B sources that I am not aware of.
> 
> 
> Do you know if any of this code has survived to this day? Where could I 
> find more information about this?
> 
> 
> Thank you very much,
> 
> Sebastien Lorquet (F4GRX)
> 


More information about the TUHS mailing list