Transcript
Transcript prepared by Bob Therriault, Adám Brudzewsky, Igor Kim and Sanjay Cherian.
[ ] reference numbers refer to Show Notes
00:00:00 [Marshall Lochbaum]
But yeah, I mean if BQN can lose at code golf by writing better code, that's that's a win in life, right? It's much better, actually.
00:00:11 [Conor Hoekstra]
Depends what you're living for, Marshall, I live for the character count.
00:00:15 [Music Intro]
00:00:28 [CH]
Welcome to another episode of ArrayCast. I'm your host Conor and today with me we're going to have a discussion with our four panelists and we're going to start off by going around and doing brief introductions. So we'll start with Stephen, then go to Bob, then go to Adám and then go to Marshall.
00:00:39 [Stephen Taylor]
I'm Stephen Taylor. Happy New Year. I'm an APL and q programmer.
00:00:44 [Bob Therriault]
I'm Bob Therriault. Happy New Year to everyone as well and I'm a J enthusiast.
00:00:49 [Adám Brudzewsky]
I'm Adám Brudzewsky. I'm representing APL here.
00:00:53 [ML]
I'm Marshall Lochbaum. I'm a former J programmer and Dyalog developer and now I make BQN.
00:00:58 [CH]
And as mentioned before, my name is Conor. I am a polyglot programmer, primarily C, but I'm a huge array language fan, so I think we're going to do 2 short announcements. We'll go to Adám first for his one announcement and then over to Marshall.
00:01:11 [AB]
So the Twitter call on the name for this podcast that I've been starting with Richard Park this came out with a very clear answer. APL Cast Notation as a Tool of Thought. [01] No question about that. Now, of course there's a question as to how do we spell it, because Conor said that originally without a space in APL, uppercase C, cast, and then I put a space in and he protested. And I say maybe it looks strange, but it's separation. Maybe we'll have to do another poll on how to spell it, in which case we'll put a link in the show notes.
00:01:47 [CH]
I mean, I wouldn't say I protested the space, I just like patterns and there are I thought three podcasts, CPPcast, LambdaCast that definitely don't have space. And I thought that our podcast was ArrayCast, but then I actually went and looked it up in the podcast registry and we have it named The Space Array space Cast. So that was the thing I was going to mention is like what what's what is I know what it's named in the podcast registry. What is our official name? Do I not know the name of our podcast.
00:02:19 [ML]
So the good news is whether you put a space in or not, people would just assume it's whichever one they want it to be.
00:02:24 [BT]
Actually, that's that's brilliant Marshall, because that's actually kind of what happened. I always wanted capital A array capital C cast. No sace, that's what I was always going for, but a number of people said no, no, it's got to be the array cast and as soon as you go The space Array Cast you're putting spaces in, so when I registered it officially I had the array cast because there was we should do it that way and then as time went on, I started to condense it to capital A array capital C cast because I'm doing most most of the publishing work on it and referring to it, and nobody pushed back. So it's evolution is what it is I guess.
00:03:08 [AB]
No, it can be the website currently says the space array space cast yes it.
00:03:14 [CH]
Does the array cast without a space?
00:03:16 [AB]
But then as it becomes more known. It's just the array cast or just hey, I heard an array cast. Have you heard the latest array cast?
00:03:22 [CH]
So that's the thing. Is that colloquially? At least, amongst the people that I speak to about CP cast no one ever says the CPP cast. They say CPP cast. But it seems like it seems like it's pick your poison you get to do whatever you want with our podcast and officially. We don't have an official name or we do.
00:03:44 [BT]
Well, actually I was going to say I don't think anybody was referring it to or referring to it as the array cast, or at least not many people were until you've brought it up on this.
00:03:55 [CH]
No no ohh no.
00:03:55 [BT]
So maybe they'll do they go that route again, officially?
00:03:59 [CH]
Self fulfilling prophecy.
00:04:00 [BT]
Yeah, officially it is the array cast. That's not how I refer to it.
00:04:07 [CH]
Alright, well a lot of ambiguity there. Yeah, maybe maybe we'll let the listeners decide. Anyways, APL cast a new podcast coming to podcast players near you soon. Now that it has a name, hopefully.
00:04:20 [BT]
As I used to say when I was a kid, call me anything you want. Just don't call me late for dinner.
00:04:26 [CH]
All right, with that, we'll go over to Marshall for his announcement.
00:04:29 [ML]
My announcement is that this is something that I think both me and Adám have noticed over time. Thinking about the tool that's for BQN is called BQNcrate, [02] but it's based on an older tool that Adám made for older and better too really, made for APL, called APLcart. [03] Which both of these list a large number of code snippets that you can look up, and then the idea is that that you ask it. You know I want to solve this quadratic equation and you so you type in quadratic equation or whatever and you'll see a snippet that tells you how to do that. But what I found is the way that APLcart was originally designed to have the idea is it will put the arguments all. It'll make it so that it's one function called on the arguments so, particularly if you have like a train or something this can make it more complicated where you have this complicated thing in parentheses. It's difficult to to read, and the arguments on the outside. The idea is that you can then copy paste that function, but I think what a lot of people want from these tools is not really to to have just code they can copy paste, to me, that's what a library is for, and I'm hoping that BQN supports libraries pretty well, but instead you would like to know how to compute the thing and a lot of times it's easier to express it by putting the variables on the inside, making it into an expression, sometimes repeating variables. So that's what I've done. I've gone through all 1000 something expressions on BQNcrate and and change the ones that I think should be changed. Some of the longer ones I got a little lazy but generally BQNcrate now focuses more on expressions, so it's easier to read. And that's my announcement. If you've been having trouble with all the tacit code on BQN, try it again. If you still think it's too tacit, asking about it, and maybe, maybe it's an expression that I got lazy about and I can actually change it.
00:06:38 [AB]
I've actually also started adding rather than changing things to APLcart, uh, where I add alternatives so some people complained that the the tested code I have there is to touch it, it's too hard for them to read, and so I've started adding also explicit alternatives. So certain things you can actually add the search term tested or explicit and it will show you only that version of it, but that's a long way to go, because APLcart has like over 3600 entries.
00:07:07 [ML]
Ah yeah.
00:07:13 [CH]
It's actually interesting that this topic is coming up right now because just earlier this morning I was speaking of Leetcode, which we're going to be talking about later, solving a Leetcode problem from the most recent contest on Saturday and one of the pieces of it was creating an inclusive range between values X&Y, which we've actually talked about I think now twice on this episode or on this podcast. We'll link once again to Stephen's article that shows a really nice use of some of the q. [04] Enough, but I was surprised because I've written this function a couple of times, but whenever I go back to writing it and I know it's in the Finnish APL idioms as well I'm always surprised how complicated it is for at least the inclusive one as well, and I went to both I think actually I couldn't find it on APL cart, but I was looking for it on BQN and it was under the search term contiguous or is it no consecutive consecutive values between X0 and Y0 inclusive and it has a very complicated point free expression or tacit expression, and I just was like kind of scratching my head, reading it being like OK, this is right anyways, and then I ended up. I was trying to do this in J because the ultimate problem involved prime numbers. Which is like anytime there's prime numbers, it's like, well, J has those built in. I'm gonna forget about my favorite language is BQN, and then J makes it so easy and technically you can go to APL and I think in the dfuns library they have the same thing and I wouldn't be surprised if BQN has a library for that as well, but anyways, I digress, writing it, not tacit, and just using a dfun is like so much simpler, which is the long winded point or the point of my long winded tail here is that it's probably great that you guys are both adding this because it is pretty intimidating, I think going and seeing that that's the expression for like a sequence of contiguous values between X&Y inclusive because a lot of languages like Haskell and Rust, they just have like a double dot operator or like a 3 dot character operator for creating that range, and it's kind of interesting when you think that it's like it would be that difficult to do it in a language like APL and BQN and the point is, it's not I think if you do it just not point free or tacit. Not not sure if people have folks or even followed what I was saying for most of the time, but yeah.
00:09:38 [ML]
Well, so there are two entries. There's one, there's one where it assumes that the that the first character is less than or equal to the second one. And then there's one that doesn't in either order, which is quite a bit more complicated. I mean, I wouldn't. So this is a the one that's that's ordered. Is the 6 character function here.
00:10:03 [CH]
Which which? What do I search for that?
00:10:05 [ML]
I just looked for consecutive. Consecutive values would work. [05]
00:10:11 [CH]
Ohh yeah, that one's way simpler I didn't find that one so interesting that like I can't. I didn't actually look for the word consecutive. I was looking for range and I think for some reason.
00:10:24 [ML]
Yeah, which this is one of the cases actually, that's pretty borderline on this. I chose to keep it tacit. So you have a train that's left TAC plus range composed with span. But if you do it, if you do it as an expression. It has the right. The left argument twice, but it's only three functions it's it's like X Plus range of Y span X so in this case, I felt like this was something that you would probably use outside. Like you would use this as a function in a larger context, so I felt like it made sense to keep it tacit. But maybe it should be an expression instead, because it is right, it's 3 characters shorter if you write it as an expression.
00:11:16 [CH]
Yeah, I take back mostly what I said though because I was looking for the shorter expression of these two but did not see it. So it's actually not that bad. The one that I was looking at is a little bit more complicated for sure. Sorry, Adám?
00:11:32 [AB]
In this context I would like to what do you call it? Promote a tacit service called tacit dot help. [06] That's the whole URL.
00:11:45 [ML]
Oh, maybe I should announce this too. We have one for BQN.
00:11:48 [CH]
Now I I'm I don't even know.
00:11:49 [AB]
Oh wait.
00:11:51 [CH]
What this this is news to me?
00:11:54 [ML]
It does not have its own website, But I put it up on the BQN community page so you can find it from. And we'll put it into the show notes.
00:12:03 [AB]
OK, so tacit does help us for APL only and uh, what it takes a tacit expression and it translates it to a different.
00:12:13 [CH]
Does it have support for typing or no?
00:12:17 [AB]
No, it doesn't. It doesn't assume anything, it just converts to a monadic and dyadic separately and then it is what it is I'm trying.
00:12:27 [CH]
To type BQN into API and it's just saying invalid token. I'm like what's going on here.
00:12:33 [ML]
So the BQN version of this is salty Silvia dot GitHub dot IO slash BQN tacit helper, which is exactly as memorable.
00:12:41 [CH]
What what, OK, I'm just gonna go find some APL code.
00:12:44 [ML]
Should I stick it in the chat? So I kinda can.
00:12:46 [CH]
I'm on a different computer, I'm recording on one computer and on a.
00:12:49 [ML]
Well, why can't you open it on this computer.
00:12:51 [CH]
That's actually true.
00:12:52 [ML]
Then you can have a tacit helper open in either computer. Can just be very tacitly helper.
00:12:59 [CH]
Every computer needs a tacit helper, wow. When did this get created? I assume this is pretty recent otherwise.
00:13:06 [ML]
This is, well, three days, four days ago, five days ago.
00:13:13 [CH]
Which when did the APL one happen?
00:13:15 [AB]
That's been around for a while. It's a few months I think.
00:13:20 [BT]
J's had one for a year or two ... couple of years anyway.
00:13:23 [CH]
J's got one too what's your one called?
00:13:25 [BT]
I'll have to go look at it. It's an add-on. So, it's a file.
00:13:29 [AB]
Oh, it's not online.
00:13:30 [BT]
It's not online.
00:13:30 [CH]
Oh, it's it's inside J gotcha.
00:13:31 [BT]
Yeah yeah, it's not online.
00:13:33 [CH]
Oh yeah, that's true. I do know that what am I talking about? Yeah, that's like my favorite form function. It's like 13 colon something.
00:13:40 [BT]
No, that's the other way, right?
00:13:42 [AB]
That's tacit to explicit.
00:13:44 [BT]
Yeah, we can go both ways. Right?
00:13:45 [AB]
At at definition time.
00:13:47 [CH]
Ohh yeah which is even better if you're a beginner and can never figure out what you need to do. Yeah, although I think it only works for a percentage of things. It usually works for many tacit expressions, but I've I've had troubles with Dyadic tacit expressions.
00:14:03 [AB]
I mean, we could say right up front. Not every tested thing can can be converted to an equivalent explicit form and not every explicit thing can be converted to tested form. That's just how it is.
00:14:16 [ML]
No, I think every tacit of things should be should be right if it's explicit.
00:14:21 [AB]
It's definitely not true for APL.
00:14:22 [ML]
What would be, are you thinking? About like scoping issues or what? Scoping and console issues and things like that. So now we're getting really technical.
00:14:31 [ML]
Yeah, OK, but if you write if you write the computations that you need to do ahead of time outside of your function, then you can write everything.
00:14:42 [CH]
I think we should put a pin in this because we're going to turn this whole episode into a tacit versus explicit. We've got these. We've got these great websites. The take away because we're still in announcement zone or land. The take away is there's been some improvements to BQN crates I was about to say BQN CART and that's not what it's called. BQNcrate and APLcart. There's these two websites. Also, there's one not a website for J, but inside J, so lots of tacit and you know, tacit tools and J.
00:15:11 [BT]
J does have it's phrases right. We got the phrases which you've had forever, but they're not searchable. And if we did do that and there has been talk of that, we would call it jalopy.
00:15:22 [AB]
Well explain that.
00:15:23 [CH]
I don't even know what that is.
00:15:24 [BT]
Jalopy's, a old beater car. So it's it starts with a J and it's in the vein of carts and well, not crates so much, but I guess a little car is a crate too.
00:15:38 [AB]
Well feel freeo fork the APLcart or of course you can create codes. It doesn't actually care about the language much it's just an interface.
00:15:49 [ML]
Yeah, they've diverged a fair amount, so check both. I don't know which one you want.
00:15:53 [BT]
Well, right now I'm involved with the Wiki, so it's just sort of a side. Somebody mentioned it and we'll see if we ever get to it. We have phrases. That's what we do.
00:16:02 [CH]
Alrighty, we will wrap up those announcements that seems like might have gone 20 minutes so listeners are still here for the listener at this point, we will transition to today's topic, which is going to be an amalgamation of things. So in general, I believe the topic is going to be sort of the topic of recreational programming versus, you know, production programming, we'll call it, and you know this we talked about in the past. Sort of talking about sort of advent of code, and we're going to, you know, Leetcode into that and code golfing. There's several code golfing websites, but I think we're before we start talking about that we got a sort of tangential e-mail from a listener by the name of Alex. It's quite a long e-mail, so I'm going to sort of skip to the part where Alex is asking a question. Hopefully I'm gonna get through this in a minute or two and then we're gonna sort of start a discussion about the questions that he asks with in this e-mail so it starts off my question boils down to which language AKA array programming language should I start studying? The array cast doesn't seem too picky and encourages all the different approaches to array or Iversonian style language. Seeing as you have guests in to talk about Q&J and of course APL etc. As someone who is not a comparative scholar of languages, it's hard for me to make a decision about which language to devote a bit of time to study. A tiny bit of background on myself, I've worked, I've had around 17 years where I worked as a historian with a lot of different field work under my belt. I did a lot of writing several books and a pH D before I decided to add some more technical skills to my quiver and some new mental models to boot. I am now one year into a new career and life as a machine learning engineer and so they do a lot of stuff with Python. We're sort of gonna skip the rest, but so they're going towards working in machine learning, so one of my primary interests is in picking up J or APL or whatever is to find a tool that I can grow alongside as I deepen my understanding of mathematics and that I can use and that will accompany me going forward. Key criteria for my choice include the following four things. One my choice language should have a good community support. Especially since there aren't volumes books and online material to offer guidance and support. Two, my choice language should be production ready. Three my choice language should be mathematics friendly and four my choice language should have good, up-to-date introductory materials that offer lots of opportunity for practical use and practice. Out of all this, I seem to have settled on Dyalog APL, even though my instinct and gut seems to have a preference for J. Dyalog APL just seems to be going through somewhat of a community and materials renaissance at the moment and for beginner it seems like there would be a lot of support available also too many people seem to dismiss J as being an alternative take, which I read them as saying that it's a bit of a dead end which makes me slightly worried. My current plan is to work my way through Doctor Raymond Polivka's new APL book, and see where I'm at the end of that. Please let me know if you have a better recommendation for something that's practically focused that takes you from 0 to competent, and that's up to date, and perhaps also mathematically focused, bearing in mind that I'm basically a tadpole when it comes to mathematics currently, end of the portion of this letter. There was a little bit more at the end as well, thanking us and saying happy array programming at that this point, I will hand it over to the listeners what should we recommend? (laughter)
00:19:17 [CH]
Or I I said, listen. Hand it over. OK, listener, we're going to throw the question right back to the listeners. What do you think? We're gonna hand it over to the panelists and what should we tell Alex here?We've got Stephen holding up a book "Fun Q". [07] We just talked to Nick about and we've got Bob raising his hand. Who wants to go first?
00:19:41 [BT]
I'll go first is the the the first thing on the really good side, Alex talks about the fact that we don't seem to, you know, favor one language over others. I'm glad he came back with that because I agree with that we the idea is not to pit one array language against another array language. They have their purposes, some are better for some things it's almost the personal style. Some people prefer one over the other. There's nothing wrong with that, we just want to promote array languages, not just. We're not the J cast or the array cast, so that's like.
00:20:15 [CH]
That being said, go with J.
00:20:16 [BT]
Well and then the other side of it. He says he feels. J is a bit of a dead end I really don't see that we're there's a lot of things developing. And J threads are being added in the next version, there's an expanded extended long integer speed up that's going to be quite phenomenal if you're interested in, you know certain forms of mathematics, so be things you can do there that are much quicker than they used to be. It's not a dead end, it's developing, and it continues to develop, but having said that, the criteria you gave one was community. I think all the communities are really good. I would recommend and I think I actually did recommend to him that he look at the APL farm. As a discussion, it's a discord slash matrix.
00:21:05 [SIRI]
I don't understand.
00:21:08 [BT]
Oh, Siri doesn't understand. I'll have to do something about that Siri. Anyway, the APL form is is a is a discord slash matrix forum where all the languages are represented. There's lots of discussion, and I mean I'm not a beginner, but I from what I see it's very supportive. There's a lot of support going on. And I find that across the array languages that there is a lot of support, so I guess that's just my two takes on that J is in the dead end and and support. I don't think that's a problem with the array languages and let somebody else take the rest of it. Take a run from there.
00:21:44 [CH]
Should we go back to Stephen? Stephen you you held up the the "Fun Q" book? That's where you think Alex might be interested in starting.
00:21:51 [ST]
Well, it's a it's it's pretty hard to miss isn't it? We reviewed it recently. [08] It's a recent book. It tells you how to do machine learning stuff using q. Got machine learning add-ons and toolkits in it, and some fairly tight integration with Python, that's pretty useful for ML, so like Bob, I'm not minded to promote one language over another, but he's got a pretty strong offering there.
00:22:30 [CH]
Right, we're going either Adám or Marshall and I feel like two we should because, uh, like what's the question I think or a a side question to the one of what's the language to start with. Is there one thing that like delineates each of these languages from each other. So if we're talking about q versus J versus Dyalog APL versus BQN. Then is there one thing like there might not be, but like when I look at this list of four things, community support, production ready mathematics friendly and should have good up-to-date introductory materials? I mean, I think we can sort of scratch off #3, not that it's not important, but like all four of these array languages and just sort of imprisoning array languages in general are all going to be mathematics friendly I'm.
00:23:25 [AB]
I don't agree, J by far wins on that point, right? It has way more specialized mathematical primitives in the core language.
00:23:36 [CH]
OK, so this is. This is perfect then so like along with going is like maybe that's what sets up for J apart from the other languages is like that's not something I would have known off the top of my head other than the fact that I'm not sure if you're referring to primes and stuff. But maybe there's a whole other set of outside of prime functions they also have.
00:23:52 [ML]
Yeah, I mean so that's the thing math is not just like one field that you can choose to support. I'm not convinced like, well, J has a lot more invested in doing mathematical stuff. I'm not convinced that this necessarily translates to being great at mathematical programming of any kind like, so if you're into number theory, J definitely is better, because it has these extended precision numbers [09] and a lot of things you can do with them. For a lot of other things, I mean linear algebra. Pretty much everything but well, J and APL at least are both are both pretty focused on linear algebra. Other stuff it's kind of hard to say, like if you if you're interested in like numerical optimization, I don't think J has anything extra to offer in that area? I mean there it's not like built in functionality isn't what you want, you just want to to write the thing and it's it's much more of an ordinary programming task, even though it would be considered part of applied mathematics.
00:25:04 [AB]
So an example of something. I mean, yeah, it's things like in in statistics, probability things I I saw this list of how to write certain APL primitives in in the equivalent PQN and so for factorial. You'd say, well, it's a product of the range.
00:25:31 [ML]
Yeah, and we do have for the gamma function. We do have system math dot fact now.
00:25:36 [AB]
Right, so so they so they have some kind of extra utility, whereas another language might have it built in and in q I don't even know how you would do that or if there's a library for that. Another one actually that would be interesting to mention here, because now we only said these languages that the four of us represent, but there are the array languages out there and other APL's out there than that, like APL, Nars 2000. It has some limitations, and it's not very focused on performance.
00:26:13 [ML]
Yeah, I think you're gonna run into trouble with the performance there. If you want to do machine learning type stuff.
00:26:18 [AB]
Yes, but now we're discussing a little bit more generally, math abilities, and for that it it probably matches or even exceeds J in built in vocabulary and mathy stuff, including primes and number theory, and a whole lot of combinatorial stuff that it has built in and also the extended precision and rationals. And so on. Octonions and there are other possibilities as well.
00:26:47 [BT]
If we move away from the math for a second, one of the distinguishing things is that Dyalog is proprietary, so it's not open sourced. [10] Which does make a difference to some people, both ways actually. Some people are much more comfortable with something that's proprietary that they know they can rely on. [That], you know versions aren't going to swap too much. And other people want to go open source because they don't want a proprietary program that they're running from, so that is a distinguishing aspect between Dyalog APL, BQN and J. I think BQN is open source, is it not?
00:27:24 [ML]
Yeah, CBQN is GPL V3.
00:27:24 [BT]
Yeah, but q is closed source.
00:27:28 [BT]
And q is closed source, yeah.
00:27:30 [ST]
Yeah, one of the distinguishing features about q is that there is work for q programmers, I mean, lots of it [ST and BT chuckle]. I was surprised it wasn't on his list of criteria.
00:27:43 [AB]
Well, if this is recreational, then maybe that doesn't matter so much, but they do want community support, right and they want an active community, which it doesn't necessarily translate 1-to-1 with work available. Just because some companies use something for profit does not mean that there is a strong helping community for it where you can just go and ask questions and get answers.
00:28:07 [ST]
Yeah, one of his criteria says: "my language should be production ready". That is: "people use this to solve real problems out in the world, in industry". So I'm kind of reading that as: "I want to be able to use this in the future in places where people write code".
00:28:27 [AB]
I'm not sure that it means everybody will be using this. As much as, you know, it is not a hobbyist implementation of something. As I mentioned, NARS2000 is kind of a hobby. It's a long running hobby [chuckles] project, but nobody as far as I know, uses NARS2000 for anything industrial (or production) anything. It's only for playing around with APL. Same thing goes for lots of other APL implementations. I'm sure nobody uses them, but some new [implementation], April, [11] is used for real (physical) product that's being sold. Then an interesting one is: what's the state of BQN? Does anybody use that? You wouldn't even know, right if [they did]?
00:29:16 [ML]
Yeah, exactly. Nobody that I know of, is using it as a product or anything. I've heard some people say they've used it for their work. I assume that means it is to compute some quick things that are relevant to their work or something like that. Yeah, I think BQN is probably behind on stuff like, the library sort of stuff. You know interfacing with different data formats and things like that you would want, so that would be why I would not recommend it here.
00:29:51 [CH]
Interesting thinking about, yeah, what it is, because you know we all have our biases of what our personal favorite languages are of course. But when someone lists out this criteria, I find it hard actually to [sentence left incomplete]. Coz, my criteria, a lot of the times when I'm ranking my languages, [I'm] like: "which language has the best combinator support?". And BQN wins pretty handily there. But it also comes down to like ..., I think I mentioned this earlier in the episode [sentence left incomplete]. And this can sort of segue into us talking more about production code versus recreational coding, leet code and Advent of Code (AoC). When I solve AoC or leet code problems, more specifically leet code, it's like: if there's ever a thing within that problem that I need that only exists in one of the languages, I just immediately go and switch to that language. So for instance, I mentioned primes, I think, earlier. Whenever there's primes involved I'm probably just gonna go to J. Like technically I can go to APL and go and open up the dfns library, and there's a "pco." and that has basically the replicated functionality that J has. But J has it just with "p:" and you put a number on the left and ... [sentence left incomplete].
00:30:59 [ML]
Yeah, but then you have to look up the number.
00:31:02 [CH]
I have those memorized. [But] I mean, honestly, you don't really because I just like, type through them [others chuckle]. You know the first one, I know, just gives you the first N primes. The second one is a bitmask, given an iota sequence. And after that it's just: you just type them and then you see [chuckles]. And then you'll get a domain error if you don't know. I mean you could go read the docs, but usually it's one of the first two. Anyways, the point being is, like primes, I go to J. If I need to sort something in my problem I go to BQN. [12] I know Adám, you've got your 3 character or 4 character reduced version of the five character . But, BQN has it in one character and (especially if you need to put that sort in a tacit expression, you know, after or before of something), that is very nice. That I don't have to parenthesize the train of stuff. What's an example of APL? Like they have "without" [the function] which doesn't exist in BQN (I think it does exist in J). But they [APL] also have decode and encode, which I don't think BQN has. And these don't make any of the languages like better than [any other]. It's not like BQN has a sort primitive [and so] it's therefore obviously better than the other array languages. It's just that usually when I'm solving these leet problems, I'm trying to get the shortest, quickest thing. And if I know that this language has something that might take 5 or 6 characters in another language, that's the language I'm going to go [with]. And I have all three of them on my computer, and even if you don't, you can very quickly go and you know go to TryAPL or BQNPAD. Anyways, I'm not sure if folks have [sentence left incomplete]. Because when I read this list, in my head, I'm just like: "oh well, they've got these primitive differences, but Alex clearly is not ... it is not what he's concerned with here". He's concerned with documentation, ability to learn the language, community support, which it's a lot harder to judge. You know, like Bob said, a lot of these languages I think, have (if you find the right place to go [to]) good community support and good docs. Stephen, you were gonna say something.
00:32:58 [ST]
I'm really fascinated by what you're just saying: that you'll switch languages to save characters.
00:33:04 [CH]
Oh yeah. I mean especially if it's a leet code thing. Which in a array language, is typically going to be a one-liner thing. I've had this conversation with colleagues: is that the verbosity of spelling something, like, affects the way you might solve a problem. Like the way I might solve something in BQN versus APL might be different due to the fact that BQN doesn't have "without" [the function] which you can spell with I think, 3 or 4 [characters].
00:33:34 [ML]
Yeah, and this is because I think solving problems with "without" instead of with membership and filtering is actually not a good pattern. So that's very intentional.
00:33:44 [CH]
And like I said, it's not to say one is worse. And so maybe that even speaks to why I'll reach for something that Marshall thinks is a bad pattern in APL, but I'll use it because it's convenient. It's 1 character with your numbers on either side of them. Whereas in BQN I'll have to spell with more characters, but maybe that forces me to actually a better pattern and more performant code for some reason. But the point being is that, I definitely think the tax to spell something in a language, if you have multiple options and performance is not huge [a huge concern], (it's gonna be running in a fraction of a second, so I don't really need to worry about this going super fast) the tax of the number of characters of some function does affect the way that I'm going to solve a problem, if all I care about is how quickly I can solve this, and how short the expression is at the end of the day.
00:34:35 [AB]
Connor, maybe you should look into learning Jelly! [13]
00:34:40 [CH]
No. I saw, I mean [chuckles and sentence left incomplete]. We'll link [to] it in the show notes.
00:34:43 [AB]
It's unreadable, is that what you're telling me? It uses Unicode characters.
00:34:46 [CH]
It's not as pretty. It's not as pretty.
00:34:48 [ST]
That's kind of the point that hooked my interest. It seems to me that it's aesthetics driving you on this.
00:34:56 [CH]
Oh yeah, yeah, I mean here's an anecdotal thing: I actually planned to do Advent of Code in Rust this year because I'm learning Rust. [14] It's a very nice language; quickly climbing through the ranks of my favorite languages and I got to the first problem and it was summing up a nested list of numbers and taking the maximum of the sums. And I was like: I can't. I'm not going to. [others chuckle] I can't do it. Like I'm going to APL. Like I'm not going to solve this in a language ... [sentence left incomplete]. Because I know how to spell that in every language. It's your: mapping sum over that, and then doing a maximum. But it's four [or] five characters in APL, or choose your language like five or six. It's like I can't, you know. If I'm working in a code base at C++, or sure, I'll go write it. But if I'm just doing this for fun and the whole goal of Advent of Code is to do it quickly, you know, just hack out a solution. It's like, how can you beat: max reduce, plus reduce, each ([each] which is a single Unicode character)? It's 5 characters and it's anyone that is even starting out to learn these languages is going to see that immediately, and it's going, maybe not [to] hurt their soul. But it hurts my soul to have to go like: maximum, maximum dot maps on ... anyways.
00:36:07 [CH]
I meant to do it in a different language. And then I was like: I can't. I'll just do it in APL or BQN or ... (switch through the array languages as I go through it).
00:36:16 [BT]
I'm beginning to see your bias against J [chuckles] because we start with diagraphs, and so we've immediately got extra characters no matter what we do. We can't win! [all laugh]
00:36:31 [AB]
You start with a penalty.
00:36:33 [ML]
Now there are plenty of 1 character primitives. You just have to choose which ones are going to be 1 character.
00:36:37 [CH]
Yeah I will say, the "less than dot" and "greater than dot" for max and min. [15] It does hurt my soul a little bit because they're very simple expressions, like if you wanna do a min-max fork, that's three characters in BQN and APL. And it's five in J, because you've got those dots there. I mean potentially, the listener is hearing this and being like: "is this guy crazy?" I'm being serious. It's an additional 67% of your solution grew by almost twice the amount.
00:37:06 [AB]
Connor, do you know why the prime function in the dfns workspace is called PCO?
00:37:13 [CH]
I know Roger Hui wrote it. And I think I read the doc at the top, but I don't know that it mentioned why it was called PCO.
00:37:19 [AB]
I don't think it mentioned it. If you look in the J documentation for the prime function, which is "p:", then it's abbreviated in the URL as "pco" [Connor laughs]. "P colon ... PCO".
00:37:33 [CH]
I did not know that. I did not know that. So yeah, we should continue. I mean, I've been talking about Advent of Code and my clear, absolute desire to have things as short as possible. Is this a bad thing, you know, recreational coding? Coz I think there's a ton of folks that sort of use array languages for this. Does it give array languages a, you know, ... [sentence left incomplete]. Marshall, you go ahead.
00:38:01 [ML]
I don't think it's a bad thing, but I think in combination with the fact that code golf challenges have some very idiosyncratic things they focus on, it really skews your perception. Because one thing that's very common in code golf is like splitting numbers into their digits. When, if you're writing a some real application, do you ever need to split a number into 2 digits? You don't. You need to format it for output to the user, but it's very unusual to care about the base 10 digits of a number. It's something that people write because it makes fun code golf challenges [16] because you can see, say, this number is the same when it's digit are reversed. That's a cool property of a number that you see when you look at it, but it's not really an important aspect of the number mathematically speaking. So, yeah, this is one reason why a lot of people say: "oh well, BQN should have, you know, base conversion functions". And I don't think that's really right. What we just added actually is a parse float function, which I mean that should work pretty well and we have a format function that formats it the same way that the BQN session would format it. And then we might add other number printing stuff, but I think that's what you want, practically speaking, but APL gets a leg up in all these could go problems that are about reversing digits and stuff by having base encoding and decoding functions.
00:39:39 [CH]
I mean, and you can even do it the shorter way (I, for the longest time would always do the decoder-encoder one); you can do the eval-each-format .
00:39:49 [ML]
Oh yeah, that's just awful.
00:39:50 [CH]
Which is like super ... [sentence left incomplete]. So like basically (to read it in English), you turn your number into a string and then call the eval function that does the opposite of that (it turns your strings into numbers). But just do it on each of the characters in your string, which I think perf-wise is terrible, but it does save you like 3 or 4 characters so [laughs]
00:40:10 [ML]
Yeah, well and in BQN you don't have to eval: you can at least subtract 0 but then that takes more characters because you have to ... [sentence left incomplete].
00:40:16 [CH]
Yes, I've seen that in the BQN examples.
00:40:18 [ML]
You have to write two single quotes to write the character 0.
00:40:22 [CH]
Adám, you're gonna say something.
00:40:24 [AB]
(For the listener), Stephen just made like [an] exemplary facepalm when you're [saying] it. That's how you do a facepalm. Yeah? I mean if you're in quad-IO-0 [meaning the index origin is zero], you can also index into quad-D which is a vector of the digits. It's about as short.
00:40:44 [CH]
That's another thing that I love about APLs. Speaking of when I reach for each language: if I need the alphabet, like if I need the characters, you've got quad-A for that. [17] You've also got quad-C for uppercase [and] lowercase. And the equivalents (I'm not sure about J actually), I know that BQN currently doesn't have [it]. Like, you have to do [an]: iota 26, plus the character A, which is still actually quite nice.
00:41:07 [ML]
Which is, I mean the point is that's much more understandable, and you can do that for the Russian alphabet too, or whatever other alphabet.
00:41:17 [CH]
So I'm not ever solving leet code in Russian though. So it's all good [laughs]
00:41:23 [ML]
It Russian leet code is really hard, I bet.
00:41:24 [CH]
[laughs] It is an interesting point though. I think your comment Marshall was less that, there's a problem with trying to solve things you know succinctly or tersely in an array language, but more that a lot of the code golfing problems or leet code problems that come out of these contests aren't representative of the stuff that you're doing on a day-to-day basis when you're writing [code]. And maybe, is that a comment on Advent of Code because that's one of the things that irritates me the most and I never make it past problem 10. Is it's mostly parsing. At least that's my experience.
00:41:58 [ML]
Well, that's less over time.
00:42:01 [CH]
You mean towards the problems at the end of day 25?
00:42:03 [ML]
As a total fraction of the work you're doing, the parsing gets pretty small near the end.
00:42:08 [CH]
Right, right. Because the problems are more involved. But yeah, do other folks have thoughts on that? And that's less a criticism, I guess, of solving these kinds of challenges in array languages, and more, just the challenges themselves. That they do things that are unrealistic. We'll go to Adám and then Bob.
00:42:25 [AB]
I don't think you are wrong in going for the right tool for the job, and I'd like to bring something up. I mentioned quad-D. You said quad-A for the alphabet. Why are these in there? Definitely not because Dyalog APL is trying to be a code golf language. Nobody has that kind of thing in mind. In fact, Roger Hui would (and the other people also would) protest whenever they would see some suggested feature [or] enhancement saying: "that's just for code golf; no way!" But [it is] trying to make a language that makes it convenient to do certain things. I think that Dyalog actually has less focused on that than certain other APL vendors. So MicroAPL (with their APLX), and APL2000 (with their APL+) [18] will have these system variables that contain things that you might often need in a business application. So you think that quad-D and quad-A is a lot? APLX has also quad-a (quad lowercase a)
00:43:32 [CH]
What!?
00:43:23 [AB]
Which is unusual, yeah.
00:43:34
Since when!?
00:43:36 [AB]
I mean [chuckles] APLX is obsolete. It doesn't get maintained anymore.
00:43:41 [CH]
Oh wait, wait this. This isn't Dyalog APL. This is APLX.
00:43:43 [AB]
Not Dyalog APL.
00:43:44 [CH]
Sorry I missed that part. I got very excited because that's 50% of the characters of quad-C [and] quad-A [all laugh].
00:43:51 [AB]
Yeah, the problem is that system names are case insensitive, so it's an exception to have the difference there in uppercase and lowercase. But it even has things like quad-B for backspace; quad-W for weekday names and quad-M for month names. Now you can actually get those in Dyalog APL fairly easily, but not as easy as that. So, why did they do this? It's because you have some business person who's not really a programmer but is able to (because of these array languages and their ease of expressing certain things), write their own application and they shouldn't be bothered with trying to construct in some fancy way these constants. They need them all the time, right? They need the weekday names and they need the names of the ... [sentence left incomplete].
00:44:43 [ML]
Well, I mean my contention would be you need the weekday names once per program and you assign them to a variable somewhere, in whatever program organization you have.
00:44:55 [AB]
Sure, and true. But it sure is convenient to just say quad-W (that's the weekday names). Done. right?
00:45:02 [ML]
Yeah, well and more so in code golf where once per program could mean half of the program [Adám laughs and agrees].
00:45:09 [CH]
Before we get to Bob and what he was going to mention, I just remember when you were talking about dates ([and] this actually dates back before I even discovered array languages) is that whenever leet code would have a problem that had something to do with dates like, you know: "figure out, given a month and a year blah blah blah, which day of the week is it?" That's not, you know, incredibly difficult, but it's tedious. You know, dealing with leap years and blah blah blah. And so I would always solve most of those problems back at that time in C++, but I would switch to Java for that because they had in their standard library a date module that you could just literally go pass in the info and then print out, you know, ".day" or name of ... [sentence left incomplete]. And you're done! And it's like a one liner. And it's like, I didn't know Java. I know enough Java because it's similar to C in many ways. Different (I'm probably upset a bunch of listeners), but you know, the syntax is roughly in the same ballpark. And yeah, once again, I would switch from my main language to an entirely one that I don't even know that well and just Google "Dates in Java", and then it becomes a one-liner. I think there is something to be said for adding convenience. Sorry we'll go to Adám and then [sentence left incomplete].
00:46:18 [AB]
Ohhh now I have to promote Dyalog APL because we added quad-DT [19] and they can convert between any date-time format known to mankind.
00:46:29 [CH]
So we just need Dyalog APL on leet code and then I can actually uh ... [chuckles; sentence left incomplete].
00:46:32 [AB]
But no, I think ... anyway, [to] throw in one more thing: something that might seem trivial like the alphabet, I think it even that kind of thing could have the value (and of course doing it the BQN way is fine as well). But what people often resort to if you don't have that is typing out the alphabet, which on the QWERTY or any other non-alphabet order keyboard is kind of awkward to do and that risks issues. So I just went on GitHub Code Search right now. I went into APL; typed quad-A; copied the alphabet; went into GitHub code search; pasted it in; removed [the character] "W"; and searched for it. And found four and a half thousand files on GitHub that includes the alphabet without W
00:47:17 [CH]
Damn
00:47:18 [AB]
Now, some of that might be intentional because some languages don't use "W", whatever. But I'm thinking there are some problems there. There might be some bugs. Why would you want core utils without W in the ... [sentence left incomplete].
00:47:33 [CH]
A strong case for every array language to get quad-A. A you heard it here. Alright Bob, you've been waiting in the wings.
00:47:41 [BT]
And just to bring it back around to J. J has "a dot" which is, I think similar to BQN, and it's got a full list of all the characters, and then you just index into them for what you need.
00:47:50 [ML]
Your characters only go to 256!
00:47:53 [AB]
Yes, "A dot" is different. That's the extended ASCII character set in J, which fittingly for J, which only uses ASCII.
00:48:02 [BT]
Right, so that wasn't my point though. My point was back to code golf: I think the negative part of code golf for the array languages is they get perceived as only being good for code golf, which obviously isn't true. But the other thing I think that's even sort of more nasty is: if you write a lot of code golf, you're not writing, actually, necessarily a very good array language. You're bending it to fit code golf. It usually isn't performant; sometimes it is. It's a bit of a toss up whether it'll be performant or not, but [it] doesn't usually use idioms that would be really useful if you were trying to actually use the language productively, so it actually sort of warps you into this array language mode where, it's almost like doing circus tricks. Great, you know that's wonderful [laughs]. But I'm not sure there's much call for it and we need to move something off the loading docks.
00:49:03 [ML]
So one thing that I sometimes see in BQN (I think I noticed it happening a fair amount and I'm happy when I see it) is when the shortest solution in APL is some awful thing that includes like execute and random stuff, but then the shortest one in BQN is actually nice code.
00:49:19 [CH]
Yeah, nice, meaning performant here. We should define what the word nice means when you use it.
00:49:23 [AB]
But three times as long.
00:49:25 [ML]
Well, nice being covers edge cases, performs better, uses a more array style. So I mean, I'm not saying it always happens.
00:49:36 [AB]
And takes three times as many characters.
00:49:38 [ML]
No, usually like 50% more or something. But yeah, I mean, if BQN can lose at code golf by writing better code, that's a win in life, right? It's much better actually so [everyone laughs].
00:49:53 [CH]
Depends what you're living for, Marshall. I live for the character count! [everyone laughs] Stephen?
00:50:02 [BT]
You scared Stephen off! [everyone laughs]
00:50:06 [AB]
I mean, q is so much more verbose than any other array language that uses symbols. Code golf isn't in everything, though. Sometimes you want to be quick to solution, and it might be faster [to] type. So the shortest solution in an array language, you will have it using Jelly. We haven't touched upon Jelly. We should maybe have somebody come in and speak about it.
00:50:32 [CH]
Maybe I should give Jelly a shot. You know, I haven't been giving it ... [sentence left incomplete].
00:50:34 [AB]
Yeah Jelly is an amazing language. And me, as an APLer, sometimes when (I've occasionally written very little in Jelly, but you never need more to actually do anything) I see something explained (I can read a little bit of it) and then I get envious because like: "why do I have to program in this programming language where everything is so tedious and I need to like spell out everything when it's right on your finger tips in Jelly". Except it's not on your finger tips, because while technically speaking you can type Jelly using the US international keyboard, it requires you to put dots over and under letters and ... [sentence left incomplete].
00:51:14 [CH]
Does it still have like the ... yeah it does. It has this unpronounceable expression for "hello world" but like ... [sentence left incomplete].
00:51:26 [AB]
Oh, that's different.
00:51:27 [ML]
Yeah, the dictionary compression.
00:51:29 [AB]
You don't have to do that. You can just type the string.
00:51:32 [CH]
Yeah, like that's the thing. That's the first piece of code though, on the README. It's like that is ... you gotta change that, because as soon as I read that I'm like: what? Like that isn't actually Jelly code. That's like a hack of converting it to something that then is still executable, but that's not actually like the way people are gonna write Jelly code.
00:51:54 [ML]
Yeah, it's intended for code golf, and that's less characters [everyone laughs].
00:52:00 [AB]
Yes, if it's for code golf, yes. But I certainly know of people who are well versed in Jelly through code golf, who then use it for their daily needs as well. [When] they need something computed, then why type more code when you can type less. And then obviously they wouldn't bother compressing all their strings. There's no point, right? But if you just want to get something done really quickly, then yeah, Jelly probably has a built in for it. And if not, you can write tacit code to solve it, because Jelly only does tacit code.
00:52:32 [CH]
Alright, this is a pledge to listeners: I will go and learn Jelly to the extent that I've, you know, learned the other array languages and I'll report back.
00:52:42 [AB]
There's some program called jelly-hypertraining that we can link to. [20]
00:52:46 [CH]
So BQN tries to force you in the quote-unquote, "better direction". APL has a different definition of better, and they do the same thing [laughs]
00:53:01 [AB]
No, I don't think so. I don't think anybody tries to do that. It bothers me sometimes that it's shorter to write in APL: "function each split". So split takes, say a matrix and makes it into a vector of vectors. And it's shorter to write that than to write "function rank one" and then fighting with the stranding ... [sentence left incomplete]
00:53:28 [CH]
Precedence, yeah.
00:53:29 [AB]
So I don't think APL tries to make you write better code by making certain constructs awkward in any way, and it's perfectly possible to write bad code in APL, and I'm pretty sure you can write bad code in any of these array languages.
00:53:47 [ML]
Well, I'm framing here. Like, I've never intentionally made something awkward in BQ.
00:53:52 [ML]
What I do is for example like for matrix Division, I have no matrix division primitive.
00:53:58 [ML]
If you think I should have a matrix division.
00:54:00 [ML]
Primitive, the reason you think that is because APL has one.
00:54:02 [ML]
It's not because you, you know, considered all the things that you might want to do with the.
00:54:08 [ML]
With arrays and said OH, matrix division is a vitally important aspect in every program.
00:54:14 [ML]
Should use matrix division, because like they're probably, you know, ten programs in the entire world and use matrix division alright, not that few, but.
00:54:24 [ML]
So I mean what I do is I don't provide things that are convenient, but that don't.
00:54:31 [ML]
But that don't actually fit into array programming, so some features that I think.
00:54:39 [ML]
That that indicates to me that a function is really a convenient function, or when it first if it, if it makes a lot of decisions for the user.
00:54:48 [ML]
So like matrix divisions decides inherently, you know what precision it's going to have versus what performance property is going to have as the user.
00:54:57 [ML]
In a lot of cases you would like to be in control, but for convenience having to make the choice for you is nice.
00:55:04 [ML]
I think that's not the way primitives should work.
00:55:09 [ML]
Also, if
00:55:12 [ML]
I think primitives should be things that you actually use often, like many times in a program, and so something like APL.
00:55:18 [ML]
Partitioning is not actually used like a program that uses partitioning a lot of times we'd use it like four or five times to to maybe parse its input or something.
00:55:31 [ML]
Versus a program that uses like reverse a lot of times could have it. You know 20-30 a 100.
00:55:40 [ML]
And reverse is not even particularly common primitive.
00:55:45 [ML]
Versus like something like candidate which is.
00:55:47 [ML]
You know, if you ever write a.
00:55:49 [ML]
Program without 4.
00:55:50 [ML]
Copies of candidate.
00:55:51 [ML]
That's what are you even doing?
00:55:54 [AB]
A lot of programs don't use square root.
00:55:57 [ML]
Yeah, so that the main reason to include square root is not actually because I think it's a great primitive, but because I think it's an OK primitive and the symbol is well known so... But in terms of other stuff like, yeah, like the matrix multiplication primitive like base and encode. I think they are just ...they pack too much in which is convenient, but I don't think that really fits into the model of array programming that makes it work well.
00:56:25 [BT]
Language design is a real challenge, like if there's just no way around it when you're deciding what goes in and what goes out and in the end you're ... When you're creating a language which in the end the old "notation as a tool of thought" creates the the output that programmers can easily do with it. So I kind of agree with Marshall. It's not so much about making something difficult to do, but quite often you can shape people's behavior by what's easy to do and if you make something easy to do, they're more likely to do it.
00:56:58 [ML]
Yeah, and so I think the things that should be easy to do are not just like the the conveniences or whatever, but they should be things that are that are fundamentally like good ways to think about problems. Like thinking in terms of plus-scan, [21] I think that's a lot of the time, a great way to think about problems. It's connected to a lot of other primitives. It opens up, you know, new possibilities if you really understand, plus-scan well, I'm thinking in terms of matrix division. Well, I mean, it's a fundamental operation in linear algebra, but in other fields it's not going to get you anywhere so...
00:57:33 [AB]
Well, there are some actually some problems where some optimization problems that you might not immediately connect with in algebra but are actually solvable using matrix division. I'm not defending here. The Matrix Division is an APL, though it has been for a very long time. I am just saying that sometimes having these tools available makes you realize that you can. When you look through what are my what's in your toolbox, what I use. I can use something that I might not immediately have associated with my problem domain and use it in new novel ways and and the generalization of things can help with that. So many programming languages will have matrix multiplication, which is in APL is known as plus dot times and in J is plus slash space dot times. But then this generalization of separating out the summation and the multiplication so that you can slot in other functions made people realize that they can. This construct, actually this pattern comes up in other domains and they can use it in all kinds of fanciful ways. Speaking of competitive and and recreational programming, it used to be at in. I think there's some APL newsletters used to have some inner product with some 2 operands. And then challenging people to send in what can you use this construct for? Like this derived function for? And some of them are well known and or-dot-and, and-dot-equal. And some of them are more obscure. So I don't think you can just say what are the things that will be commonly used by supplying you with something. That you might not commonly use by thinking of it immediately you can expand your mind, apply things in new novel ways you might not otherwise do.
00:59:30 [ML]
But at the same time, if you're using an inner product many times in a program, what does that mean? It's more used than partition maybe, but you're seeing you know 10 times in the program. Or something. It's very memorable when you use it, but it's not actually used often.
00:59:47 [ST]
This brings us on to a use case for the advent of code competition. I wasn't sure whether I'd talk about today because I don't think it applies to the other array languages. Little bit of a story to this. There are a lot more q programmers than there are K programmers and q of course is a domain specific language for time series embedded in the K programming language. When the K programming language appeared, or this is my story about it anyway. People with a background in APL and J and LISP jumped on it and said this is wonderful. This is just the language we need. It just just the things we need. But the people who were coming to use it from a a completely unrelated background found it very strange. And q was developed to let them get the use of KDB with a much shorter learning curve. So if you rock up for an introduction to the q programming language, you're going to be shown some fairly simple stuff. It's very impressive how quickly you can get into productive use. But a lot of the thinking that's inherited from APL and J and LISP. You kind of won't encounter. You're able to get to work using, for example SQL like query stuff without engaging with those concepts from the array languages. And this led to a thing people would look at the kind of terse solutions for written by people who come from a APL and k and J background. And say "how do you think that stuff? Where does that come from?" And as I think I've spoken on the podcast about before they... This led to the the veterans getting dubbed the the q gods. As if it was some kind of divine thing. And of course our biggest textbook has been got dubbed "q for mortals". [23] So I did a code. q being a proprietary language, a great deal of its user base being very secretive trading rooms. There's not been a lot of expert q exposed to the world and "advent of code" [22] draws some of these veterans out of the woodwork, and they start publishing q solutions to to the problems. And I've been at work over the last month, scurfing these solutions up some of them from private forums and collating them in the hope of explaining them to the world. Or generate to that part of the world that's interested, because these solutions do show off some very very smart people thinking through in an array language paradigm and how to use q in that way. And on a good day when I'm smart enough and I can stumble through those solutions, I can break that down for a novice q programer. Been doing that on our community repo on GitHub cubists slash studyq up to as of about lunchtime today. I'm up to day 15. And I'm hoping to be able to do the remaining 1010 puzzles. So that's for me I think it's a very important use case for "Advent of code". The the puzzles are relatively relatively small and the well understood. And and it's a rare opportunity to see expert q programmers at work on them.
01:04:07 [CH]
And I think, yeah. There's... We should compile a list, not just of the q ones, cause I know Marshall you were updating... And I did see right before I joined the, recording for this is that you have a now graph version of all the folks that have been solving BQN. [24] I guess we should qualify this as I am on this list and I am not a BQN expert, so there's... I'm sure this is just an amalgamation of folks out in the wild, so there's going to be varying levels of expertise.
01:04:40 [ML]
But I mean one thing, it does show is that. A large number of people have decided, well, I don't know anything about array languages, but I'm going to try "Advent of code and BQN this year". And many, many of them have found some success with that. I mean very few people have solved all of the problems in BQN. But most people, are thinking even you know how can I trim this list and maybe I'll cut off the people who've only done one day in BQN and but there's like 4 of those people. So almost everybody chose to then having solved their first day, do another day in BQN and and so on. Of course I don't have any information about the people who just... Who tried and found it too hard and and just dropped it. But yeah, it does seem that in a very short amount of time you can learn enough of BQN to solve some not trivial problems.
01:05:37 [CH]
Yeah, it's a good point that Stephen makes is that you know we've been talking about. Quote UN quote recreational programming leetcode, advent of code, code golfing is this, you know, is a good thing, bad thing. You know, and Stephen's point being that it's a great opportunity for people that are interested in the language and looking to learn. To be able to, especially at the start of advent of code and most leetcode problems, at least the first couple are quite simple. They're digestible chunks that aren't going to take, you know, a screen full of... I mean, it's very rare that there's a screen full of array language code. But a lot of these, you know day one is gonna be, you know, what is that? Probably 3 primitives in q and similar to the other array languages, so whether it's q, j, APL, BQN. You know these are, at least for me, like I love watching little 5 minute YouTube videos of people walking you through this. Because you can very quickly and... I think I was thinking this when I can't remember if it was when Stephen was talking or something that... I kind of joke about the character count but, like, potentially like I should stop joking about it because it's not really that... It's so few characters, that it is the ability to very succinctly, express exactly what you want to do, and if I can do that in a language like Haskell that also spells out the primitives, that's just as beautiful for me, because it's just it's ... It's removing the details that are unnecessary. Like when I'm writing things in C++ and in order to write a small unary function in the form of a lambda, there's so much noise that comes with it, like literally every single type of brace and parentheses: the square ones, the curly ones, the round ones. I'm not joking. Every single one. You can even get, add template parameters now as ever since C++20 and put the angle chevron ones in there. Like there's a T-shirt joke that was given out at a conference that has left bracket, right bracket, left angle, right angle, left paren, right paren, brace brace semi colon and that was like valid C++. Like it's and actually there's an extra set of left right parentheses because you can immediately invoke that previous balance C++ code. Like it's just. Like it's it's. You know it's not nonsense, it's the language we write in, but. You compare that to any of the languages that we sort of talk about on on this podcast, and it's just so it's just the essence of what you want to say. There's nothing extra.
01:08:11 [BT]
Now, if you had unbalanced parentheses, you'd have, you could do stuff in J.
01:08:16 [CH]
If I had what?
01:08:18 [ML]
Not actually parens.
01:08:21 [AB]
To make a polyglot.
01:08:23 [BT]
Yeah it would be. Brackets actually embraces we we unbalance those. We don't have to match them.
01:08:27 [CH]
Yeah, but. Ohhh right cause of take and drop.
01:08:31 [BT]
Parentheses do balance yeah.
01:08:34 [CH]
So I do get you. Know it's a joke about.
01:08:36 [AB]
The no, they don't love. Not if you're defining stuff.
01:08:39 [BT]
Oh yeah, you're right. Yeah, under the old. Yeah, yeah. For sure. There's single right paren, yeah?
01:08:46 [CH]
And Adam has. Oh yeah, posted a link to something we'll put in the show notes that is not utterable on our family friendly podcast [25] that is generates some JavaScript code which is somewhat similar to the C++ code that I mentioned but... Yeah, and do we have lists so? We've got q repository curated by yours truly, Stephen with actual, you know, hands. Are you showing multiple solutions or is it one solution that are taken from different folks that are posting these online?
01:09:23 [ST]
I've done a bit of both. Actually, I've scurffed up and put in the scripts, at least commented out all the solutions I've found. And you can see where I found them and who the authors were.
01:09:36 [AB]
Oh nice.
01:09:38 [ST]
Some of these, some of these scripts are just like going for the solution as fast as possible. So you can, and you know, type it in an advent of code and get your get your Gold Star. I've been going through them trying to work out the best way to bring out the concepts involved and show a q like approach. So I've also posted articles discussing them and there's a single page which I just put upon our chat. Which has kind of like the the exhibition versions of the solutions. [26]
01:10:13 [CH]
And does J, and APL, do we have similar things we can point folks that are interested in collections of these? Or they're just out in a wild?
01:10:22 [BT]
Out in the wild mostly, I guess. Raul Miller has been doing a whole bunch of stuff with Advent of code this year and has done it in past years. And I think he's going to make it available on the wiki and I think we'll attach it to that. Because there's some advent of code solutions and stuff in the wiki. They're not so much curated. I don't think so. In other words, I think what Stephen is doing is a much bigger service and that he's sort of interpreting and explaining them. I don't think that's necessarily true, but I think if you're looking for Advent of code, either searching the forums in J or searching in the wiki. You'll find some and you'll be able to read code that solves the problem.
01:11:03 [AB]
That we have in the APL wiki the collection of advent of code. We mentioned this before.
01:11:08 [CH]
Yeah, that's right. We mentioned that a couple episodes ago, yeah, so we'll yeah, we'll once again link all those. And yeah, I'm not sure if we're definitely once again past, you know the podcast that rarely ever meets the 60 minute mark that we aim for. I'm not sure if we want to circle back to sort of Alex's question. If there's anything we want to... after having talked about.
01:11:34 [ML]
Are we still in announcements technically :).
01:11:41 [CH]
I feel like based on the criteria that Alex has given, you're not really gonna go wrong with any of the languages. Except I guess Marshall said that he wouldn't recommend BQN because of the the nascency. Is that a word nascency? But for all the other ones I think you know there's communities that exist for all of them.
01:12:03 [BT]
I found it interesting. He's sort of. It seems to me he's leaning towards machine learning because that's what he's doing professionally right now. And I was kind of thinking about whether any of these. I mean, a lot of people talk about these languages being perfectly. We you know positioned to be able to take advantage of machine learning and AI and stuff and it, it just doesn't seem to me that that's taken off in that direction.
01:12:20 [ML]
Yeah, I don't buy.
01:12:25 [BT]
Not saying it couldn't, but I haven't seen people exploiting that so much.
01:12:29 [CH]
There is a paper called convolutional neural networks in APL [27] that was published at the Array 20. I think it was a few a few years ago at this point. But we'll link it in the show notes. So there there has been some research and academic writings on the topic of it, but, and I think also. Doesn't Rodrigo have a video series of building up a neural network in APL and running it on some OCR database or something like that?
01:13:03 [CH]
I do recall seeing a. Video that he has.
01:13:05 [AB]
Yeah, yes, there's there's bunch more, there's an APL dot wiki slash NN will take you to stuff with neural networks, including Rodrigo's. So there's all collection there. One thing I'd like to comment on in from the e-mail, he said that he was going to. He was planning on going through Ray Polivka's new book. And obviously Ray Polivka is an authority when it comes to teaching APL, [28] as he's been doing that for about twice as long as any of us has lived. And, but his new book is very raw. It is a draft in big red bold letters and I'm not, and it's not even the target. He's not even in the target audience. He's a professional and this isn't a book for beginners to even programming to intended for youngsters. So I'm not sure that's really the best resource to use for now.
01:14:06 [CH]
So maybe what we should also do is I'm not sure if we want to curate a list of these, but we... Stephen mentioned "Fun Q". Do we want to mention a book or two books for each language, if you if you have by the time you finish listening to this, Alex. If you've chosen your language and you want to start with a book. Or even maybe just a website should we go around and we already. I guess got Fun Q from Stephen and "q from mortals" was talked about. I'm sure you've listened to the the episode with Nick a couple episodes back.
01:14:34 [AB]
Well, I would process this a little bit on that, because depends who you?
01:14:38 [CH]
Alright, we're not gonna do what I just said.
01:14:41 [AB]
Depends who you are and what you're looking for. There can't be one sort of learning materials, that's the right for everybody.
01:14:47 [CH]
But this is for Alex. We're not talking about. For folks, we're so we're talking, OK.
01:14:50 [AB]
I'm specific about for.
01:14:51 [CH]
Is we're speaking to you directly, Alex? Now if we weren't for the entire episode anyways.
01:14:57 [AB]
That that I'm with you on.
01:14:59 [CH]
All right, go ahead Adam. What is it? What is it for Dyalog APL?
01:15:00 [AB]
I would say Stephen Kruger's book "learning APL" is the right way in. And then once he's comfortable enough with that then you can go on to things specifically about the subjects that he's interested in. Like those neural networks resources.
01:15:20 [CH]
Awesome. We now go to Bob for J.
01:15:23 [BT]
I would lean on Henry Richard's book J for C programmers, even though Alex isn't a C programmer. It's sort of consistent. That type of a programming language that you know most people are familiar with. And it bases it on that and explains a lot of the concepts with the array languages and it's very comprehensive. It covers a lot of different topics and one more thing I'll add for neural networks is if you go to J playground and you go to examples. There is a running example of a neural network. And you can actually see the code and the the results as well. And that's J playground which is online, so you don't even have to download J to do it. You can just flip that on. Go to the example, go to neural networks and run it and run in your browser.
01:16:08 [CH]
Alright, and last but not least. I don't think, to my knowledge, that there is a BQN book yet. Shout out to the listener because you might be listening to this, and unless if I'm going to be corrected by Marshall a second, you could write that book and then be the answer to this question in the future. But Marshall where would you send the...?
01:16:26 [ML]
Yeah, well, I. I mean I don't know why everybody's talking about. There's no one right resource for everyone. I mean in BQN the right resources is the BQN tutorials and documentation. Because that's all we've got, so.
01:16:39 [BT]
And it is very good.
01:16:42 [CH]
It is we talked about that on a previous episode, it's a...
01:16:45 [ML]
The tutorial is cut off in the in somewhere around 2/3 of the way through the 4th tutorial, but other than that...
01:16:51 [CH]
Yeah, I mean I almost always go to BQN when I'm switching between... because I think I mentioned this like five times before. They have dictionaries, multidirectional dictionaries with J and APL and BQN. And so a lot of the times I'll just go there. But even if I'm not trying to do something in BQN, sometimes I'm going from APL to J and I will go through BQN as an IR in order to figure out what I'm trying to do. Probably not the best way to do it but those docs are so great that they are useful for that. All right, anything we've got tons of recommendations in this episode. Adam's got his hand up.
01:17:30 [AB]
Well, so I'd like to make it a little bit more general. Also then that the API wiki has this page called Learning Resources where things are exactly classified into what kind of person are you. And then some resources that might fit you for that and the k wiki also has a page of learning resources. It's not really classified as much. Well, it's not classified who you are, but it has a list of that. And so on. J wiki I think has a list of learning resources somewhere that we can link to. [29]
01:18:04 [BT]
Yep, we have newcomers.
01:18:05 [AB]
And BQN, there's only one source of learning materials.
01:18:10 [ML]
Yeah, I mean there's a community page that links to a few things that other people have done like their there are Conor's videos and another person some videos.
01:18:18 [CH]
The BQN book it's coming soon. I could tell you. They've got the rust book. The BQN book sounds even better because it's an alliteration.
01:18:24 [AB]
Bacon the best parts.
01:18:27 [ML]
Bacon the crunchy bits.
01:18:32 [CH]
Look at that we got was that 3-4 book titles. The listeners, we gotta start crowdsourcing this before you know it and we just need the content.
01:18:40 [ML]
All we need is the text is the easy part.
01:18:43 [BT]
Now if we can only name a podcast.
01:18:48 [AB]
Working on it, working on it.
01:18:50 [ML]
Oh man, do I put spaces in my book title or not.
01:18:53 [AB]
No, but see APL has a primitive that can remove spaces, so there's that.
01:18:58 [CH]
Oh, that's right without I was like what I thought you meant all in one.
01:19:03 [ML]
Yeah, you have to give it the. Right the space but.
01:19:04 [CH]
Right, yeah so. Dyadic I was thinking that there's a unary function that removes white spaces. I was like.
01:19:12 [ML]
So you're clearly short one because you don't have a primitive, they can add spaces in at the appropriate spots.
01:19:20 [AB]
And J has that kind of right.
01:19:22 [ML]
We need a primitive that goes from array cast to the array cast. Because I mean, that's something we need to be able to do.
01:19:31 [CH]
All right, we'll do that on a solve that live on a future episode of arraycast. Alright, we'll throw it. We'll wrap it up there. We'll throw it to Bob. You can reach us at.
01:19:40 [BT]
At contact@arraycast.com, that's arraycast one word, no spaces so, so there you go. Don't worry about the capitalization is not that important. But contact@arraycast.com. And that's how Alex got in touch with us. As a number of other people did, so thank you for sending in your emails and what we usually do is I forward them on to the slack group. That doesn't mean I reply to everyone when I get a chance to I do reply to them just to give some feedback that we got it and thanks for for contacting us. But they do go into the slack group so everybody who's on the panel gets a chance to see what's being sent in and if there are comments back we send them back to you. So that's a good way to get in touch with us and propose ideas or guests, or anything else you'd like to hear, or criticisms that you have of what we're doing. If you've made it this far into the program, holy smokes. I don't know whether I want to hear somebody who's persistent enough to listen to this and they're still very critical. But yeah, if you if you got things we could do better, let us know and we'll see what we can do. Or maybe we'll have you on and you can show us how we would do it. But that's all.
01:20:53 [CH]
Yeah, I think this is what our our second response to a person that wrote in. Cause I think we did this once before but yeah, you aren't not guaranteed that your letter will get turned into a podcast episode or part of a podcast episode. But if you do have questions that you'd like to have answered, yeah, we do these every once in a while. I guess we're one per one per year at the moment, but we could increase the frequency if that's what the people want.
01:21:18 [BT]
We have, but we have brought in guests based on people's suggestions so that certainly has happened, which has been really useful in widening out because there are there are a lot of array language and array language adjacent groups that we aren't always aware of. Actually, I probably between Stephen, Marshall and Adam. I think they're probably just about everything, but it does give me some focus on who might be interested in talk to and John Earnest was a example of one of those, although I think it was Stephen Apter and Joel Kaplan had already suggested him. But there were listeners that said, yeah, you should really talk to him, and obviously we did and we should have, yeah.
01:21:57 [CH]
Yeah, and for those that you know we mentioned bringing on someone from Jelly. It is on our road map to kind of get representatives of some of these. I don't wanna say less well known. But like outside the Iversonian language circle like I think Nial actually might be in the circle. But you know, languages like Julia etc that are... Marshall smiling cause he's he's ready at the door to knock someone out. But we we definitely plan on having you know some language representatives or creators to come on to talk about these other sort of either less well known or sort of, you know, not in the top five languages that we're talking about on this podcast. Which should be great conversations when we get to those. But with that we will say happy New Year and Happy Array Programming.
01:22:44 [All]
Happy Array Programming!