
“Hello world” in the BCPL language on the Xerox Alto simulator - tonyg
http://www.righto.com/2016/06/hello-world-in-bcpl-language-on-xerox.html
======
careersuicide
If you're interested in trying out BCPL on your own machine the inventor of
the language, Martin Richards, maintains a working environment/compiler[0].
I've gotten it up and running on both Ubuntu and OS X. The readme is
structured in a way that makes it kinda hard to follow so I wrote down some
instructions[1] for my future self after I figured it out.

C was my first programming language and several years ago I became acquainted
with ALGOL 68. I'd never seen BCPL before a few months ago. It's rather
interesting how, from the perspective of someone born well after its creation,
it is very clearly the link between the ALGOL family and C. I'm sure that's
rather obvious to programmers who were around in the mid to late 60's but for
me personally it was a lot like discovering a missing link.

[0]:
[http://www.cl.cam.ac.uk/~mr10/BCPL.html](http://www.cl.cam.ac.uk/~mr10/BCPL.html)

[1]:
[https://gist.github.com/seaneshbaugh/e09abd748ccc07c5463f253...](https://gist.github.com/seaneshbaugh/e09abd748ccc07c5463f253df97e4de8)

------
akkartik
_The image below shows the Hello World program with multiple fonts and
centering applied. Since the compiler ignores any formatting, the program runs
as before. "_

Mind. Blown.

~~~
Animats
It was customary to boldface the keywords in Mesa programs. The Mesa manual
used that style, and I did that when I was using an Alto.

This raises the question "Why are we still programming in monospace fonts?" If
you need a table or an image in a program, why can't it be in the code?

~~~
kens
Good question! I'd also add the questions Why are we still programming with
the semantics of 80-column punched cards? Why are programs even structured as
sequential lines?

The lines within a method need to be ordered, but beyond that, code should
just float to where it's convenient and be hypertext-y. And worrying about
whitespace and fitting code on a fixed-length line is pointless.

I don't have the answers to how programs should be written, but the current
system just seems wrong, locked into decisions made decades ago. It seems like
programming is stuck at a local maximum.

~~~
userbinator
There's been articles posted to HN that have attempted to explain why textual
source code has become the norm, but from what I remember it comes down to
simplicity (and with it, efficiency of storage and processing) and
portability. It's the same reason why files as plain sequences of arbitrary
bytes won over structured/more "rich" formats, and the "everything is a
file/stream of bytes" model of Unix dominated; all the complexity involved in
handling things like embedded formatting instructions, resource forks and
other nuances is a _huge_ obstacle to widespread implementation and
interoperability. The phrase I remember reading in reference to this is "text
is universal", and I agree completely.

One would naturally wonder how Alto/Mesa managed to have all these features,
and the answer is simple: it is effectively a closed proprietary ecosystem,
developed by one company with plenty of engineering effort, and with little
consideration for interchange with other systems. It also had far more
processing power than personal computers of the time.

 _I don 't have the answers to how programs should be written, but the current
system just seems wrong, locked into decisions made decades ago. It seems like
programming is stuck at a local maximum._

Never underestimate the importance of simplicity and a low "barrier to entry"
\--- in fact, I'd consider the lack of success of much larger, "fancier", more
complex systems like the Alto as a strong evidence that, regardless of how
fancy, featureful, and radical your system is, unless it has a low barrier to
entry and interoperates with existing ones, it will not endure the test of
time.

~~~
Animats
I suspect that part of the reason is that Microsoft Word's internal
representation is such a mess. Making a compiler read .doc files would be a
major effort. So writing code in Word never caught on.

------
Animats
Isn't the Mesa compiler for the Alto available? If you have that, there's no
need to write in in the British Cruddy Programming Language. BCPL was written
as a tool for bootstrapping compilers. It's one notch above a structured
assembler. The only type that BCPL supports is the 16-bit word.

Mesa, on the other hand, is a good language.

~~~
kens
Mesa and Smalltalk for the Alto are around [1], so I hope to get them running
at some point. The files need to be copied into a disk image that the
simulator can read, so I may need to write an Alto file system emulator.

Lisp for the Alto, on the other hand, seems to be entirely gone - I asked
around and nobody seems to have a copy. From what I hear, it never worked very
well because there wasn't enough memory.

[1]
[http://xeroxalto.computerhistory.org/Indigo/XMesa/.index.htm...](http://xeroxalto.computerhistory.org/Indigo/XMesa/.index.html)
and
[http://xeroxalto.computerhistory.org/Filene/Smalltalk-76/.in...](http://xeroxalto.computerhistory.org/Filene/Smalltalk-76/.index.html)

~~~
Samis2001
Is there any particular reason why you linked to Smalltalk-76 vs say, -78 or
-80

~~~
kens
I linked to Smalltalk-76 because that's the version I found in the Alto
filesystem archive.

~~~
Samis2001
This directory seemingly contains both a copy of the Alto OS and a
Smalltalk-80 image/changes file. Not sure which file is the VM executable
though.
[http://xeroxalto.computerhistory.org/Indigo/BasicDisks/Small...](http://xeroxalto.computerhistory.org/Indigo/BasicDisks/Smalltalk14.bfs!1_/.index.html)

------
Zardoz84
If anyone like to see a clone of B, check this :
[https://github.com/Blecki/DCPUB](https://github.com/Blecki/DCPUB)

------
delbel
Is it me, or does BCPL look like Angular 2.0/typescript? (/runs)

