r/Commodore • • 6d ago

PET A 45-Year-Old Commodore Program Was Recovered From a Paper Printout

https://handheldhideout.neocities.org/articles/a-45-year-old-commodore-program-recovered-from-paper-printout

I came across a nice little preservation story that I couldn't resist writing about!

Back around 1980, Canadian university student Steven McDowell created an air traffic control simulation for the Commodore SuperPET, written in Waterloo microAPL. He thought the program had been lost forever, until more than forty years later, when he discovered three and a half pages of its original source code printed on old dot-matrix paper. Instead of just archiving the listing, he painstakingly typed it back into an emulator and spent around 40 hours debugging and reconstructing the software until the little aircraft were flying again!

Nice example of how easily early computing history could disappear, and how something as ordinary as a few surviving sheets of paper can bring it back. I've written a tiny little article about McDowell, the unusual SuperPET and the recovery of his program. Hope you enjoy it!

187 Upvotes

30 comments sorted by

•

u/AutoModerator 6d ago

"comment: "Thanks for your post! Please make sure you've read our rules post" "

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

16

u/Angelworks42 6d ago

I remember really wanting a superpet when I was a kid :).

2

u/MuffinOk4609 4d ago

I think I paid about $3000 for one with a single disk drive back then.... But I wrote it off.

11

u/flower-power-123 6d ago

I have a dozen PET programs on paper in a box in the attic. I will never run them again.

Wow! I always wanted a superpet. An emulator will never work well because you need a special keyboard for APL.

2

u/Liquid_Magic 4d ago

Scan them in and put them on archive.org !

2

u/flower-power-123 4d ago

I was 11. I don't think I want to display my skillz.

1

u/Liquid_Magic 4d ago

I hear you and I support that. However… it would be a snapshot into what kids were doing in the 1980’s on their computers. Historically speaking it’s a snapshot into that place and time! I wish I had my old C64 floppy disk from the 1980’s but all I have are some stories I printed out and the disk content printed out. But I don’t have the files. I mean it wasn’t a whole lot - I just wish I had it!

But today we can see what kids are doing with technology because of the TickleTok and YouTubes but back in my day we had printout and that’s the way we liked it!

So I’d invite to consider scanning them and putting them on archive.org and maybe some historian in 2100 will find them a helpful snapshot into the beginning of the home computer revolution!

2

u/macumbamacaca 6d ago

I have some listings lying around too. The title of this topic is clickbait.

1

u/MuffinOk4609 4d ago

J is a 'version' of APL without weird characters. https://www.jsoftware.com/#/ (And much more.)

1

u/flower-power-123 4d ago

For me one of the big failures of APL was never getting a canonical method of writing it in ASCII. APL might have died anyway but with every manufacturer having their own way of converting it to ASCII it never had a sufficient base of support to achieve escape velocity. IBM was in a position to do that back in the day. J has never had a significant user base. It will never be a popular language.

2

u/MuffinOk4609 4d ago

The 'problem' with APL was never the character set. (I still have a 2741 APL golf ball). There were many attempts at a 'unified' keyboard and J uses regular characters, but is still little used. APL is still the only language where you think about an approach to a coding problem for days, then write the code in an hour (deciphering take longer!). That pre-thought is an advantage. Most programmers do not have the patience to do that work.

It was the many other features like its conciseness, array capability, functional syntax, extensive subroutines etc. I didn't use it for decades but my finger-muscle memory still worked to my astonishment. I still have a set of key cap APL decals if anyone is desperate! But real APLers don't need them.

APL is still alive: https://www.dyalog.com/

1

u/marhaus1 4d ago

On my wishlist: an APL running on R or Matlab!

4

u/SilentMovieSusie 5d ago

"painstakingly re-entered it into an emulator" - you can tell the person writing this article didn't grow up typing game listings in from magazines.

3

u/marhaus1 6d ago

Three and a half pages of APL 🤯

3

u/Expensive-Meaning-85 5d ago

It actually blows the mind. I once converted 2000 lines of COBOL to 5 lines of APL. It was 5 lines to give me a passing chance to read it

3

u/joolzg67_b 6d ago

I used to write games in the early 80s on C64 to start with. The amount of source cider list over time is scary. Reassembler, multitasker, audio system, drum machine, assemblers, compilers etc.

Disks have been misplaced with all the house moves.

5

u/echocomplex 6d ago

That's cool the program was recovered this way. Love the archaeology and bringing stuff back from almost being lost forever.

Separately, given the era we are living in now, I wonder if he could have scanned in the pages to a computer, used a text recognition program, copy and paste the code into claude or similar and have it try to debug it into what its supposed to be.

1

u/MuffinOk4609 4d ago

I took a course on computer graphics at McGill in 1970. I used Fortran and a Calcomp plotter to draw pinwheels of Golden Sections. I still have the deck of punched cards, but the lettering has faded. I do not have a hardcopy listing. Has anyone developed a technique to optically scan pinched cards to convert them to text?

1

u/echocomplex 4d ago

I wonder if you could upload pictures of them to an ai bot telling it what the pictures are, and get any success asking it to do the translation.

1

u/MuffinOk4609 4d ago

Well, the deck is an inch thick. It's Fortran, not APL! But I should try some of the cards. It should be easy for AI! But then AI would learn to read ANYONE'S punched cards!

1

u/xenomachina 6d ago

I wonder if he could have scanned in the pages to a computer, used a text recognition program, copy and paste the code into claude

That's more steps than might be necessary if the goal is to get it into claude. You can give it a photo and it can OCR it itself.

1

u/marhaus1 6d ago

I doubt it handles APL symbols though 🤔

3

u/xenomachina 6d ago

Let's see.

I gave claude the prompt "Transcribe the APL code in this printout. Use unicode where necessary." and pasted in the first printout image from the article. Here's what it returned:

∇ START_UP ;BB;NP;RQ;TM;IT;IN;IP;IX;CT;CL;CD;CN;CP;SP;DE;R;ML
[1]  ML ← 32828
[2]  ⎕IO ← 0
[3]  ⎕RL ← 1000
[4]  INIT_KERNEL
[5]  ⎕ ← 'WHAT IS THE INITIAL PROCESS?'
[6]  START ⎕                     ⍝ START INITIAL PROCESS
[7]  SWITCH
[8]  MAIN                        ⍝ START THE KERNEL
∇

∇ INIT_KERNEL
[1]    ⍝ DEFINE SOME 'CONSTANTS'
[2]    IN ← 1                    ⍝ INDEX OF LINE NUMBER IN PROCESS DESCR
[3]    IP ← 0                    ⍝ INDEX OF PROCESS NUMBER
[4]    IX ← 2                    ⍝ NUMBER OF ELEMENTS IN PROC DESCR
[5]    ⍝ SET UP EMPTY PROC DESCR AND READY-TO-RUN-QUEUE
[6]    RQ ← 0 2 ⍴ 0
[7]    DE ← (0,IX) ⍴ 0
[8]    NP ← 0                    ⍝ NO PROCESSES YET
[9]    CP ← 0
[10]   CL ← 1
[11]   CD ← 0 1 0 0 0
∇

∇ MAIN
[1]  M_L: → OK IF ⎕TS[5] < RQ[0;1]
[2]       RQ ← 1 ⊖ RQ
[3]       NEW_PROCESS             ⍝ TIME-OUT
[4]  OK:  CT ← (⍎SP)[CL;]          ⍝ GET CURRENT LINE
[5]       CL ← CL + 1
[6]       → BR IF '→' ∊ CT         ⍝ IF NOT BRANCH THEN
[7]       ⍎CT                     ⍝ EXECUTE LINE   (cut off on the page)

Line 7 of MAIN is cut off at the bottom of the page, so it’s partly inferred. The START_UP header shows “START” overstruck on the printout. The ⎕ on lines 5–6 is printed as a plain quad, not ⍞.

It's interesting that it calls out "The ⎕ on lines 5–6 is printed as a plain quad, not ⍞", because that's the one mistake I noticed. I asked it why it did this, and then it changed its "mind":

...looking again, the glyph on line 6 does seem to have a mark inside the box that line 5’s doesn’t. So I agree with you: line 6 is ⍞, and line 5 is a plain ⎕.

But anyway, not a bad first pass that one could tidy up.

1

u/marhaus1 6d ago

🤯

2

u/MuffinOk4609 4d ago

That's the most Fortran-like APL code I have ever seen!

0

u/deathspal 6d ago

As for the debugging, It’s basic… nothing to really debug…

3

u/vdws 6d ago

Sure you can debug in basic. Why not? On the Pet it will be simple print statements, but that’s still debugging.

1

u/robertcrowther 5d ago

I posted about that here, you got a little more traction than I did lol.

1

u/MuffinOk4609 4d ago

Congratulations for using APL, and those little symbols made for much less typing right? I also used an SP9000 and even had the 6809/OS9 board from the Toronto Pet Users Club. This UNIX clone was much faster than an IBM PC. I used APL exclusively from 1970 until 1990. I have Dylog APL on my Raspberry Pi.

1

u/Interesting-Way-9966 1d ago

👏🏻👏🏻👏🏻👏🏻👏🏻👏🏻