Not you daddy's BASIC

7 October 2026
All pages

BASIC-like is all well and good, but BASIC as a language has not stood still since the 1990s.

Many people who were coding on PCs in the 1990s will remember Visual BASIC from Microsoft. This was a very different way of programming Windows applications that was much easier than the traditional approach with C and the Windows SDK. Not that there weren't other graphical development environments for this, but it was from Microsoft... and it was genuinely good. So it was very successful.

However, that was before the web really took off. And programming server-side code was done in other languages, largely because they were on Unix and Unix systems did not have a history of BASIC. That's why things like Perl rose up, then newer ones emerged like PHP and Java and Python. Sooner or later someone made a Javascript engine that ran on a server and that was the birth of node.

Modern BASICs also exist, but it seemed to be that they try to pick up where Visual BASIC left off. They are largely for building apps, and often include graphics libraries. And they usually pick up the capitalisation habits of Visual BASIC, too. I've wanted for a long time to use a modern flavour of BASIC to write server side web pages. I used PHP some years ago, which was my introduction to server-side coding. I actually quite liked that it had fairly small boundaries as a language. It was also quirky and had things like dynamic lists and proper structures. Even classes, too. No reason a BASIC-like language couldn't be given those!

So... how to do so? Well, I started writing up how this might look.

Lists are pretty straightforward - the same way JavaScript does them with square brackets. So a list constant looks like: [ "this is a list constant with", 3, "entries" ] and individual entries can be accessed with n[i] for the "i"-th element. What about slicing? Turns out BASIC of old has some precedence. Since we have LEFT$(string, n) (and friends such as RIGHT$() and MID$() but also people who remember Dartmouth BASIC will also know SEG$()) for strings, why not LEFT(list, n) and friends for lists? Adding lists to BASIC was the first one I thought about.

Structured programming is also easy. Many BASICs already developed multi-line IF ... THEN ... ENDIF and there were also some that had WHILE ... WEND or REPEAT ... UNTIL or similar. Adding a FOREACH ... NEXT to make lists directly iterable is also obvious. Details to be explored, but readily doable. For user-defined functions, some BASICs already created functions, whilst others added sub-programs and others added procedures.

That brings up an interesting choice. Functions are designed to return values. Procedures and sub-prograsm do not - they are called for what is now called "side-effects". And that took me to a place I didn't expect to explore. Many modern languages have one mechanism for creating re-usable code blocks, and they're usually called functions. They can return a value or not, and calling them doesn't have to be from in an expression. Instead, all statements are also expressions. Which has the side-effect of making all statements that call a function "for the side-effects" look just like any other type of function call. But BASIC traditionally doesn't do that. It has statements, which never return a value (and don't have a way to store a return value, anyway), and functions, which must be in an expression and always return a value. The difference seems like it could be a bit arbitrary, but then it is pretty BASIC-like.

Do I want to do that? Actually, I do! I did think quite a while about that when I first realised this distinction can exist!

Is this a step backwards? Why would you think that? Maybe it's more reaching back into time for a feature that didn't necessarily need to get thrown away. And as an interesting bonus, when I started building a BNF grammar, I discovered separating statements and functions like this makes the grammar easier to design. Or at least it seems to.

I suspect there will be more design decisions with outcomes like this.