About Archive Tags RSS Feed


A visual basic server

23 October 2018 12:01

So my previous post described a BASIC interpreter I'd written.

Before the previous release I decided to ensure that it was easy to embed, and that it was possible to extend the BASIC environment such that it could call functions implemented in golang.

One of the first things that came to mind was to allow a BASIC script to plot pixels in a PNG. So I made that possible by adding "PLOT x,y" and "SAVE" primitives.

Taking that step further I then wrote a HTTP-server which would allow you to enter a BASIC program and view the image it created. It's a little cute at least.

Install it from source, or fetch a binary if you prefer, via:

$ go get -u github.com/skx/gobasic/goserver

Then launch it and point your browser at http://localhost:8080, and you'll be presented with something like this:

Fun times.



Comments on this entry

icon Dexter Muir at 21:52 on 22 October 2018

Magnificent effort, Steve! I'm an 'old fart' brought up on basic in various 'flavours'. Having owned Sinclair QLs, I'd love to encounter a moderrn-machine interpreter for its SuperBasic - particularly to run Stellaris (QL World June 1987), a strategy game.

icon Steve Kemp at 05:49 on 23 October 2018


The HTTP-based approach was a compromise between wanting to allow graphics, but not wanting to code a graphic application with SDL/similar and allow entering programs with it. I can imagine the pain of dealing with an event-loop and keyboard input/output is probably significant.

The QL I never used personally, nor did I ever meet anybody who owned one. (Though I recall a couple of local friends had the Sam Coupe ..) So I've never looked, but it might be that you could find an emulator for the whole system - of not just an interpreter?