"Bournegol?" - an Algol-like dialect of C from 1979

Bournegol the ALGOL-like dialect of C that Steve Bourne used to write the original Bourne shell”
(from Marc Lehmann’s “Bournegol Page”)

I immediately asked myself: what could Bournegol look like? Well, it’s not that easy to find the original Bourne Shell sourcecode, so, after some googling, I thought I might put an example of Bournegol on my homepage, so other people have the chance to find about “Bournegol” without the tedious search.

(many years later I found this paper, A Partial Tour Through the UNIX Shell, which makes for very nice reading).

See also
An extreme example of C preprocessor (ab)use

via mastodon:
“I recently learned the Bourne shell scripting syntax is based off Algol 60.”


Allocation in the original Bourne shell is very interesting, as well. It uses a string table where it just creates a new object in the end if it needs one, without calling any allocation routines. If it’s out of space, the kernel will send SIGSEGV and it will call sbrk() to get more space. This turned out to be a pain later when other systems had to be able to recover from a segmentation violation and continue after the signal handler as if nothing went wrong.

Edit: I see this is mentioned in the penultimate link.

Double edit: curse mobile, now that I’m on a real computer and can read the PostScript paper, this is a large part of its discussion. Ahh, well, I shall leave my comment for posterity and those who may not chase links. :wink:

1 Like