BCPL in the new millenium (was: Proposal3: Make $_ a valididentifier cha...

Dan Ingalls Dan.Ingalls at disney.com
Fri Jun 2 04:29:28 UTC 2000

>lewis at mail.msen.com wrote...
><< Here you will find an up to date BCPL manual, portable implementions of 
>BCPL and MCPL, a Tripos command shell, and other fun stuff. >>

JArchibald at aol.com replied...
>Far out! Now BCPL is a language (other than Smalltalk) that you can get 
>excited about. Its successors (C and C++) can't hold a candle to the original 


You might be interested to know that the very first occurrence of a Smalltalk-to-C (-like language) was a translator from Smalltalk to BCPL that Ted Kaehler, Glenn Krasner and I did way back when we were at Xerox.

We had designed this (pretty cool) virtual memory named LOOM (see the Green Book) that used 16-bit internal pointers, but 32-bit external pointers.  This meant that if we could get it to work, we could just bolt it onto the existing (then fastest in the world) Dorado Smalltalk.  Ted wrote the whole thing in Smalltalk, and arranged to run two images back-to-back, one with the LOOM VM code in it, the other with then normal Smalltalk image.  When there was a fault in the normal image, it entered a primitive that emerged on the other side to handle the fault.

When this all finally worked (it did!), we wanted to speed it up, and make it smaller by rewriting it in BCPL (BCPL was supported on all the Xerox hardware at the time).  Ted had written a lot of it in the style of SLANG -- ie, Smalltalk as machine code --  so instead of starting over, we just changed the prettyPrinter to emit valid BCPL code for about 80% of what was there.  We did that in a day, and then Ted and Glenn finished the translation by hand.

	- Dan

More information about the Squeak-dev mailing list