BlathrWayne Lorentz

Showing blathrs with the tag “Programming.”

A BASIC IDE

Friday, June 4th, 2021 Alive 18,301 days

An Atari BASIC Programming cartridge

I got a new Atari cart yesterday. Itʼs BASIC Programming.

While the word “BASIC” in the title is properly capitalized because it is an initialism for Beginners All-purpose Symbolic Instruction Code, the title would also work in sentence case as “Basic Programming,” because this is truly basic programming.

Lots of modern-day reviewers on the internet who are more interested in outrage clicks than thoughtful conversation deride this program as a farce or even a toy. I have the unpopular view that BASIC Programming is really quite good, both as a technical achievement and as a cultural change agent. It achieves a number of important goals:

  • Provided ordinary people with an introduction to programming
  • Provides a subset of the BASIC programming language
  • Has the ability to play musical notes
  • Has the ability to display rudimentary graphics

This is all elementary school stuff today. But when this cartridge came out in 1979, it was absolutely revolutionary. For $50, an Atari owner could get a taste of what it was like to actually program a computer. And while computers were starting to occasionally appear in well-to-do homes, they were still staggeringly uncommon, and cost about the same as a new car.

Joysticks and buttons in arcades gave wider society its first opportunity to command an electronic machine to do things. BASIC Programming gave Atari owners the ability to give an electronic machine sequences of commands, and to act on them. Moving a dot around a screen with a joystick had been done long ago through various electromechanical methods. But this was the first chance for ordinary people to actually command a machine to do more than just react to stimulus.

BASIC Programming in all its elementary beauty

BASIC Programming has a limited feature set, but itʼs still an integrated development environment, not fundamentally different from what computer programmers use today. One significant difference is that BASIC Programming managed to present a fully functional I.D.E. in a minuscule 2K of memory. Thatʼs about one sixth of the words in this article.

By comparison, the current version of Microsoftʼs I.D.E. starts at 274,000 times the size of BASIC Programming, and increases rapidly from there, depending on what language you write in.

Atariʼs BASIC Programming crosses the same ocean as Microsoftʼs VS Code, but does it with a styrofoam pool noodle instead of the Queen Mary.

In addition, BASIC Programming is user-friendly in one specific way that few computers are today. Like me, it had Sister Maria for third grade Arithmetic class, where she preached, “Anything divided by zero is zero.” Try to divide something by zero in Atariʼs basic BASIC, and it politely gives you zero. Unlike modern computer systems that fall on the floor, curl up in a ball, and start quietly sobbing to themselves when asked the same question.

The one popular modern-day gripe I agree with is that the input method is cumbersome. Itʼs a pair of keypads, one plugged into each joystick port, and then locked together. I understand why it was done this way, but that doesnʼt make it easy to use.

Still, the single keypad pair is pulling more than its weight, even for the era. It is used for:

  • The entire common English-language alphabet:
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  • The numbers:
    1 2 3 4 5 6 7 8 9 0
  • A space character
  • Punctuation ., ,, ʼ, and
  • A set of basic BASIC keywords
    • Clear
    • Else
    • Goto
    • Hit
    • Hor1
    • Hor2
    • If
    • Key
    • Mod
    • Note
    • Print
    • Then
    • Ver1
    • Ver2
  • Mathematical and assignment operators +, -, ×, ÷, , <, (, >, ), and =
  • Cursor controls Backward and Forward
  • A Newline character
  • IDE controls for:
    • Erase
    • Graphics
    • Halt
    • Output
    • Program
    • Run
    • Stack
    • Status
    • Step
    • Variables

Just looking at the command set, thereʼs a lot of interesting points.

  • It has an else command. There are modern-day computer languages that donʼt even have this feature.
  • It has a goto command. Only recently has goto come in from the cold, and is slowly being embraced by a new generation of programmers decades after being banished to the Gulag of Oldthink.
  • Its keyboard has Control, Meta, Super, and Hyper modifiers, just like keyboards of today. On a modern-day keyboard you may know these as Control, Command, Option, and Hyper. On the Atari keypad, theyʼre color coded White, Red, Blue, and Green.
  • It has a function to slow down the execution of programs so that the programmer can understand whatʼs happening.

    Imagine being someone in 1979, who has lived his entire life with paper and pencils — someone who has never seen a computer in person before — coming to the realization that the simple little program he punched in on his Atari is running so fast that he canʼt keep up with it. This was an epiphanal moment. An awakening. A sense that the cyber-commander art work on the box wasnʼt just fantasy, but an expression of the type of power being brought to ordinary people in their dens.

In addition, when you run a program, the systemʼs cursor moves through the program during execution, allowing you to follow along with whatʼs happening. This kind of functionality is an add-on in modern systems.

On a personal note, I love the idea that it has a Halt command. It brings a lot of nostalgic feelings to my tummy. Back when computers were commanded to run and then halt because of their military origins. A time when you couldnʼt start a computer without a key. When computers had mechanical odometers behind a panel so that the IBM service guy from New Paltz could write down for how many hours you used the machine, to let Big Blueʼs billing department know.

BASIC Programming in all its constrained ugliness

Yesterday was a quiet Saturday, so I sat down with BASIC Programming and approached it with my programmerʼs analytical mind, and without the biases of modern-day development. My conclusion is that this is really quite fun.

I started by typing in all six of the programs I could find on the internet. Unlike the days of typing in program from the backs of magazines, these all worked the first time, with moving dots and pinging sounds. Then I started to experiment on my own.

The dialect of BASIC that this cartridge uses is very much of its era. Variable assignment is done with , instead of =, just like in 1960ʼs and 1970ʼs computing languages like AP/L. Goto is your friend, not your enemy. And the notion of whitespace for readability goes right out the window. This will be a show-stopper for anyone used to cruising Appleʼs internal codebase.

Iʼm not musical in any way, so naturally I enjoyed stringing along rudimentary bloops and bleeps into nonsensical songs. For an afternoon, I was the e e cummings of synthpop, but I was also doing something: I was creating. This was an a-ha moment, and I felt a rainbow connection to dads of the 1970ʼs, sitting cross-legged in wood-paneled living rooms, scales drifting lazily from their eyes as the future was revealed.

If you appreciate programming elegance, the value of simplicity, or simply dig code golf, this is your course. You are forced to think about what youʼre doing. To make choices, evaluate tradeoffs, and make do with what you have. Itʼs a lot of the brain stimulus that gets some people into programming as a profession in the first place

There are a number of people who enjoy making tiny programs. Some so small that they fit into a PC-DOS boot sector. I think a few of those people might thrive within the constraints of this environment.

The biggest limitation of BASIC Programming is memory. You can only cram a few dozen symbols into the machine. Thatʼs to be expected, since the entire console only has 128 bytes of memory. Thatʼs the reality of 1979. But today, people are able to program Atari cartridges that work with comparatively massive amounts of information. One guy even sells Atari carts that are full-motion videos of popular movies. I suspect one of those clever people could find a way to make a version of this that works around the memory limitation.

The second-biggest problem is the Frankensteinian keyboard. As an input device, it was never intended for long-form content. But the cognitive overhead of shifting modes, double-checking the screen, and the constant hunt-and-peck involved make it hard to concentrate on the program, and not on the controller. Perhaps thatʼs another throwback to 1970ʼs computing, though.

Iʼm old enough to be one of those programmers who wrote their programs out on paper first (graph paper, if you were lucky), then typed it into a shared computer, and hoped that it did what was intended. Maybe if I spent more time thinking about the code beforehand, rather than writing it on-the-fly as is common today, coding in BASIC Programming wouldnʼt be so arduous.

BASIC Programming in all its abject simplicity

Still, I think that with a bit of time, it would be possible to come up with a harness that links a standard Human Interface Design keyboard with the pair of Atari joystick ports to emulate the keypad. In my mind, it would take some kind of Arduino or Raspberry Pi device with a dozen I/O pins. Voltage might be an issue, but nothing insurmountable to todayʼs hobbiest.

In fact, using this method, one could actually load BASIC Programming programs stored in a host system through the Arduino-powered keypad interface. You could write a program in Microsoft VS Code, or Panicʼs Nova, and when you push to git, or the version management system of your choice, it could also be sent wirelessly to the Arduino, which then relays the keypresses into the Atari 2600.

Now I know what Iʼm going to do when I retire.

❖ ❖ ❖

Negative experience

Thursday, April 22nd, 2021 Alive 18,258 days

Iʼm getting tired of all the lazy developers talking about how great Electron is.

I guess they donʼt have to use Microsoftʼs Azure Storage Explorer, which crashes on a weekly basis, taking down the entire machine and all of their work because itʼs built in Electron, and is not a real program.

❖ ❖ ❖