BASIC turns 60
arstechnica.com
arstechnica.com
A big chunk of my job was doing tedious manual edits in the guest management software that tracked who was in what room, what phone and pay-per-view charges they'd racked up, etc. It occurred to me to peek at its database file and see if I could pull any useful data out with automation. The DB turned out to be a flat file of fixed-length records. The DOS PC had a copy of QBasic on it and I used a bunch of trial and error to map those records to types, and then I could loop across the records to get interesting data out of them.
Long story short, I ended up with a system we'd run nightly to correct misspellings, build reports of which companies did the most business with us and how recently, identify regular guests who hadn't been around in a while, and a thousand other little things that made my job much more pleasant and my boss extremely happy.
It would be much easier to recreate that program today in a nicer language. I didn't have a nicer language available, though, and while it wasn't pretty, QBasic got the job done.
"Aside from these limitations, however, awk should be useful in any environment; in particular, it runs on MS-DOS. Further information is available from Addison-Wesley."
It likely was not easy to find, and I hadn't heard of it until 1990.
Many alternatives existed, but non that were so approachable on DOS (and many other systems in their variant)
I have a computer with only 3kb of RAM but has a comparatively large amount of ROM to support a complete BASIC. With BASIC you can create useful programs that would otherwise be impossible to fit into RAM. This has given me a newfound respect for the language.
Common in magazines, you'd have pages with listings that users could type in, save, and then run (in that order!).
Well... usually including some corrections. The usual typo's, but even listings as published contained errors sometimes.
BASIC was very suited for this as many keywords are plain English or -like.
It's only later this got replaced by cover tapes etc.
And in the NL, there was a thing called BASICODE:
https://en.wikipedia.org/wiki/BASICODE
Which was an attempt to make a standard dialect that different computers could interpret, and/or convert into their own machine's BASIC.
A late-night radio program (NOS Hobbyscoop) would often end its transmission with some minutes of tape-loading sounds. Users would record this on tape, run it through some conversion program, and RUN. So the same program as transmitted over the air, could then be run by C64, ZX Spectrum, MSX, Amstrad CPC users etc.
Iirc it wasn't that popular compared to other ways of obtaining software. But computer users @ the time were eager to do & try anything they could get their hands on. Today's internet info-overload didn't exist then.
And of course radio had a wide audience. Interesting programs could thus be distributed among many users quickly.
Visual coding is my nemesis. I just disagree with it in principle. It makes even the simplest things complicated and virtually impossible to debug.
BASIC was the first computer language I learned. It’s so basic I just taught it to myself from the help section when I was 12, without any exceptional ability on my part.
At bedtime we're a "you don't have to sleep, but you have to be quiet" household so if he had it in his room it might see some use.
You need some visual thing for the appeal.
Instead aiming for that Frankenstein moment of excitement ‘holy shit this thing is kinda alive!’ Is where you want to get to.
I introduced a friend’s kid to basic the other day. She’s about 9 and was already getting the idea of an input, making some decisions and writing an output. Even with that just being text she was excited, and was already having her own ideas what to do next.
I ended up working in computer graphics :-)
I agree with your sentiment re: scratch though. With scratch I struggle to pull kids away from the drawing and asset selection tools. I’d like scratch without this.
Because there is no such thing as a syntax error in scratch. 10 year olds are not great at typing, spelling, or paying attention to the small details.
Scratch rules out a whole class of bugs and allows the kids to jump right into solving the interesting problems.
As a clueless, overly ambitious 12 year old I was a massive annoyance for the skilled users on their forums, I remember getting ranted at for wasting people's time with stupid questions, writing awful code, not understanding licenses etc, but it was a pretty good entry point until I managed to get my hands on books for more modern languages.
I even used BASIC professionally for a while in the 1990s.
I cut my teeth on Wang 2200 BASIC, which was an extended Dartmouth BASIC, so it had the above MAT statements, but also a bunch of wild ones that did searching and sorting on arrays, merging two sorted arrays into a sorted output, and more.
Here is a statement that searches a character array A$() in columns 1-5 for a string in Z$: MAT SEARCH A$()<1,5>,=STR(Z$,1,5) TO B$ STEP 5. Every match writes the location to a descriptor array (this case B$), where each pair of bytes was the offset in the A$ array where the match was found.
Despite all that power, it still was quite limited: all variable names had to be a single letter or a letter and a digit. All variables were global. GOTO and GOSUB were either the line number or a "label" where the label was one of '0 to '255. Strings were statically allocated, not dynamic, and the max length was 64 characters (BASIC-2 extended that to 126 bytes). On the other hand, before the program started running everything was allocated there was no possibility of memory overflow during runtime, and no garbage collection, and any references to missing line numbers was caught up front.
I remember reading every topic in the help browser over and over looking for how to write to the screen, because I didn't want my first program to waste paper with the PRINT statement.
One section of the manual told me to use labels instead of old fashioned line numbers, but I could never figure out the syntax to GOTO them. So I kept a nice index card with line number ranges for all the functions in my program. It worked great until I had to spend a day debugging a line number that ended with O instead of 0.
It was always a big mystery why renaming my program from .BAS to .EXE didn't let me click to run it like other programs.
Ah, memories...
Ha. Like other such newbie-isms.
One of my favorites:
Computer: Hit any key to continue.
User: Where's the any key?
A google search will turn many more amusing ones.
[1] Archive of "SEQUEL: A STRUCTURED ENGLISH QUERY LANGUAGE" https://web.archive.org/web/20070926212100/http://www.almade...
> SELECT NAME FROM EMP WHERE DEPT = 'TOY'
https://www.youtube.com/watch?v=WYPNjSoDrqw
If you don't want to watch the documentary, we did a shorter podcast episode about it:
When I first learned to program as a child, it was in Pascal (on a mainframe... microcomputers were barely a thing back then). Our instructor expressly forbade us from learning BASIC because "it would teach us bad habits".
That which is forbidden becomes attractive, of course, so a bunch of us kids started getting together on our own and we all learned BASIC on the sly. It felt so... wrong... and delicious. Forbidden knowledge is fun knowledge.
That's how BASIC became the second high level programming language I learned.
https://www.hup.harvard.edu/books/9780674970977
But even then it was very interesting! The philosophy was that anyone could program, and they really did build a culture of amateurs writing programs that answered their own needs. The author has access to a lot of ephemera from that time which gives some flavor of what it was like in the lab.
And then, BASIC culture spread by unlikely methods, like the Pillsbury Dough company. No, really. For whatever reason they got involved allowing local schools in the midwest to time-share with their big mainframes.
Lately I spend most of my time writing less-procedural code on procedural languages. Eliminating the step-by-step 'time' element and mutating variables is the best way I know to make more comprehensible software.
Just because computer hardware executes step-by-step in time, doesn't seem like a strong enough reason to learn programming this way. I'd really be curious what would happen if programming (not 'computers') were taught more transactionally with defined inputs, outputs, and a mapping definition that gets coded with intermediate expressions rather than time-varying data building. Basically, instead of starting with for/if/etc then eventually finding filter(predicate), map(function) start with them. There's a bit of learning curve up-front, but it seems flatter from there compared to all the accidental complexities created with the other approach. The first-class function aspects can even be bypassed by only using anonymous block syntax for a long time.
Is there a semi-popular introductory language that is more based on (or can use) immutable data and mapping expressions? Even for my own use, I can't really find much more approachable ones than Kotlin/Java/(Gleam?), F#/OCaml/Elm for statically typed ones. For dynamically typed languages, the close ones I can think of are Ruby and Elixir.
Endless Loop: The History of the BASIC Programming Language by Mark Jones Lorenzo
A major goal of D was to have strings work like in BASIC. And they do! Very happy about that. Thank you, BASIC!
Rocky Mountain BASIC also had multidimensional arrays and array operations. And support for sparse arrays.
Given the state of the field these days though, I can't help but wonder if I should have gone into some other line of work instead.
Now I don’t know if my childhood evaluation was correct but I do wonder:
Were there many complex programs written in BASIC? Or was it largely a teaching tool?
The dialect was one of many called "Business BASIC", which basically extended normal BASIC with COBOL-like capabilities like better string handling, decimal math for currency handling, and ISAM-like file manipulation. It allowed for developing the same kinds of applications as COBOL while having a nicer development environment than COBOL.
The major accounting suites for small business of the 1970s, MAS 90 and MAS 200, were written in Basic Four BASIC. A lot of applications were. Other dialects, like Pick BASIC, supported business applications as well. All of these were much more fully featured than like Microsoft BASIC on Commodore/Apple/Tandy machines. Those were toys in comparison to minicomputer BASICs.
Basic Four itself shipped on some microcomputers like the Tandy 2000. Compatible environments came out for PC, including AB86 for DOS, Thoroughbred/OS, BASIS BBj, and ProvideX. Keeping those old systems running on newer hardware was an enticing business, just like for COBOL programs.
Was it a "toy" language? Sure. I once implemented a non-scrolling toy spreadsheet program with it - just a fixed grid of cells - with some simple formula capacity and a manual "recalculate" trigger. Was that educational? You bet. Was it sophisticated? Not really.
But I'll bet there were absolute tons of one-off business applications written in it. A simpler version of what Excel was used for later, and still is. And scientific calculations? If Fortran could do it, BASIC could. Until something better came along to replace both.
People who weren't old enough to be in business remember BASIC as something from their home computers, but BASIC was integral to many businesses in the early years of general purpose computing.
There were plenty of business programs written in BASIC, and part of its appeal was that any business owner with a little time could learn how to customize those programs to suit their particular business' needs.
BASIC wasn't just for homes and home computers. Virtually every computer or computing device produced in that era had BASIC available for it, and for good reason. It was quick to learn, versatile, and when you knew the basics on one system, you could use that knowledge on other systems.
BASIC was available on machines ranging from $250 to $200,000 or more. There wouldn't be BASIC on $50,000 machines if there wasn't a demand for it.
My memory is a bit fuzzy on this specific, but I'm pretty sure that HP had a computer that came with both BASIC and AP/L. Nobody was using that machine in their homes.
I was a big fan of BASIC when I was young, and that led to spending the early portion of my career working on a series of BASIC compilers, all of them intended for complex software development. Two of them still sort of exist, in much-mutated form; one is now called "Xojo", and the other is Microsoft's rather-better-known Visual Basic.
I started writing a spreadsheet in BASIC, but never finished. I wrote a couple of simple games in it also.
There are more, but I've forgotten about them.
Now, if we expand the definition to include VisualBASIC, then the amount of production software written in the language explodes into at least 100,000 programs.
I don't know generally, but I worked in housekeeping at a large hotel for a few years in my younger days, and the software they used to track the rooms was in interpreted BASIC.
I didn't know that until my manager started cursing because the software broke. When I looked at the screen, the error message syntax was clearly that of BASIC. I just typed "RUN" at the prompt and everything worked again. She thought I was a genius.
Akalabeth was entirely BASIC, but that's somewhat less impressive.
Atari BASIC stored its programs in memory using a tokenized format - it did syntax checking when the line was typed in, and then the tokenized form was stored to save memory. There was a table of variable names, indexed by token. So a quick and easy obfuscation technique was to overwrite the variable names with something like just carriage returns, so that when you LISTed the program it had no variable names and lots of extra line breaks.
As I recall, at least. Haven't reinforced those memories in a while.
I'm very not sure, so I'm guessing that the system had several hundred thousand LOC.
The idea was to stop spending a fortune on mainframe time and run pensions valuations on a microcomputer.
The Fortran system, running on a mainframe, might take 60s to run a valuation.
The same valuation would take a full day to run on a microprocessor, but it worth it because it reduced costs by a lot.
If you mean the actual accomplishment of it in general:
1. Get a subset of data that lets you create a representative set of test cases. You can validate your code in minutes, not hours or days. Then you run it on the full thing once you've seen that the 5-minute job works as expected.
2. Sacrifice a goat, pray to hopefully the right god, and hope it wasn't their son from a goat mother that you sacrificed.
3. Spend a lot more time thinking before doing.
4. Read a lot.
(1) works if you can run the task on your own system or have access to a system to run it on. This is the best option, or some variation on it.
(2) is unfortunately what happens a lot, they usually sacrifice the wrong goat and end up cursed instead of blessed.
(3) and (4) are the next best option after (1), and should be done alongside (1) anyways. The system I'm on now is legacy and being upgraded. The test bed is available to me maybe 1 hour a week right now because everyone needs it and everything is urgent, apparently. I spent a lot of time reading the code, the documentation, and thinking about how to structure my solution to a problem our users have. My first pass validated the solution concept and took 3 days or so of thinking hard about the problem and 5 minutes of coding. The second pass is more robust (error handling) that took several more days of reading and thinking to identify what error cases could even occur, and two hours of coding.
Yeah, if I could run it locally I probably could have finished it all in those first 3 days (honestly my 5 minutes of coding was figured out by the end of day 1, but I wasn't certain since I was new to the codebase). But when that's not an option, you spend more time thinking about the problem you're solving and the problems your solution will generate so you solve it before you run it in the first place.
Was much commercial software written in BASIC? (Edit, because this is being misunderstood: I'm not talking about the evolved BASICs being pushed by the late 80's, only about the ones like Applesoft and GWBASIC the commenter is asking about) No, very little. As you point out BASIC doesn't offer much to developers who already understand a macro assembler. But the market was much bigger than that.
There was a huge amount of commercial software written in BASIC dialects such as classic Visual Basic and ASP, Pick/BASIC, HP Business Basic, Wang 2200 Basic, DEC BASIC-PLUS, etc. Boring business software you would likely have never heard of but which was (and in some cases still is) essential to running all kinds of different businesses.
I used to work for a university and both the student administration system and the accounting system were off-the-shelf software, mostly written in VB6 and classic ASP (I believe the vendor also had some COM components written in C++, they had their own app framework, but the business logic was all VB6). At the time, we were waiting for the vendor to finish porting it to VB.NET. 20 years later, it probably still is in VB.NET.
They weren't. Many minicomputer BASICs of the 1970s and early 1980s, such as Wang's, lacked those structured programming features you are talking about, at least originally. They were classic GOTO/GOSUB line number spaghetti code. And huge amounts of business software was written in them.
Some of those apps still run today, because the languages have been ported to Windows/Linux/etc. And eventually, just like Microsoft did, they added a lot of those structured programming features. But sometimes you'll find pre-structured spaghetti-style code surviving long after the dialect gained the ability to do better.
https://en.wikipedia.org/wiki/Business_Basic
Was popular with some smaller companies for their internal custom systems. Had some similar capabilities as COBOL without the IBM tax.
COBOL never had an "IBM tax", because almost every non-IBM vendor had a COBOL compiler. If you didn't want your COBOL from IBM, you could buy it from DEC, HP, Wang, Unisys, NCR, Honeywell, Microsoft, Micro Focus, Watcom...
That said, if your COBOL was running on an IBM platform, you often were using lots of IBM proprietary features (e.g. CICS) which made it hard to port to another vendor–and that could indeed be an "IBM tax". But that's wasn't due to COBOL in itself. If you limited yourself to standard COBOL, and avoided IBM proprietary stuff, moving your COBOL app to another vendor didn't have to be difficult
BASIC attracted business users because it was viewed as simpler and easier to learn, because it could run on smaller machines, because (often) using an interpreter instead of compiler resulted in faster development (no edit-compile cycle).
https://www.wherry.com/gadgets/retrocomputing/vax-simh.html
Modern GNU COBOL can be found at this site:
https://www.gnu.org/software/gnucobol/
A great deal of the COBOL that we use relies on OS2200 DMS, originally from Univac.
Where? I don't see any VMS 1.0 image linked to on that page.
Instead I see instructions to join the HP OpenVMS hobbyist program, which no longer exists, in order to install OpenVMS 7.3 on an emulated MicroVAX.
There is no longer any hobbyist program offering legal access to VMS for VAX. HP's hobbyist program was terminated and replaced by VSI's, which never included VAX (and more recently they appear to have dropped Alpha and Itanium, making it x86 only). Licenses to legally run VMS for VAX are very limited (e.g. maybe buy a used MicroVAX or VAXstation which comes with a VMS license)
I have downloaded all of this and run it on a rhel9 clone.
The outfit I worked for at the time sold directly into this area. We had a product line of simple I/O modules for physical automation (measuring temperatures, controlling motors, etc...) and all our programming instructions and examples were given in BASIC because it was on all computers and it was the one language that we knew everyone would be familiar with.
In the '90s when we were developing a 3D game (in C++) I made an early iteration of the level designer in VBA on Excel. You would color cells in a spreadsheet and then hit a button, and the button would output a text file that told the game engine what mesh or object to put where. Terrible way to do it, but a great way to work fast in those primitive days.
I still have nightmares about having to write the Validation procedure documents for a medical device production Quality system written in VBA/Excel. The program had started out as some scientist's desktop tool and somehow over the years, morphed into an actual production tool that now needed to be formally validated since we needed to make a change to it. Worst combination of spaghetti code and Big Ball of Mud that I've ever seen. I had the misfortune of being the only SW dev who was senior enough to do the task and who wasn't busy at the time, so I drew short straw!
I shudder to think of the millions of dollars of product that have been shipped as a result of that code!
One that I was interacted with was a CAD software written in QBasic. It was about civil engineering and static analysis tool for concrete buildings. You could export projects to dxf format so you could import into AutoCad to fix bugs and plot.
Funny how the name was MGCad and author insisted it stood for MegaCad. I suppose It was a nice coincidence that the Author's initials were MG :)
Lots and lots of 'business middleware' was written in various forms of BASIC, the most famous being VBA, but also quite a bit in things like QuickBASIC in an older period.
https://qb64.com keeps the dream alive.
I really wish I still had that system and all my BASIC scripts but those are long gone.
* https://en.wikipedia.org/wiki/History_of_programming_languag...
10 HOME
20 SWEET
30 GOTO 10https://en.wikipedia.org/wiki/Yabasic#PlayStation_2
https://www.theregister.com/2000/11/07/sony_adds_basic_to_pl...
>Donn was making good progress and looked to be on track to ship in early 1985; we were excited to show the world what Basic should really look like on the Macintosh.
>He knew that Donn's Basic was way ahead of Microsoft's, so, as a condition for agreeing to renew Applesoft, he demanded that Apple abandon MacBasic, buying it from Apple for the price of $1, and then burying it.
I bought Microsoft's BASIC for the Mac, and it was a waste of money, and I'd've much rather had Apple's based on my reading of the books which were published about it despite it not having been released save as a beta:
Apple Logo->Commodore BASIC->Fortran->Pascal->PHP->Java->VB6->.NET...and other modern things.
...With scripts of various types mixed in there. But BASIC is what got me hooked. Being able to write my own games on the Commodore 128 was fantastically addicting. Leaving demo store Commodore's flashing background colors with POKE 53281 and looping around felt like I was the king of the world.
10 PRINT“HELLO“
20 GOTO 10
and see what happens
A short reminder that the original Dartmouth BASIC was actually JIT compiled, including while using the REPL.
And most big iron OSes like VAX/VMS had proper compilers.
It was due to the 8 bit home microcomputers that it got the fame of being interpreted, as naturally there is only so much that fits into 16 - 64 KB.
There were dozens and dozens of BASIC compilers available, for all kinds of platforms from Commodore 64's to mainframes.
Microsoft BASIC Compiler for IBM: https://archive.org/details/stx_Microsoft_BASIC_Compiler_Fun...
Convergent BASIC Compiler for the Burroughs B20: https://archive.org/details/bitsavers_convergent0BASICCompil...
BASIC compiler for Burroughs mainframes: https://archive.org/details/bitsavers_burroughsS00InternalMe...
Dartmouth BASIC always compiled the code before execution, just like Lisp.
> Several versions were produced at Dartmouth, implemented by undergraduate students and operating as a compile and go system.
https://en.m.wikipedia.org/wiki/Dartmouth_BASIC
The historical video also mentions this at some point.
Dartmouth BASIC was compiled.
+1 for linking to a scan of the compiler source (and object!) code (note the 20 bit instruction words for the 1964 GE-235?)
I don't think this compiler is just a pre-processing activity.
There was nothing missing in VMS Basic, Turbo Basic, QuickBasic, DevPac BASIC, that would make me reach out to C.
You didn't have functions, you had GOSUB to a line number, which was just a slightly glorified GOTO. There was one global scope.
The later "structured BASIC" dialects resemble more COMAL than traditional BASIC.
AFAIK, all Microsoft BASIC (of which AppleSoft BASIC was a descendent) versions did not have the above until QBasic.
>LIST
10PRINT FNFACT(6)
20END
30DEFFNFACT(N)
40IF N=1 THEN =1 ELSE =N*FNFACT(N-1)
>RUN
720Dialects like VMS Basic predate them.
Interpreted yes, unstructured no. Dartmouth BASIC was unstructured until 7th edition (1980). The home BASICs started coming out before then and could fairly claim their unstructured nature as a consequence of the contemporary, to them, Dartmouth BASIC.
Why don't you actually read my comments fully?
http://www.bitsavers.org/pdf/dartmouth/BASIC_Oct64.pdf
https://support.hpe.com/hpesc/public/docDisplay?docId=emr_na...
And it wasn't just the BASIC language (and its compiler) that made it so effective, but the entire system: a remotely accessible, timeshared/multiuser, interactive environment.
The idea that every student (including humanities and social science majors) could learn how to program (and be given computer time) seems extraordinary and inspiring. The idea that computing could be useful and important outside of science/math/engineering departments was also visionary (probably going back to LISP - note John McCarthy organized the first AI workshop in 1956 at Dartmouth.)
Fortran is still used today, as it has a large software base of computation kernels and also lends itself to efficient compilation.
REM EDIT
10: PRINT "I forgot hn doesn't do humour"
GOTO 10