A visual basic server

Tuesday, 23 October 2018

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.

| 2 comments.

 

Comments On This Entry

[gravitar] Dexter Muir

Submitted at 21:52:30 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.

[author] Steve Kemp

Submitted at 05:49:43 on 23 october 2018

Thanks!

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?

 

Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags