Sunday, April 04, 2021

S-BASIC

On the Kaypro, there was something called S-BASIC.  S-BASIC was an early attempt at creating a "structured BASIC" language.  Think of what C++ was to C.  S-BASIC is to BASIC.

But while C++ would compile C programs, S-BASIC would not compile Microsoft BASIC programs.

To convert an MBASIC program to S-BASIC, you need to:

  • Declare all variables before their use.  That means you need to go through your BASIC program, find all variables and declare their type.
  • Remove all multi-line statements.  S-BASIC doesn't support ":" between statements.  At best, it simply ignores all the code after the ":".  At worst, compiler errors.
  • You cannot GOTO out of a FOR loop, even if you GOTO back in.

Other downsides:

  • Compile time is slow.  So the amount of time between changing something and seeing if it works is a while.
  • No IDE.  You need a text editor to write your code.
  • It cannot READ data files written by MBASIC.
  • You can still write spaghetti code, but you have the option to not do so.

So to take your MBASIC program to S-BASIC will require a great deal of rewriting.  Even for the really simple programs that I did, it was not quick.

S-BASIC came out about the same time that Turbo Pascal was popular on CP/M.  Turbo Pascal had the IDE and is a much richer language.  So it's easy to see why S-BASIC didn't really rise in popularity.

No comments: