PC-BASIC, Python, and Code Rot
PC-BASIC is a "free, cross-platform emulator for the GW-BASIC family of interpreters". The more I use it the more impressed I am. Loading and running old GW-BASIC programs is one thing, but to do that it also contains its own partial emulator for 1980's PCs. By default it opens up a window to run in graphics mode, but command-line switches can be used to instead use a a terminal for input and output. It is implemented in Python, and running it is only a pip install away. And it has a Python API for interacting with GW-BASIC programs. You can load and run an old BASIC program from within a Python script, while peeking and poking at its variables.
It worries me slightly though that there has been no new release since 2022. That should not be a worry of course. If we didn't do sofware in such a shitty and short-sighted way that should be no worry at all. If it works it should keep working. There is no reason for it to suddenly break. But unfortunately that is not what reality is like. Python in particular breaks backwards compatibility ALL THE TIME. Literally every new minor version contains non-backwards compatible changes. And that is just in the core language and standard libraries. Most code has other dependencies too and will end up in a never-ending battle to keep its set of dependency versions in some state that will hopefully run with one specific minor-version of Python.
So that leads to code rot. Someone did not update their code for a few years, it no longer works, so now people say that it has rotted (is that a word?). As if it was the maintainer of that code that did something wrong! But of course it is obvious that it was someone else's fault. Someone else thought that their own time was so much more valuable than other people's time that they decided to ignore backwards compatibility.
Will PC-BASIC rot soon? I do not know. I hope not. But for how long can it be maintained? What I was trying to get to in this probably already too wordy post is that a project like this requires a combination of some very specific knowledge. How many has the knowledge, interest, and time, to maintain a project like this? There is a lot of low-level, undocumented, magic going into being bug-compatible with GW-BASIC and on top of that support a fair amount of old PC hardware emulation, while keeping up with Python changing every few months.
How many other projects are like that? It seems increasingly foolish and evil to keep killing other people's software. Even breaking backwards-compatibility in seemingly insignificant ways will add up, slowly causing code to rot.
This is just in addition to all the other bad things about lack of backwards compatibility. If you can't make a change without breaking someone else's code, don't change it. Should be that simple and no excuses. Otherwise the only software we will get is what is maintained by the big corporations that have the resources to maintain software in a sadly unstable environment.
At least as long as someone is around to maintain some emulators to run old DOS code, that will remain a safe way to run software without rot. Microsoft's original GW-BASIC itself for instance is reasonably safe, as long as someone manages to keep applications like DOSBox-X around. I know I say this a lot, but DOS is a perfect virtual machine. It has an extremely stable API and if you can get something to run in DOSBox today you can be fairly confident that you can keep using that something without ever having to worry about a future upgrade suddenly breaking backwards compatibility. Sadly, dead platforms are the only stable platforms we seem to have today.
tags: #basic #dos #programming