Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
PC-BASIC, a cross-platform interpreter for GW-BASIC (robhagemans.github.io)
75 points by tie-in on July 12, 2024 | hide | past | favorite | 28 comments


I got to re-appreciate BASIC when evaluating options for teaching 11-year-old kids a bit how to program (in a single session).

People recommended Scratch etc. but I felt talking about programs was important also, which is easier when you write textual statements. At some point, I briefly considered using an emulated BASIC due to the simplicity and built in graphic, but I ended up using Python together with the pyturtle library for LOGO-like graphics, because the main exercise was to let kids draw a house on paper and then ask them to generate the drawing commands (also first on paper). Using Python has the advantage that nothing they learned was "wasted" or "academic use only" - you can immediately build on or monetize Python knowledge.

Interpreted BASIC certainly is a development forward from compiled FORTRAN from a didactic point of view.


Python is indeed the BASIC of today. I stoked my nephew's interest in programming by doing exactly what you said -- using Python with the pyturtle library. One flourish I'm particularly fond of is, we worked through the commands to draw a repeated object in the picture he was designing, and I said: "Now here's something programmers do, it's called refactoring. We're going to take this wheel here and make a function called 'wheel' that draws a wheel wherever you say. And then we're going to take the location and turn it into parameters for the 'wheel' function..." And on and on. He seemed really engaged.

The ubiquity of microcomputer BASIC in the 80s -- often as the first thing users see, or the only thing they see absent a cartridge or disk or something loaded into the machine to run something else -- seemed to suggest that computers are meant to be programmed, the way pens are meant to be written with. It was a complete accident, of course, a side effect of market realities at the time: no one at the computer companies could think of what someone would want a microcomputer for, aside from video games. The devices were solutions still in search of problems. So the microcomputer manufacturers encouraged customers to invent their own uses and bundled a programming language that would let them do that. Once word processing, spreadsheets, and especially the internet took root, it became obvious what consumers would want a computer for, so the idea that they would be expected to program them fell by the wayside and programming tools became no longer easily accessible or even available except as a separate purchase. As a consequence we may not see the efflorescence of programmers among Xers to early millennials repeat itself the same way again. I don't even think it happened in the USA to the same degree that it did in the UK, thanks to Sir Clive Sinclair's ability to deliver cheap but serviceable and completely hackable units to even modest British homes; as a result, British computing, like British pop in the 80s, hit way different and became a source of endless fascination and influence.


> The ubiquity of microcomputer BASIC in the 80s -- often as the first thing users see, or the only thing they see absent a cartridge or disk or something loaded into the machine to run something else -- seemed to suggest that computers are meant to be programmed, the way pens are meant to be written with. It was a complete accident, of course

I don't think it was an accident. BASIC was designed to be a simple language that was efficient with limited hardware resources, easy for beginners to learn and use, and powerful enough to do useful things. It turned out to be a perfect fit for microcomputers for those reasons. Especially in an era before platform standardization and giant software ecosystems, end-user programming was assumed and intended. (Even more so with "educational" microcomputers like the BBC Micro.)

> no one at the computer companies could think of what someone would want a microcomputer for, aside from video games

On mobile (and probably PC as well), games still dominate app sales by a large margin.

But in the early 1980s, microcomputer "business" (now "office" and "enterprise") software was already well established, including word processors (wordstar), spreadsheets (visicalc), databases (dbase) and software for mailing lists, billing, payroll, etc.


A big difference between how BASIC was designed, and how many got introduced to it on 8 bit platforms, is that Dartmouth BASIC is compiled, not interpreted.

It uses a approach similar to Lisp REPLs of the time.


This is true. However in the world of BASIC-driven 8-bit micros, compilers did make a showing here and there, as third party offerings to accelerate and obfuscate an existing BASIC dialect.


Yeah, but mostly usable only when we got to 128 KB machines.


>I don't even think it happened in the USA to the same degree that it did in the UK, thanks to Sir Clive Sinclair's ability to deliver cheap but serviceable and completely hackable units to even modest British homes.

I often hear this from UK people, but as someone from the US who is now in his 50s, I can assure you that the US also had a vibrant 8-bit scene in the the 1980s, just with different machines. Ours focused on the Apple ][ (and its many clones many of questionable legality like the Franklin Ace) and the Commodore 64, with smaller communities focused on the Atari 400/800 and the several incompatible TRS-80 computers put out by Radio Shack. There was even an attempt to bring in Sinclair's machines (the ZX-81 and ZX-Spectrum) through Timex, but they did comparatively poorly as the US market was pretty full.


I'm an American myself, and I grew up in that era. The Apple II was a pricey machine, which enjoyed popularity in schools (who got steep discounts from Apple), but it was nowhere near as widely accepted in the home as the Sinclair machines were. The other major competitors (TRS-80, etc.) were not much better. By contrast the ZX Spectrum was so cheap and plentiful that the C64 was considered one of the more expensive options in Blighty. Due to this and some cultural differences (America being a bit more of a "consume product" culture and the UK being a bit more "make do with what you've got"), the Spectrum was host to considerable innovation, even from bedroom programmers.

The Timex Sinclair line did trigger something of a mid-80s pricing war, yielding cheap but low-spec machines like the TRS-80 MC-10, the cancelled TI-99/2, the Mattel Aquarius, and the Commodore 16. But only the Commodore gained any traction as far as I'm aware, and only it could rival the Spectrum in terms of capability (but not in ubiquity).


Timex was quite famous in the Iberian Penisula during the early ZX Spectrum 48K days, because they had a factory close to Lisbon, and somehow they used to sell models locally as well, which now in retrospect it was a gray market thing, as they were supposed to export all of them.

So many of us during those early 8 bit days, could get those cheaper clones instead of the real Sinclair ones.

And thus my first computer became a Timex 2068.


I think you miss the point. The models you mention were not something my parents would (or could, maybe) buy. I wouldn't even dare asking if we could get an Apple. The Sinclair units were something we could afford and within budget.


> Python is indeed the BASIC of today

For "learn the basics (so to speak) in an afternoon" yes. (And I'm still sad about Python removing its BASIC-style print statement.)

But for sheer ubiquity in any computing device with a web browser, JavaScript is the BASIC of today.


Most of those devices don't expose the browser developer tools.

On the ones that do, you can use tkinter.


> It runs ASCII, tokenized and protected BASIC programs and supports the Microsoft Binary Format for full interchangeability of data files.

I wonder, does that possibly include QBasic binary format? I have a couple hundred games I wrote as a kid in this format that I have yet to automate a fix for.

I also have an outstanding Stack Overflow question about the process.

https://stackoverflow.com/questions/53051061/convert-from-qb...


You posted that 5 years ago, you should have been able to manually do it all by now :)

Someone on the retrocomputing stackoverflow also asked a similar question, although the suggestion seemed to be to load it in qbasic and resave it back to ascii.


The wildest part of this excellent software is that you can feed it WAV files of tape-recorded BASIC programs and it can decipher them.


No...the REAL wildest part of this is that I am old enough to have sat in a Radio Shack window display and using a TRS-80 and TANDY-BASIC I believe it was (?), and actually saved and loaded my attempts at writing games using a off-the-shelf Radio Shack cassette drive and a funky interface cord

OMG the crazy headaches that setup gave me...of course if you didn't actually press PLAY on the unit at the right moment after you typed LOAD in BASIC, the thing would hang...and to be honest...it loaded so slow that it often seemed like it hung when it didnt, thereby AT LEAST quadrupling the fun (not).

One thing good did come of it...I never once cursed at 5 1/4 floppies as they were a godsend compared to the cassette drive days

...and while your at it, get THE HELL OFF MY LAWN!


Same here, though with a TI-99/4A. I never had a drive on that thing, so it was always on tape, complete with handwritten odometer counts on the insert card for reference.


There's also Bywater BASIC, which apparently isn't being developed anymore:

https://github.com/nerun/bwbasic

(It's also in the repos of many major Linux distributions as bwbasic.)

A blog post where the developer comments on it a bit:

https://virtuallyfun.com/2010/06/09/bywater-basic/


The original author, Ted Campbell, stepped away from it a long time ago, in the 1990s. (His story that his grandmother wrote it is a bit of creative writing on his part.) Ted is now a United Methodist minister, seminary professor, and author of several books on Methodist church history.

Some other people have taken over the maintenance at various points, but I don’t know what its current state is. It has definitely seen development since Ted stepped away. Its emphasis has always been on portability and simplicity over features, which puts a limit on the scope of further development


There's similar projects like QB64 and L-Basic. I have to wonder if keeping language variants alive will be of historic significance hundreds of years from now. Will anyone care about early computing to this extent?


There are quite a few other BASICs. FreeBASIC, PureBASIC, etc.

See:

https://en.m.wikipedia.org/wiki/Category:BASIC_programming_l...

and

https://en.m.wikipedia.org/wiki/Category:BASIC_interpreters

Some will be obsolete, of course.


And a really weird one, BASCOM-AVR. Used it extensively in my robot built for my fourth year engineering project. Nice thing is you could still use ASM interrupt handlers without a lot of hassle.


Plain BASCOM(.EXE) was the name of a BASIC compiler, IIRC, in DOS days, probably. Did not use it myself, but I think I remember a colleague using it.


Awhile back I wrote a clojure program to take old PLAY statements (for playing notes on the PC speaker) from GW BASIC and generate a wav file. At the time writing GW BASIC it seemed pretty straightforward, but there are a lot of interesting timing options built into it.


For a while, I was using PC-BASIC to generate audio files for the IBM PCjr cassette interface to do some more diagnostics, for a machine that I had that didn’t have a working disk drive. I don’t even know if there is anything else out there to generate those at this point. PC-BASIC is great!


> PC-BASIC, a cross-platform interpreter for GW-BASIC

Can it run nibbles ?


nibbles is a QBASIC program..


donkey?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: