top | item 11987324

“Hello world” in the BCPL language on the Xerox Alto simulator

91 points| tonyg | 9 years ago |righto.com | reply

59 comments

order
[+] careersuicide|9 years ago|reply
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

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

[+] akkartik|9 years ago|reply
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|9 years ago|reply
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|9 years ago|reply
It seems backwards that on the Alto you could style your code with a WYSIWYG editor but 40 years later putting a <b> tag in your Javadoc is about all you can do to code.
[+] amyjess|9 years ago|reply
This reminds me of some of the tricks Apple used to pull with the resource and data forks on the classic Mac OS.

Like, a file could have plain text in the data fork and formatting instructions in the resource fork, so an application that can only handle plain text can just read the data fork, and something that knows how to deal with rich text can read the resource fork and apply the formatting.

While the old Mac OS had its problems, it was full of brilliant strokes of design genius like this, and I'm still kinda saddened that these little tricks are almost entirely gone.

[+] nv-vn|9 years ago|reply
Not even joking, take a look at TempleOS and HolyC... Terry Davis has made some wonderful features that allow for formatting code files and embedding a variety of rich content (like images or videos).
[+] mpweiher|9 years ago|reply
There was a version of NeXT's gcc that handled RTF source code.
[+] ams6110|9 years ago|reply
I seem to recall reading that the Bravo editor stored the text and the formatting separately. So having the compiler read the text and ignore the formatting maybe not so mind-blowing after all.
[+] alayne|9 years ago|reply
Maybe you're being sarcastic, but I think it's just a hack with the formatting appearing after the end of file marker that the compiler uses.
[+] Animats|9 years ago|reply
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|9 years ago|reply
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... and http://xeroxalto.computerhistory.org/Filene/Smalltalk-76/.in...

[+] delbel|9 years ago|reply
Is it me, or does BCPL look like Angular 2.0/typescript? (/runs)