Comment by lexurco

Comment by lexurco 11 hours ago

2 replies

I remember at one point I browsed tuhs.org in an attempt to find the source code for the original B (the language predating C) compiler. I don't think it should be in the 4th edition. I still wonder if there's a copy somewhere. I know there are a few modern implementations, but it would be interesting to look at the original.

ForOldHack 10 hours ago

The 'B' compiler was written in TMG-Compiler-Compiler. TMG (Transmogrifier)

https://github.com/amakukha/tmg

https://news.ycombinator.com/item?id=26722097

""Douglas McIlroy ported TMG to an early version of Unix. According to Ken Thompson, McIlroy wrote TMG in TMG on a piece of paper and "decided to give his piece of paper his piece of paper," hand-compiling assembly language that he entered and assembled on Thompson's Unix system running on PDP-7."

We are not worthy, friends. We are not worthy."

Tons of info, but not much source:

"The first B compiler was written by Ken Thompson in the TMG language around 1969. Thompson initially used the TMG compiler to create a version of B for the PDP-7 minicomputer, which generated threaded code. The B compiler was later rewritten in BCPL and cross-compiled on a GE 635 mainframe to produce object code, which was then re-written in B itself to create a self-hosting compiler. "

So... a B compiler would use GE 635/Multics as a OS.