Gopher in BBC BASIC

As an exercise in retro/minimal computing, I coded up support for Gopher moles (like CGI for HTTP) in BBC BASIC. I run this on SDF-EU. If your browser can handle the gopher: scheme, e.g. with the Overbite add-on, then you can see the results yourself at my gopherhole.

The first step is to get a BBC BASIC interpreter. I use Brandy BASIC. If you have an account on SDF-EU, you can run it from /arpa/d/dbane/bin/brandy. Otherwise you can install it easily yourself with git clone and make nodebug GUI=console.

Second, you need to set up your gopherspace. On SDF-EU, this is all documented in the "GOPHER" faq entry (enter faq at the CLI). Most of the work is done by a program called mkgopher. Once this is done you should add a line like the following to your gophermap file:

7A first mole   hello.cgi

hello.cgi, and all other moles, are symlinks to a short shell script that you should install under trampoline.cgi in your gopher directory. This assumes that you have a bas directory under your home directory that contains BASIC source code (you’ll need to change this absolute path in the script).

Finally, we can write BASIC. You might as well just copy this to bas/gopherlib.bas. Then you can write moles following the template of this.

I doubt anyone will become a .com millionaire from this, but I find it interesting how few features you need for a useful programming tool. I can imagine writing medium-sized systems in BBC BASIC, although it doesn’t have lots of currently-fashionable features. I hope at least you have fun.