Friday, January 14, 2005

Exploratory Programming and BASIC

One idea that hasn't been written much about lately in the computer press is "exploratory programming." This idea was very popular about a decade ago and it refers to powerful programming tools that make it easy and quick to try out different ideas. Smalltalk is one of the best examples of an exploratory programming environment. Smalltalk lets you make objects that "live" in your programming IDE and then you can play with them to see what happens. You don't need to compile a program at all to build software. Why does this matter? Exploratory programming helps make programming easier, more fun, and less intimidating. You can play around with little pieces of the program you're trying to create until you feel that you understand it well enough to put it all together.

Okay, what does Smalltalk have to do with BASIC? I'm glad you asked. :-) BASIC was originally conceived as an exploratory programming tool. BASIC has an interpreter loop, just like Smalltalk. Write a little code, use RUN to execute just a piece of your program if you like. Stop a running program, check the value of variables and change them. Rewrite just a line of code if you like. Restart the program. Execute code without even adding it to your program, straight from the command line. Most BASICs on home computers would let you play with the hardware, from graphics to audio to devices connected to an I/O port, again straight from the command line. You were free to explore.

Sadly BASIC is not like this anymore. Almost all BASIC language software today compiles to a program that cannot stopped, tweaked, modifed and restarted. Even our own Liberty BASIC are like this (except that Liberty BASIC you can evaluate code in the debugger and by using the eval() function).

We are working on a new BASIC to bring exploratory programming back. This will not be an old fashioned line numbered interpreter. This new BASIC will provide a workbench where you can make changes to running programs, and where you can try out small or large BASIC snippets just to see what they do.

More information coming...


Tom Nally said...


To Alyce and Brad and Janet and John and Bill and David and Jerry and Scott: nanny-nanny-nanneeeeeee!


Carl Gundel said...

Hi Tom!

What did you think of my post about exploratory programming?

Tom Nally said...

Almost all BASIC language software today compiles to a program that cannot stopped, tweaked, modifed and restarted. Even our own Liberty BASIC are like this I'm puzzled by this claim. Without exception, my own Liberty BASIC programs always enter what I call a "wait state". At this point, I can either initiate a new "event" to which the program will respond, or quit the program if I don't like the results. At that point, I can modify the source, re-compile, and try again. To me, that's the same as stopping it, tweaking it, modifying it, and restarting it.

True, I guess we can't really stop a program in mid-execution, change a few values, and then re-start it at the exact same point where execution was halted...but is there a demand for this behavior? I don't see the absence of this feature as a huge, gaping hole in the development process using LB. (Perhaps I'm incapable of thinking "outside the box" on this issue.)

Let's speculate about an existing LB program. In my opinion, "Humble Universe" was the most interesting thing that I've written. Would it have been different or better had it been written in an environment with the features that you've identified? It's not clear to me that it would be different or better.

Having said that, in no way am I discouraging you from producing this new development system based on a unique--or at least under-appreciated--paradigm. Clearly, I don't have your vision or your talents. If I did, I might be the one creating languages, rather than weaving steel.


Carl Gundel said...

Thanks Tom. :-) Exploratory programming is not a panacea, but it is good for a few things:

-Learning to program
-Building very complex software systems a piece at a time
-Debugging when a bug only shows up after several minutes of use
-Modifying a running system without restarting it

I'm not planning to build an old style BASIC interpreter. What I'm working on is going to be very modern, and very easy to use.

kaboomer13 said...

I really like this idea. I think that it will be great!

I am wondering though, would this be Liberty BASIC 5.0? or another 'thread' of LB?

Rogue said...

well well, it sounds like a fellow basic addict has finally told the snobby public that programming is a primary part of computers and should be a basic (no pun intended) skill in order to use one. but tell me this, where would microsoft, norton and all those other cohorts be if everyone new just a lil programming? not as rich as they are. but thats my own dark and evil opion, but exploratory programming? now that is a very great concept. i played on a TI-90z and a Apple IIe. both had very similar BASIC flavors, never trully realized the joy i had that i could just press the puase break button (or the equivilent there of) tweaking a line, then pressing run again and it would continue on. "on-the-fly-debugging" it could be called. but thats a great concept, i look forward to getting that flavor of basic. BTW, i'm poor, so i can't really enjoy liberty basic as much as i want to, but Just basic fits me quite nicely, thank you from the bottom of my heart bud.