Transcript

Transcript prepared by Bob Therriault, Igor Kim and
Sanjay Cherian


Show Notes

00:00:00 [James Price]

It's like a poem. Short, expressive. I really found the overlap between poetry and APL, which many people, you know, talk about and celebrate. I think it's pretty real. That's how I came into it. And the overall beauty of the language is why I stayed for it.

00:00:29 [Conor Hoekstra]

Welcome to Episode 70 of ArrayCast. I'm your host, Conor. And today with us, we have a special guest that we will introduce in a couple minutes. But first things first, we're going to go around and do brief introductions to kick off the year of 2024. We'll start with Bob, then go to Stephen, then to Adám and Marshall.

00:00:44 [Bob Therriault]

I'm Bob Therriault, and I am a J enthusiast and happy New Year to everybody.

00:00:49 [Stephen Taylor]

I'm Stephen Taylor. I'm an APLer and a qbist.

00:00:53 [Adám Brudzewsky]

I'm Adám Brudzewsky. I am an APLer.

00:00:56 [Marshall Lochbaum]

I'm Marshall Lochbaum. I've used many programming languages. I make BQN now and also Singeli.

00:01:02 [CH]

And as mentioned before, my name is Conor. I am a polyglot programmer, but a massive fan of all the array languages and super excited to talk to our guests who we will introduce in just a couple minutes. But we've got, I think, four announcements in total, two from Adám and then two from Bob. So we'll go to Adám first.

00:01:17 [AB]

Okay. [01] So last week I was tinkering around considering the weather outside, and I made a video where I built up a program that simulates snowfall over a sky backdrop. And why do I bring this up? Because I've had a lot of requests for more involved examples. I usually make videos and many people make videos. We have these little one-liner toy problems, and this isn't a full application, but at least it's a little page of a code that does something more substantial and visual. So you can check that out, link in the show notes. The other thing is that for people who have maybe now finished Advent of Code 2023, but in general are interested in Advent of Code, also Dyalog is hosting a live stream on the 18th of January where there'll be a panel that discusses the matters, maybe work through some solutions. In general, we'll be open to see what happens there.

00:02:20 [BT]

And for me, just after our last episode, they launched J9.5. So J9.5 is out of beta and is actually the current working version of J. And actually just this morning as we record, they opened up the 9.6 beta. So J9.6 is in beta, and they'll start working on things. J9.5 is launched and working. It's the current version. Henry Rich will be on in a few weeks to talk about it. I guess more than a few weeks, maybe in a month and a half because of the list of people we've got that we've got coming up, but he'll talk more about it. And then the other thing is with regard to Advent of Code, there's a page on the wiki called Share My Screen that has links to all of last year's solutions. And I think the first seven or eight of this year's solutions. And they're sort of done in tutorial style by Henry's done some, Raul Miller has done some who's been on the show before. But they're really good if you're looking to try and see how people attack these problems with J. And they sort of explain things as they go along. So they're really good. They're worth looking at.

00:03:28 [CH]

Awesome. We will leave links to everything that we just mentioned in the show notes. And maybe, I guess it's not worth mentioning, but we'll also add a couple links that sort of summarize all the folks that did different Advent of Code problems and APL BQN or J. I think there's different little sites or pages that keep track of that stuff. So that if you do want to go and look at explore some of the solutions that have been done by either beginners or experts, you can do that. And with all of that out of the way, we now are able to introduce our guest, who is James Price, [02] probably in the name or the title of this episode, who is probably better known if you follow some of his work as @SolarBreeze on both Medium and Twitter. We will leave links to both of those if you want to check out some of the articles and things he's been doing. But I think we're primarily bringing James on to talk about a game that was written just a couple months ago back in October or September for a River Thames game jam, if I'm pronouncing that correctly. And the game is called Draculark. It's described as a mudlarking and vampire hunting game. But probably for me, the most interesting part about this is it's written entirely in APL, and it runs on the Commodore Super Pet, which means really nothing to me other than when I hear the word Commodore, I know it was like from before I was born. So I'm super excited to talk to James about how this was done. And you know, what what's sort of motivating to get this working on old school hardware. I mean, now that I say that out loud, I guess APL has been around since the 60s. So that was designed to work on this stuff at some point. But anyways, I will throw it over to you first, James. And if you want, feel free to give us like a brief history of how you got to where you are today programming in APL. And you know, what were your beginnings in the programming world or software industry?

00:05:10 [JP]

Well, really excited to be on. Thanks for having me here on the ArrayCast. I'm James Price, an APL and retro computing enthusiast. I did Draculark for the River Thames game jam on itch.io. There's a community of people who come together for game jams and kind of get creative and throw out whatever kind of code to provide for the game jam. Nobody ever programs in APL. And also nobody ever programs for the SuperPet. It's almost an unknown machine. Even among Commodore enthusiasts, most people have never really heard of the SuperPet. So really, I have the whole field open to myself as far as developing games on this platform. I had previously done some APL coding for a game jam before for a Commodore logo jam for the birthday of the Commodore 64, the 40th birthday. Did a little APL program that would print the Commodore logo. What I did was put the code into some strings and then printed the strings and then executed the strings. So it would be sort of a self-displaying program. And I submitted it to the logo jam. And it wasn't really well received. Nobody could run it in the first place. And it wasn't really a large jam either. So I didn't really expect to get much response from Jockey Lark at all. The Thames game jam is pretty small. I think there were a dozen entries that came in. So I had done a second entry using something called Twine, which is a text adventure writing program, like a tool to write text adventures. And it was sort of a mudlarking, choose your own adventure type game based on the work of Henry Mayhew, sort of a reformer from the 1830s England who had written some books on London labor and the London poor. And he really categorically went through and listed all the types of labor people perform in the city. People like mudlarks were included in his survey. And he would interview informants, mudlark informants and got their stories down. So really what I did was take his narratives from real mudlarks and use those to make my choose your own adventure game. But my heart wasn't really in that game so much as I really wanted to do a video game, a mudlarking game on the Super Pet. And the Super Pet, this is a machine which in the early 80s, I think 1981 or 1982 was put together at Waterloo, University of Waterloo. [03] And they were having a problem where their undergraduates would come in on the computer science program. Really their mainframe was overloaded. The response time got extremely slow. And so they thought, well, we could have a standalone box which we can teach people these programming languages on. And then they can either upload them to like a Vax mainframe to run there or they can just run on the host. And the Waterloo Super Pet featured a whole host of languages. It had Fortran, COBOL, Pascal, BASIC. It had actually two different versions of BASIC, Assembly and APL. And so when I discovered it had APL, I thought, well, I got to really give this a try. This is the machine for me. It's got all these languages and this would be great for games. I had grown up in the 80s when the Commodore 64 was really big. I had a Commodore 64, before that a Timex Sinclair 1000, which was kind of an Americanized version of the British ZX81 from Sinclair. So I knew BASIC and a few different kinds of BASIC. I also had an Atari 800, which was an 8-bit 6502-based computer. So really came from that early home computing environment where you would turn on the computer and it would come up in BASIC. And the enthusiasts of the era would type in programs from books like 101 Basic Games by David Ahl. And there were magazines like Compete's Gazette and Creative Computing, which were popular. They printed programs that you would type in and run. So I was familiar with most of these languages to some extent. I went through the SuperPen and did a little bit of code for each of the languages, at least the Hello World type program. But really the APL is what grabbed me to start using the machine. The thing about the 101 BASIC programs with David Ahl collecting all these programs from, while a lot were high school students who would send in code, he collected the programs rather than really wrote all of them. He wrote a number of them, but they were contributed to the book. And these were really mainframe type games where a teletext would be the assumed display, or maybe a glass TTY as they called it in the era.

00:10:52 [JP]

So really kind of the games that you could do would be limited. You wouldn't be able to do any peek or any poke like in BASIC. And these are commands that let you access the memory directly. So you can peek the memory location of the joystick and whatever's coming into the joystick come, you can read the value of it. So with the SuperPen APL, it had a peek and a poke. And I thought, well, I can use a joystick. I can directly address the screen and put things into memory, into screen memory directly. And I think I could probably make a game here. And I thought, well, how would I do a mudlarking game? And the game just kind of came together. I started by writing a foreshore, just kind of text, which would represent the Thames foreshore on the screen. And I thought, well, I need some treasures here, or, you know, mudlarking prizes, things that you would find on the foreshore. So I thought the APL, the clips are actually really kind of cool. And maybe I could turn these into the mudlarking treasures. So what I did was found like maybe, I forget, 15 or 20 of the APL symbols and put those into a table that then you sort of have to hunt for. And each of them is a specific, different sort of mudlarking treasure, things like a broken teacup, or an old coin, a broken bottle, or a piece of the dove's type, which was this beautiful typeface from England around 1914. There was a dispute about this typeface. And the creator of the typeface threw it into the River Thames. He made 200 visits to the river, threw little packets of this lead typeface into the river, because he and his partner were in a dispute about sort of the ownership of it. And people, you know, occasionally find these even today. So I thought, well, it'd be kind of cool to really put together a game around this. And kind of wrote itself really, the trick was to find something that actually had a good feel for the play dynamics. And it kind of came together where I selected a bunch of treasures that you could get. But then to put a little tension in there, you had to collect four different treasures, which would then later be used in the quest when you're in the Dracula phase of the game. So for instance, you would have to pick up a medieval pilgrim badge on the foreshore, which later on when you're in the crypt with the Dracula coffins and the vampires in there, you would be able to invoke the sigil of God, which would, you know, destroy one of the vampires. If you picked up the stake and the hammer, you'd be able to kill another of the vampires. And you had to pick up a crucifix to kill the third vampire. And really the tension was that you'd have to pick up these four items. And once you pick up a certain number of items, you leave the foreshore. So the trick is to pick up the correct items. And that I thought worked pretty well as a game device. Once you kind of collect your foreshore treasures and move forward from there, you go to Carfax Abbey. And when you're at the Abbey, there's a flying vampire, which you have to fire missiles at five times. And once you clear through that screen, you progress to the crypt where you can use those treasures which you collected to take care of the vampires. And if you haven't collected them all, you don't win the game. The crypt door closes and you kind of come to the end of the game unsuccessfully. Kind of some of the issues with it were there's two workspaces that I needed to use. The SuperPet workspace is really small. It's like 24k. This is, you know, typical of IBM 360 type situation where it's a really small workspace.

00:15:20 [JP]

So I chained the two of them together and I thought it worked really well. It worked really well right until the end when I was trying to put them back together because for debugging purposes, I had kind of only loaded one of the workspaces, like the mudlarking workspace. And then I would load after I successfully cleared that, I would load up the Dracula workspace. So during testing, I had them broken apart. And then when I was finally ready to put them together, they sort of were giving me errors, workspace incompatible. And it was a bit tricky to actually get them to work together. I think I sort of ran into some undocumented bugs in the implementation where things that shouldn't have been a problem did end up being a little bit of a problem. I was getting errors with memory storage and stuff that would just show up. And the best way to work around it was just to go back to a previous version that I knew works. I also was having some issues where because I was using the screen memory while I'm writing the game, if I inadvertently let a missile fly up above the screen, it would actually go up into the program code memory and overwrite it and corrupt it. So I would have errors and I would list the function or not the function, but the little, yeah, the function, the little program that would have the error in it. Anyway, there'd be a missile actually in the code of the function sitting up in there. I was using the grade up glyph to be my missile. And I'd list out the function and there'd be grade ups going up through the code. So I realized, oh, no, this, the memory has been corrupt. I've got these characters actually literally embedded in my functions. So what can I do? You know, how do you recover from that? Probably the easiest way is to roll back because you really don't know where in memory you've corrupted it, just through the gameplay. So it was kind of fun to put it all together. I was a little disappointed at the end because I wanted to add more detail to the battle with Dracula, the flying vampire outside of Carfax Abbey. The Carfax Abbey scene is really kind of unfinished in my mind. What had happened was I looked up Carfax Abbey, that Bram Stoker had Dracula living in, in the book Dracula, and really found a wonderful picture of it. So I kind of copied that over in APL characters into the Abbey scene, like another foreshore. So I built the Abbey and then you place the vampires in it flying around. And my idea was that the vampire would go to the Abbey and start grabbing off stones from the Abbey and dropping them on you. And that the vampire would actually be a number of cells, not just one, you know, not just one character, but it would be like a whole sprite, kind of like a whole group of characters, like a big boss type Dracula. And when you would fire, it would break into a number of smaller little bats and those would fly around and then you'd fight them. And I was planning to use really the array features of the language more doing that. But then I kind of got COVID and I thought, oh, I really don't feel well at all. So I'm just going to stop development right here. I'm freezing them right here with what I have, putting the two workspaces together and then they wouldn't go back together. It was like, oh, incompatible workspace. So suddenly here with COVID, I'm just trying to get anything that worked shipped out the door before the end of this jam. So eventually I got it working and sent it out into the world. But it feels incomplete because I really wanted to use this technique where you have an array which stores a multitude of screen locations and it would be, you know, add one to that array and then all those screen locations would be changed. And really I was able to use this technique when I'm doing a solution to the Logiker Christmas challenge this year. [04] Each year, this guy Logiker, he's in the demo scene or the cold code golfing scene, I guess. He has a Christmas competition where you try to make a shape using whatever language you want. It's a retro computing challenge. So people by and large use retro computers, mostly like Commodores or Atari or the BBC's things, things like that. Mostly like 80s type computers.

00:20:26 [JP]

One of my solutions to it, he put out the challenge this year that there's a snow quilt. It's like a lattice. It's like a series of diamonds, like really nine diamonds, three per row and then three columns of three rows, basically nine diamonds. And I thought, well, really I should be able to do this more than one way. I should be able to use the poke method to directly address screen memory. And I also should be able to do a sort of a more traditional APL solution where you use that quote, sort of like space star quote bracket one plus the array idiom, if you're familiar with that the way that you would just print it like a bar chart. So I was able to get two solutions using the more traditional method, a 75 character solution on the IBM 5110. And then on the SuperPEP using the poke method, I got it down to a 62 character solution. There were a lot of one-liner APL entries this year and someone pulled it off in like 23 APL characters and even shorter using J I think. I have like, I literally just started typing in my questions because I don't think I can keep them all in my head, which is unfortunate, but the first one, which is, I guess, most topical, cause you were just talking about the IBM 5110 slash different retro computers, which well, so too many questions. First one is, do you have all these computers or are you just running emulators? Well, I have some of them and some I don't, for instance, Atari, I've got Atari 8-bit computers. I've got an 800XL, a 1200XL. I have an Intratec SuperBrain, which is a really obscure sort of CPM machine, but mostly for the SuperPET, for the Commodore 64, I just do emulator work. I do the development on the emulators. So I'm never really sure if the stuff will really work on the hardware. As far as the gaming that I write on the SuperPET, you're, you know, in the emulator, you can use the warp speed to really speed things up. And most of the games that I've done, including Dracula, you can use that the normal speed of the computer. But one of them, I did a night driving game where you really kind of have to speed it up for the game to be any fun at all, for the screen to update fast enough to play. So I'm one of these people who, I'm not a purist where it could run on the original machine at the original speed. As far as sort of the purposes that I have for writing the games, I just want to use APL. I don't so much care about what the original clock speed of the machine was per se. If there's a good game that I can do by multiplying the speed, I'll do that. But I try to make the games so that you can actually play them on the original hardware, even though I don't have a SuperPET. The SuperPETs were pretty rare. There weren't a lot made. I think it's in the 20 to 40,000 unit range. So there are not very many of them out there and they're pretty fragile. When they built it, they added a 6809 chip to the PET line. The PET was a 6502 line. And these little daughter boards, pretty fragile. You know, that 50 years old, or I guess not quite that, but 40 something years old. They're hard to justify sort of running a game on in my mind. So I do all my work really in emulators.

00:24:20 [CH]

I mean, that's, I assumed, I would have been very surprised if you had all these different computers. And I guess the good news is too, is if that's the way that you're using it, it's, you know, I imagine quite easy if someone wants to boot up an emulator and like take Dracula Arc for a spin, they can do that without having to worry about traveling to Waterloo, Canada and like searching the campus for a SuperPET. Speaking of which, did you discover these at Waterloo because you were studying there? Or is it just like a happy coincidence that, you know, you were into retro computing and then you stumbled across this, you know, this Commodore, you know, computer that isn't very well known compared to the Commodore 64, which is I think of the Commodore computers, the ones that I hear most frequently.

00:25:04 [JP]

Well, the way I found it, actually I had searched up a list of what APLs are there out there on the old 8-bit hardware. And it turned out there's really not very many of them. I found a list, probably a 20 year old list on the internet. And there was an APL for the TRS-80. And that was about the extent of it. And the SuperPET was on the list. So I thought, well, I never heard of this machine. I'm going to look into it. And I searched it up. There's a site, zimmers.net, that has all kinds of software for the SuperPET and as much documentation as there really is out there. So I found it through sort of an exhaustive search of what sort of retro APLs would I be able to run on an 8-bit hardware. I had also come across a similar, not quite APL, but it's called the EMPL. It was an Eric Mueller version of APL, which ran on the 8080 CPU under CPM. So I was able to use one of those 8080 emulators to get that version of APL. But the EMPL is a version of APL where it doesn't really use any of the special characters. It's more like ASCII equivalent, which I mean, is cool and all. But really what I wanted was to use the real symbols. For me, half the excitement of working in APL really is the symbols or something I want to understand and learn. So it was through going down the list of different APLs that I found it.And that's how I discovered the platform.

00:26:57 [AB]

So how did you get to APL in the first place?

00:27:01 [JP]

Oh, well, you know, in the 80s, I'd heard about APL, and I didn't have any access to it at all. In university, I found some papers on it, and I grabbed one of Iverson's papers and shrunk it down with a copy machine, just made a little miniature book of his paper, and I would carry it around and read it. I did this with a number of books where I was just really studying it every day and carrying it around, reading it at breaks and lunchtime. And it might have been his Turing Award paper. [05] And I just really, really was interested in the language, but I had no way to ever actually run it. And then around COVID, I had a bunch of free time. And I think that was when I discovered your wonderful TryAPL site. And I went in there and I said, I can finally actually play around with APL. And so it was amazing to me. I'd never seen anything like it. It was like, Gitte Christensen with her one, two, three, plus four, five, six. And she sat down and typed that and was like, okay, this is really something. And that's what happened with me. I realized, yeah, there's something really here to this language that I need to learn. So it really was through exposure to TryAPL. Once I went to TryAPL, I thought, you know, this really is a great solution to how you can type in the characters. Because that's one of the perennial problems with APL. How do you get these characters actually typed? And I knew about GNU APL. And I looked at that a little bit using Linux, probably around the year 2000 or so. But my recollection is it wasn't really as fully fleshed out as it is now. So I didn't really get very far with it. I was pretty busy at the time. So I didn't give it much as much attention as I really should have. But once I saw the TryAPL site, I thought, well, here's here's an easy way to input the glyphs. So I thought, what I'm going to do, I'm going to port APL to the Commodore 64 to the 6502 CPU. And the first thing I'm going to do is I'm going to get the glyphs up on the screen, like on TryAPL, where they have the line of glyphs. I thought, I'm going to use the first three lines of the screen and put sort of all the glyphs along there. And you can go up and select them using the arrow keys or a joystick. So I had this great time just carving the font by hand in a, you know, old school Commodore font editor and created the font. I had found the Selectric italic alphabet somewhere in a font collection, but the rest I had to kind of carve out by myself, which I thought was a huge, just a wonderful experience. See, going through the fonts and really creating them yourself, to me, was the first part of learning APL, where I got them up on screen and I was using assembly language for that. It turned out to be really pretty tricky to be able to select a character under the cursor and move the cursor around and like hit return and select that character. But once I got that going, I was like, okay, now I can actually select the APL glyphs and get them on the screen. I was pretty happy with that. Continued on with implementing APL for about six months on and off. And the more I started really digging in, the more I realized how big of a task it really was going to be, especially on a 6502 implementation, where you really have huge constraints. I got as far as I would be able to store variables and I was using a linked list. I had at this point moved to C to do the implementation. I realized assembly was really quite a chore. So there's a version of C for the Commodore 64 that I started using for development. And I was to the point where I had a recursive descent parser and I was able to do things like one, two, three, plus four, five, six to the power of seven, eight, nine, and have it parse through and get the right answer for that. And I realized there's quite a bit more work to go here. And at that point, I was working with some people who were interested in CPM on the Commodore 64. And I realized I could bring APL Z80 over onto the Commodore 64's CPM system. Rather than develop my own APL, I could just pull over sort of an existing CPM version and bring that on the Commodore 64. And that works great. I had to remap a couple of the keys. The Commodore doesn't have the left arrow. So I didn't have any way to perform assignment until I went in to the character table. There's two internal character tables, one for internal and one for sort of external printing and usage of the characters. Anyway, I went in and changed it so that I had assignment. Before that, I had to go into the atomic vector and select the left arrow as a key and use it. It's sort of like life without the assignment arrow. How are you going to handle that? And you can. You can use the atomic vector to pull the string out, construct a string, which you then execute. So there were some issues with getting it going, but it came together.

00:33:06 [BT]

James, I've got to say, this feels like to me one of those movies where some guy carves a baseball bat out of a tree limb and then shows up at the New York Yankees and starts swatting home runs out of the park. I mean, wow. This is not... If people are interested in theory languages, this is not usually the path people take to get involved with them. It's just amazing. Do you notice a difference having to go back to retro? And you played with TryAPL. Do you notice a big difference in when you go to a retro style? Does it change the way you think about the language? Or can you see the foundations? Is there a continuity there?

00:33:45 [JP]

Oh, yeah. It's almost like a completely different language. APL 360, you know, it's kind of constrained. You don't have boxing. Well, you don't have really much of any of the modern stuff. So one thing I found was a lot of the tutorials, the modern tutorials really don't speak to old, you know, vintage classic APL. But I also kind of had come up from reading the original IBM 360 APL source code, the APL\360 source code. [06] I was looking at that. I was looking at like Rodney Zaks, who had the Cybex press. They did 6502 books back in the 70s. Rodney Zaks had an implementation of ADPL done in microcode. Really, I was rounding up all the all the documented implementations I could find to try to understand, you know, how are people doing this under the hood? Really, I went in sort of naive. And so a lot of the things I would encounter in the newer APLs I didn't even want to hear about. It's like, how am I going to implement the selfie? How am I going to implement any of this stuff? I kind of just wanted really to keep it simple. So what I was thinking to my my theory of what am I doing here? I'm implementing APL so I don't have to learn APL, modern APL. It's sort of a way of dodging learning the entire modern landscape was what if I just stay down here in this old sort of, you know, classic APL, which I really enjoy I collected APL books well before I had any access to APL. There's a there used to be a technical bookstore, Powell's Technical Books. And every time I would go in there, I would immediately head for the APL section. There'd be maybe one or two books in there. I'd buy them. And I collected quite a group of books. So I, you know, would sort of learn it from the book. But I never had any way of really actually using the language until I tried to try APL. But again, that's that's a newer APL. So it was it's a different experience kind of being in the older world, the classic world of APL.

00:36:09 [BT]

I'm afraid to say they're gone. Yeah. Oh, yeah. This was a huge bookstore, bigger than most normal bookstores. And they had math. They had biology, huge computing sections. And I, I would go there on my lunches from work and just wander around. And, you know, so many wonderful books, like Game Theory by John von Neumann. I would go look at group theory books. And just, you know, prime number sort of, yeah, they're gone. They eventually closed down. Powell's opened a smaller version of the store, but it didn't really last. It lasted maybe one or two years. It was more sort of toys than books. And then it's just there's no trace of it left anymore.

00:37:04 [BT]

Oh, it's a shame. Just we'll get back to the APL. But I remember going to Powell's. Oh, I'm thinking it was in the 80s and looking for some math books and couldn't find anywhere, anywhere. And I went to one of the people at the desk and said, I'm looking for math books. I can't find them. Oh, it's not in this building. You had to go to a different building that had all the STEM stuff. It was amazing. It was just incredible.

00:37:30 [JP]

Ohh I loved that store.

00:37:32 [CH]

Yeah. Where is this? Where is this located?

00:37:34 [BT]

It is in Portland.

00:37:35 [ST]

James, I wonder, listen to you, if I'm hearing a flight from complexity. You spoke about wanting to avoid the, you don't think you use the word complexities, but you wanted to avoid all that being added to modern APLs. And you're looking at implementations and small old machines and listening to you, I was feeling, yeah, it's like a language, which looks so small and simple so that you can write one, two, three, plus four, five, six ought to run on your wristwatch.

00:38:12 [JP]

Yeah, there's no reason it really should have to be too complicated. And I was coming from where I wanted to understand the implementation of every bit of it. To me, the additional complexity just kind of got in the way of the purity of what I saw as the original Iverson vision where, I mean, before it even was a computer programming language where it was just sort of his mathematical notation. I really loved the paper where the notation is a tool for thought. And to me, it was like, what's the very core of this language? What's the very minimal part? What's the minimal viable product that I can actually implement here on the Commodore? Because there's very little room on it. And I had looked at things like APL 11, really small APLs done previously and had a pretty firm grasp of the limits of where they were going. But there were parts of DyalogAPL and BQN where I'm just looking at them thinking, well, I'm not going to be able to implement them very easily. So I'm steering away from a lot of the more modern constructs just because I didn't want to have to implement any of them. I was pretty selfish in that respect. I was coming at it from personally, what part of the language do I really care about here? What do I really want to do with it? And what can I put together? For me, the hardest part of it was going to be getting sort of the function editor going, the Delta function type. And I'm thinking, well, now I have to write an editor for writing the functions too. So that was sort of, that was part of it.

00:40:11 [ST]

I was wondering if your hunt for simplicity had brought you into contact with k. That's had about 30 years of industrial exposure. So it's kind of battle scarred. It's had bits added on and knocked off and whatever. I don't know how to talk about this, the different iterations of K, because Whitney insists there is only one k. And I guess we're talking about a kind of platonic form yet, which is approaching. But in October, I got given a brief tour of the current Shakti k interpreter. It's with 39 lines of C code at that point.

00:40:51 [JP]

Wow, I love it. Yeah, I had really been studying the variants of APL, things like K, the J incunabulum. [07] I studied that so intensely. And I went out looking, doing sort of a literature review of like, who has ever written about the J incunabulum? I want to know what everything, every line is doing here. And there were a handful of people who had done it, who really had taken a pretty good swing at explaining it. No one had really explained all of it. But between the different explanations, there's a pretty good coverage of it out there. And so for the Logiker's 2022 Christmas challenge, I had done a sort of Arthur Whitney style C entry where I started it off with the preprocessor. Well, really almost all of it's preprocessor, right? There's one line of main, which was a nested palindrome where I used the preprocessor to where the main line said, Santa radar at NASA. And it was all contrived just to do that. When I was studying the Incunabulum, that was around when ChatGPT came online. So I thought, well, what does, what does ChatGPT really know about an implementation of APL of J of K? So I fed it the whole, the whole J incunabulum, just pushed it in there and then started interrogating it on each, each and every line, just saying, explain, you know, each line. And it went through the whole thing, you know, it seemed to lose context at the very end. I don't know the technicals of sort of how it loses context and the tokens and everything, but right at the end, it kind of lost knowledge of what we were talking about. But up until then, it did a pretty coherent and reasonable explanation of it. Not everything was right. It got a lot of things wrong, but it got quite a bit right. So I put that up on Medium, really just a post to document where, where we were on AI. Like what was the ChatGPT's understanding of the J Incunabulum at that point in time? So that's up on my Medium. I documented it up there so that we'll always have that. We'll know at that point in time, sort of what the AI thought of an implementation. I had also taken the Incunabulum and compiled it for the Commodore 64. I got it going with one of the C compilers for that. And I needed to make a couple of changes, the pointers. And I think there were a few changes to get it to compile. Just because it compiled doesn't mean it really runs exactly right. You know, you know how that is. But I was able to put it through a few operations and it did come up with the right answers. Sure, if you pushed it very far, it breaks pretty easily. It was pretty brittle code. But you know how that code is pretty cryptic. And I thought it was really cool to get it running on the Commodore 64 at all.

00:44:10 [BT]

You've got such great enthusiasm for this stuff. I hate to bring it back into practical matters. But is there something that when you actually go back to the older versions of APL and the smaller versions of APL, is there something that can be learned about that in looking at maybe applying APL to the Internet of Things and that kind of stuff where you have those kinds of constraints?

00:44:35 [JP]

Boy, I don't think I really have anything for that. I can't think of an answer on that one, Bob.

00:44:41 [BT]

I'm just thinking you're working in such confined spaces and you're using simple parts of the language. And that is in, I know, with chips and memory and stuff, it's not nearly as restricted as it used to be. In fact, your refrigerator probably has got more power than a Commodore 64.

00:44:58 [ML]

Yeah, well, nothing is down at 24K. I mean, that's yeah, so little memory.

00:45:03 [JP]

Well, 24K would be for the SuperPET. For the Commodore 64, oh boy. Yeah, it's nowhere big. I'm sorry. It's nowhere near that. It's 7100 bytes on the Commodore 64. So you've got 7K to work with in there. Yeah, the Commodore 64, working on that in APL, it's the tightest workspace you can imagine. 7K. And what I was doing after somebody came up with one of these 23-line APL solutions for Logica's Christmas Challenge this year, I thought, well, can I get this working on the Commodore 64? Is there enough room in the workspace to actually fit and run? And so I go in and type in the code, and I realize, oh, this version doesn't actually have matrix reverse. It has vector reverse. And you can take the vector reverse and write your own matrix reverse using-- so I did that, got that going, got this sort of reverse of the matrix going, was able to get the grid into an array. But then when I went to display it, I got to work space full. So I don't know why it didn't quite work, but it pretty much got there. It was able to hold the array and show it as zeros and ones. I was impressed.

00:46:33 [ML]

This is for like a 20 by 20 array, right?

00:46:35 [JP]

Yeah, it was like 17 by 17 or 19 by 19. I forget. And for the SuperPET, it's such a constrained workspace where if you're working with the full screen, screen memory, forget it. You can't fill the entire-- you cannot fit the entire screen into a single array. You have to work with half the screen at a time. It's a 2,000-character screen, so 1,000 characters was the most I could really get into an array without overfilling the workspace. So I would have a game like APL Invaders, which is like Space Invaders, which I'm working on. And I'm thinking, well, I'll just shift the entire screen as a block. In other words, take the peak of the entire screen memory area and then use that to poke into that area. Take the array, add one, and then poke it back. And this would move everything over one screen display unit, but the workspace was too small. So I would be forced to just work with half of the screen at a time because the workspace would be too small to fit the whole screen contents into a single array. That's how small it would be.

00:47:52 [BT]

Are there a lot of people doing this kind of work? I mean, I'm amazed at the depth and the background you have to bring to this. And I'm guessing it's all in the last. Well, you were studying APL long ago, but you've practically only been using it for what, about three years?

00:48:09 [JP]

Yeah, that's about right. I'm not really aware of anybody who's doing APL on a retro computer system other than a handful of people who have put in entries for Logikr's game. I'm sorry, Logikr's Christmas challenge. There's Peter de Wachter who puts in an IBM 5110 entry each year. Well, he put one in last year and this year. So he's been doing the challenge competition side of it where you would do maybe a demo or a competition, but no one seems to be doing games in APL. And I think that's a shame. Back in the 80s on the Commodore, there were all these games books. You had David Aul writing all these. And I like to think, well, things could have been a lot different. Things really could have been entirely different where a few twists of fate would have given us a different world. We almost had C/PM instead of MS-DOS, but the meaning didn't quite go off. Or Bill Gates could have put his APL into computers rather than BASIC. So in a world where games books were in APL instead of BASIC, what would that look like? And that's kind of what I was trying to explore is going in and taking some of those 101 basic games from David Aul and translating them into APL, but in a way that really respects the array language itself, not just a workman-like translation over into APL, but not using any of the real array features. So that's sort of what I've been trying to do with these games is translate over things which I really enjoyed like Super Star Trek was one of these games that I had as a kid. And I went to think or I thought, well, I think I'd like to port this over to APL, the Super Star Trek that I used to play. And I got 24K in and ran out of space. But in that time, I was able to get sort of the gist of the game working where I created the galaxy map. I had an array where I stored basically the galaxy in 8x8 grid of sectors of the galaxy that you could visit and ran out of space. So it's sort of the same problems people have always faced when they're working in these small APLs. But I don't think there's anybody out there who's ever written an APL games book. At least I never found one. I did a pretty good review of the literature thinking there's got to be an APL games book, but no one seems to have ever actually written one. And that's where I got the idea, well, you know, maybe I should do an APL games book. And I was on Twitter and there was a cover photo of a book posted, "131 Games for Your Intertech Superbrain with APL Source Code. " [08] I'm thinking, what? I've never heard of this book. I've never heard of an APL games book. And I have this Intertech Superbrain down in my basement. It hasn't been turned on for 20 years. I'm thinking, you know, I could actually write APL games on the supertech. I could get C/PM up and then I could bring it over an APL, APL Z80. I could start writing games, but it'd be a real chore to do it on the real hardware. So I sort of modified the cover image. I made it "131 Games for Your Commodore 64 with APL Source Code." And then I posted this up on the Commodore 64 Facebook group. After I'd gotten APL running on CPM on the Commodore, I did like some prime number generators and, you know, just some little one-liners and posted images of those to the group saying, "Oh yeah, I'm working on 131 Games for Your Commodore 64 with APL Source Code. " And people didn't really believe, or they actually did believe it. They believed this book was real. I kind of faked the cover for 131 Commodore games. And I realized there's actual interest in this. People are, would, they went looking for the book. Someone was like, "I went looking for that book and I couldn't find it. Are you sure that's the title? " And I'm like, "Oh, I was pulling your leg, you know, but if there's interest, I'll just start making some games and we'll do 131 Games for the Commodore 64. " But I recognized, you know, 7K is not really going to work for very many games. And there's no peek and poke. There's no real way to read a joystick on there. So it'd be teletype games. But it definitely caught people's interest. I recognized, you know, if I had really released an APL for Commodore 64, there would be people who would use it. And if I put out games for the Super Pet with the emulator, anybody could kind of play these games and just enjoy them.

00:53:40 [CH]

Well, I mean, I think if there's anything we've learned from this conversation, it's that it is possible to, in assembly, write your own characters that are missing that you need on all of your retro hardware, and then realize that assembly isn't great and switch to C, and then end up, you know, getting partway into an implementation, then porting, you know, an existing APL from CPM to Commodore. All of that is possible, as James has shown. However, probably you should just start with tryapl.org before you go and start trying to, you know, hand design your character set. That is not a requirement in order to getting involved with the array languages. It can be done, though. So now we've spoken to someone, interviewed someone that has done all this. I can't believe that you went to all that trouble. Or I guess, you know, trouble's maybe the wrong word, because it sounds like you were just having an absolute blast while doing it. But yeah, just an amazing story. And yeah, I don't think I would have the tenacity to, you know, be able to go through that journey, but it is super, super awesome hearing it. Before we kind of wind down, is there any final questions from panelists? I mean, I do have one random one that's from way back in the beginning, which is going to be, it's going to totally be like, where's that coming from? And it just is on my list. So if someone's got a better one, we can ask that one. But if not, we can end with a bad last question.

00:55:12 [BT]

I want to hear the rando one now, now that you've promoted it.

00:55:16 [CH]

All right. And I'm pretty sure I have the answer to this question already. But when you first started talking about mudlarking, I don't, I never played any muds. But my co-host of another podcast, Bryce, has always talked about that part of his entry into the programming world was playing muds. And then I think maybe even he wrote one or two himself, which stands for multi-user dungeon, I believe. And so I just assumed that mudlarking was like a spin off of muds. But is that, that's just a coincidence that this mudlarking that has to do with sort of, you know, I was about to say ancient London, but that's not true. It's just like, you know, a couple of hundred years ago, it just happens to share the prefix with also something that is game related. Is that correct? Or is there any like overlap in meaning there?

00:56:04 [JP]

Yeah, that's entirely coincidental. Mudlarking, yeah, predates any multi-user dungeons by easily 150 years. I used to enjoy doing the multi-user dungeons in the moos. You would go in sort of like an IRC type thing, but you create rooms and all that. I was once in a multi-user dungeon where somebody had somehow put all the nuclear bomb construction plans in there. So if you type some sort of question, it would just start spitting out, I'm sure declassified information on how to make a nuclear bomb, which was the strangest thing I ever found in a mud. I used to love that sort of community that I would be on IRC around, I think I got on around 1991. I remember the Gulf War, people in Israel on IRC saying, "Oh, I'm going to my own secure sealed room now. " Well, we're having missiles come in and all that. I always enjoyed those online communities and the BBSs and all that. But yeah, there's no connection between mudlarking.

00:57:19 [CH]

Yeah. How is that for my terrible question, Bob?

00:57:22 [BT]

Well, actually, the thing is mudlarking is essentially what you see those guys walking around beaches with metal detectors are doing. It was an occupation in the River Thames to go and scavenge stuff. And that's what mudlarking is.

00:57:38 [CH]

Well, there you go.

00:57:38 [JP]

The original mudlarks would collect. It was a desperate life. You would collect bones and rags, pieces of coal, and you'd take them to the rag and bone shop and sell them bottles for next to nothing. And today, the modern mudlarks, they're looking for antiquities and sort of historical artifacts, pieces of this Doves type font. I love the idea you might find a piece of font when you're mudlarking. It's claimed to be one of the most beautiful fonts ever made. And that's kind of what got me into APL. In a way, the font, just fascinated by the character set, the glyphs. To me, making the font was one of the fun parts of it. I had also worked on another font around the same time for an astrolinguistics language called Lincos. [09] And in 1999, there's something called the Cosmic Call, where we beamed out a message to one of these stars in Cassiopeia using Linkas. And so I got really interested in the font and I carved the Lincos font. And Athen I did a Haiku, automatic Haiku generator that would take Lincos. It's really constricted scientific languages. So it would have numbers, elements, names of planets, and a small number of words. But I would have it automatically make Haikus. Actually, this developed into a book, an APL book, where I made it such that there's sort of a fictional story, a young adult fictional story where these two scientists are working at, you know, SETI or Arecibo, and they receive a message in Lincos. And they're decoding it, and it turns out to be poetry. It's a translation of Sappho from another planet. But they also sent over APL. And the story is that we had sent out in the Cosmic Call, we sent out a version of APL 11 or something in, you know, archaic Kernighan and Richey C. And they received that. And they're sending back APL. And it's like, well, why are they doing this? Well, same reason they're sending back Sappho, because it's like poetry, and they loved it. And here's their translation. We sent them the original Greek Sappho. They turned it around and sent it back in Lincos. And they also, here's some APL. And in the story, the woman scientist starts learning APL. And the elder doctor scientist is, oh, he's very happy. And she knows the sappho poem, but he didn't understand that. He thought that was just gibberish that they're sending. She immediately recognizes, oh, that's poetry. And when they sent APL, she's like, well, what is this? And he's like, this is another form of poetry. I know this one. This is APL. And I had a lot of fun with that. That book was Poems from a Distant Shore. And so I had sort of done that book. And when the AIs were big, I did a couple more sort of art books based on the mid-journey photo, or the art generator mid-journey. I did a book of paper dolls and illuminated manuscripts, but from the world of cats. So it's like illuminated cat-y script. So I've done a number of these books, which aren't really like really anything to them. The barrier to entry for making a book is pretty low now. But these are explorations that I thought were sort of fun. So if I do the games book, this will actually be my second APL book. So semi-confident I could actually push it out. And no one would ever read it. I don't expect readers. These are more like documenting milestones in learning things. And for me, I learned Lincos. I did the font. I learned APL. I did the font. And I wanted to make a book. So I did that. And then I sort of moved on to the idea of an APL games book. So I'm pretty excited about it. I mean, not all the games are really much to them, but each individual game I sort of wanted to showcase a specific part of APL. Like here's how you do take or drop. Here's how you take input. And some of the games are mostly just works in progress. There's 54 of them up there and only a handful are really games. A lot are just demonstrations that you come across when you're researching APL. But all of them are sort of instructive. [10] And when I was learning APL, I'm still learning APL. I found them useful. So they're there as sort of like my own idiom library. I'll be like, oh, I know which game to look in for when I last used the residue to choose every 10th time to make a move on the screen or something. So it's been quite a journey. The whole font thing is kind of the reason I came into it. I found APL very beautiful and expressive. And the more I dug into it, I realized, well, behind the beauty is really a concise way of thinking. All the keywords in the languages I was used to in basic are gone. There's no keywords. So the algorithms are more concise. It's easier to express yourself. It's like a poem. Short, expressive. For a haiku, there's a format that it takes. I really found the overlap between poetry and APL, which many people talk about and celebrate. I think it's pretty real. And that's how I came into it. Sort of from a retro computing and also just interest in fonts. And the overall beauty of the language is why I stayed for it and keep learning more. I'm still interested in learningeWa Uiua and BQN. I think the community of array languages is really vibrant. There's a lot more going on. When I first approached it, all I really saw was these old books from the previous eras. I didn't really even realize there was much of a community. So to me, it's exciting to find so many people interested and really happy to be part of it.

01:04:38 [ML]

Yeah. I think Uiua in particular would be one that would be cool to see in retro computing because it is so simple. It doesn't have any local variables. There's so much that you normally do to implement a programming language that you just don't have to.

01:04:53 [AB]

Good luck drawing all those symbols.

01:04:55 [ML]

So that was actually I was thinking maybe that's the even the best newer language to try even better than K possibly. If you want to, you know, get something working on something that's like Commodore 64 or whatever.

01:05:07 [CH]

Well, we have a number of listeners in the hundreds, and I'm sure one of them is a Uiua fan and potential. . .

01:05:16 [ML]

Uiuaboo.

01:05:18 [CH]

What? Uiuaboo. A Uiuaboo? Is that what Uiua programmers are called? Uiuaboos?

01:05:22 [ML]

Oh, no, that's fans of Uiua.

01:05:24 [CH]

Oh, okay. Gotcha. All right. Is that like official or am I getting trolled right now?

01:05:28 [ML]

I just made that up.

01:05:29 [CH]

Okay.

01:05:31 [ML]

But I've been waiting to use it.

01:05:32 [CH]

Oh, Uiuaboo. All right. Well, to our Uiua fans or Uiuaboos, however you identify, you know, let us know if in the future you do some kind of retro computing. Because yeah, that would be, I mean, maybe a future guest, but maybe just a future announcement depending on what ends up happening. But yeah, this has been absolutely fantastic. I think your sort of last statement that you said on, you know, how you came to APL and why you stayed is just a fantastic way to end this interview on because yeah, I think we can all agree that there's some amount of that sort of comparison with poetry and how beautiful the glyphs are, regardless of what language you're in. Like, everyone acknowledges that there's just something about that original, like, APL 360, you know, care set that is magical. And while you were saying all that, you know, we will leave a link in the description if you'd like to purchase for $4.99, maybe even we can figure out some kind of discount code in the show notes. Well, just check the show notes. Anyways, Poems from a Distant Shore is available online. You can buy the PDF if you are interested. And I think with that, we'll throw it over to Bob, who will tell you how to reach us. You probably know by now, but. . .

01:06:40 [BT]

Well, if this is your first time on the show, it's contact@ArrayCast.com [11] is how to reach us. And we read your messages. And we had a particularly fun message with a meme of the Big Lebowski for New Year's, which we all had a good kick out of. So keep those coming. And any information feedback you get, we all, we read it. If you've got questions, actually fire them off to the Slack channel for the group. And often we get answers as well, which is really convenient. I just, I really enjoyed this episode. And honestly, the sheer joy you express in your journey, James, it's just something I kind of want to live in your world. I mean, the things you've done, but then you just so enthused about it. I really think that it's like that ballplayer who shows up on the diamond and he's like, "I carved this bat" and whack, look at what he can do with it. It's amazing. It's just fantastic. Thanks so much for coming on.

01:07:40 [JP]

Thanks. I really appreciate you guys having me on. One thing to know about that, the ebook on Amazon, don't buy it. It's totally scrambled up. If you go to blurb.com, I've put the entire book on free preview and you can read it on there for free. There's no reason to buy a copy and you wouldn't enjoy the copy on Amazon anyway.

01:08:02 [CH]

Interesting. So actually the link that I did find when I searched it, somehow blurb is the top result for what I Googled. Amazon did not pop up as the top result. And I see the preview. I did not realize that if you click that, you can just read the whole thing. So for free, you can read it. And if you love it so much, then maybe you can go and purchase your own personal PDF copy afterwards.

01:08:23 [ML]

And get an inferior copy.

01:08:27 [BT]

But support James.

01:08:28 [ML]

That would be the point.

01:08:29 [CH]

But yeah, once again, thanks so much for coming on, James. This was absolutely awesome to hear your story and hopefully we'll be able to get updates of things you do in the future.

01:08:38 [JP]

Thank you. I had a great time. Really appreciate it, you guys.

01:08:40 [CH]

Awesome. And with that, we will say happy array programming.

01:08:43 [ALL]

Happy array programming.

01:08:45 [MUSIC]