Programming Throwdown - Julia

Episode Date: May 2, 2018

Julia may be the most requested language we have ever received on the show, so Patrick and I took some time of the past few weeks to get familiar with Julia and share our findings. Overall, i...t's a really slick language that has data and process parallelism built into the language, so it will run on many threads or even many machines without having to design a communication system by hand. Show Notes: https://www.programmingthrowdown.com/2018/05/episode-77-julia.html ★ Support this podcast on Patreon ★

Transcript
Discussion (0)
Starting point is 00:00:00 programming throwdown episode 77 julia take it away Welcome, everyone, to episode 77. You know, we have a lot of discussions with people and emailing in who aren't in university anymore or are thinking about what to study. And the question always comes up about, you know, kind of the importance of computer science in the, I don't know, maybe it's not the classical term, but how I always thought about computer science. And that would be relative to just programming or software engineering, which I don't keep up on the kind of subtleties of all the different words. And I know we've probably talked about the differences back and forth several times on the show. But what I mean here is the things you would find in a textbook like data structures and algorithms. Pick your favorite.
Starting point is 00:01:07 Yeah, I mean, it's like, you know, computer science 101, right? You sort a list 10 different ways and you build a tree and et cetera, et cetera. And the thing I want to point out is that even if you're going to, you know, go to some sort of bootcamp, if you're watching online courses, learning how to code a website,
Starting point is 00:01:24 I mean, these things are awesome. And actually, the mechanics of using an IDE, you know, telling a computer what to do, how programs work, all that is important. And I'm also a huge proponent of understanding, actually, architecturally, how computers work. For me, that's a big help in the work I do about getting programs to run and to run quickly and debugging when there's problems, especially in languages like C++ or C where you can have, you know, need to be careful about how you use your memory. But what the classic computer science I want to talk about is that there's a lot of work done in academia and understanding problems and thinking about things, things like NP complete, P versus NP. What are the problems there?
Starting point is 00:02:10 What are all the kinds of things that you maybe read blurbs about in your textbook or come across and you kind of file them away in your head for later? And what I ran across this week, an instance of this, and I was thinking about it that, wow, I had never really used the techniques I'm going to talk about in a minute before. But, you know, having come across them by keeping abreast of the like world of computer science, even though in my day to day, we always talk about this, how that tech companies love giving interviews where they ask you about like absurd doubly linked list manipulation.
Starting point is 00:02:45 You're like, yeah, that never do that in my real, real job. And this weird math that you think you need to learn. And in reality, you're never going to use it. And those are mostly true, but it does come up.
Starting point is 00:02:56 So I was working on a problem at work that was, it was really quite difficult. And we were having a discussion with my colleagues. And, uh, what is that? Why colleagues in quotation marks? I don't know.
Starting point is 00:03:08 Just because like, it sounds like really sophisticated, but they're, I don't know, they sound cool. My comrades. Yeah. So my, the people at work, you know, we were discussing this problem and we had had something that was really not doing well. The code was really slow.
Starting point is 00:03:25 Everybody's like, hey, we should do better. So I came up with some way of kind of organizing the stuff to be better. And the question came up, which was sort of like, okay, well, how do we test this code? And how do we know if, can we do even better? How do we know if it's sort of doing what it's supposed to do, which was helping us out with some stuff? And it really kind of bothered me and i tried to convince some other people like you know i don't i don't really know what sort of the lower bound is on like how fast this code can run so i don't know whether or not to keep spending time on it and
Starting point is 00:04:00 kind of bring this full circle what ended up happening is one night or whatever it just sort of like got in my head what have you called like a bee in your bonnet it no that's not the right thing anyways just like i think it just sort of like nagged at my head and i couldn't stop thinking about like the whole drive home i normally listen to my audio book and actually just paused it and like drove in silence just like thinking in my head oh i've done that too yeah i've definitely had nights like that okay so like really bothered to like, just like distracted at dinner with my family, the whole nine yards. This happens to me every so often.
Starting point is 00:04:29 And, and finally, yeah, this happened. And this happens to me too. Not to joke. This happens to me too. And my wife will be,
Starting point is 00:04:35 she'll say something like, are you even listening to me? And, and I think to myself, no, that's a really weird way to start a conversation so okay I don't know people call this like image I'm not gonna get off in this so so this really bothered me and I finally realized and that what I needed was you know what to
Starting point is 00:05:01 search for like a tool or a method, and there was nothing. It's not like, okay, what problem is this? And you sort of rearranged it in my head a couple ways and realized, oh, what I have could be mapped like almost exactly onto the traveling salesman problem. So, or sort of one of the variants of the traveling salesman problem. Yeah, that's actually a really good point is, you know, there's a lot of things like sorting, for example, where it's kind of obvious when you need to sort. But there's this whole class of problems where, you know, they get applied in ways you wouldn't really expect. And, you know, like like Sudoku is literally graph coloring. And there's that's, you know, that's kind of a contrived example. But yeah, there's tons of real life phenomena that can be explained with canonical algorithms that you learn in university.
Starting point is 00:05:54 Well, I mean, maybe and maybe not. So like Sudoku, as your example, since I'm being a little bit vague here just because it's not really pertinent. But yeah, Sudoku is a good example so if you sat down and tried to like write a computer program to solve sudoku as a human would i don't think at least in my understanding of the graph coloring problem that would lend itself to oh yeah that's the graph coloring problem so you might go really far with various techniques um but but you know end up in sort of almost a local minima where you're just sort of like running out of ideas but realizing oh this is the graph coloring problem or learning what the graph coloring problem is would open you up to a whole new suite of approaches that that are sort of like
Starting point is 00:06:34 well established that everyone's like oh you just use that technique or this technique exactly like you would convert you know your problem into the traveling salesman problem or the graph coloring problem. And then there would be some solver on the Internet that's just like blazingly fast. Well, OK, so I didn't find that. That would be awesome. But but what I did realize is, OK, this is a traveling salesman problem. Oh, and to cover just in case you don't know that the traveling salesman problem, which I'll hand wave a little bit. But if you think about all the capitals of countries in the world, as an example, and you think about their points in 2D on a map,
Starting point is 00:07:12 and there's various different statements of the problem, but for this one, imagine that there is a path from every city, every capital city to every other capital city. And what you wanna do is start in one of the cities and visit every one of the other cities one time before coming back to the city you started at and what you want is the path that visits all of the city traverses all of these edges between cities um in the shortest distance possible or the shortest time possible. And solving this is known to be what is called NP complete.
Starting point is 00:07:48 Very, very hard. There's no like sort of polynomial time solution to this problem that is currently known. And so that just to get just to illustrate this. Right. So you're right. Let's say you're in New York and there's Boston pretty close by. Right. So you might say, oh,
Starting point is 00:08:06 I should go to Boston because it's right there, right? But if you have to go around the whole world, then maybe the best thing to do is to make Boston the last city you visit, right? A second to last city you visit, and then just go to New York at the end. But if you go to Boston first, then, you know, you've already drawn that line you don't need to draw it twice right so you have this conundrum of like should i go to boston right now or should i pick it up at the end on my way back and the only way you can answer that is to you know go to the end of the path and find out if you should go to boston or not but to do that you have to go to the end so So it's sort of like this paradox.
Starting point is 00:08:48 And yeah, you end up having to explore every possible option. If you want the, you know, sort of, if you want to guarantee that you will find the optimal path. Right. But it turns out, you know, I didn't actually need the optimal answer. I just wanted to know sort of like how far away I was from it. And so what I found by mapping this onto the traveling salesman problem is that,
Starting point is 00:09:06 and actually mentioning this to Jason in the pre-show, he actually like, oh, so you just use simulated annealing. So for me, that was what it was, was like, initially when I was thinking about this, I was like, oh, maybe I could just sort of try all the combinations. And then I realized, oh wait, yeah, that's like ridiculously large there's no way um and then i was then you know like maybe i'll just try random and then i realized like oh wait this traveling salesman problem and sort of the same logic jason had oh yeah i should try simulated annealing which for sake of time maybe we'll cover meta heuristics and searching in another time but it's just a way of saying hey i have a very gigantic
Starting point is 00:09:46 search space and i'm gonna try what amounts to randomly searching it but i'm gonna guide the random searches in a way so that i'm more likely to go in things that give me better and spend more time looking at things that give me better answers uh yeah i mean that's a non-statistic jason could probably give us a better statistics answer but that's the layman's uh my layman's yeah i mean no i think you hit the nail on the head i mean just to like explain it through an example right so you start by just doing a random walk where you just start at a city and you just pick at a random city and go there and just keep doing that until you you've done all the cities and then go back to your start, right? And so now you have an answer. It's probably really bad.
Starting point is 00:10:35 And then what you do is you randomly pick a city and move it somewhere else in the queue. So if there's a city that you visited third, you just pluck, you pick it up, and then you put it somewhere else. Maybe now you're going to visit it ninth, right? And if that new path is shorter than the old path, then you put it somewhere else. Maybe now you're going to visit it ninth, right? And if that new path is shorter than the old path, then you take it. You say, oh, I did something random and it's good. Take it. And if it's worse than what you had before, then sometimes you take it, sometimes you don't. And it's that sometimes that kind of lets you kind of do some exploration. And then you just keep doing that until you get an answer. And over time, you get less and less likely to take things that are worse until eventually you're just only taking better decisions.
Starting point is 00:11:20 And so by doing this, I was able to find out that, oh, actually, the thing I came up with was pretty good. And I had somewhat confidence in that I had applied an appropriate technique. And so that was all of a sort of just an interesting thing that came up this week, but also this description of the importance of, you know, I probably haven't read about simulated annealing in five years, maybe since the last time we talked about maybe we talked about in the show since then. But I've never actually implemented it myself. I've never used it. It's not something that's at hand for the kind of work I normally do. But, you know, through this podcast, through, you know, just reading about computer science stuff, through having gone through school, it was something that allowed to pull out that tool, the toolbox, and allowed me to map a problem I had on to
Starting point is 00:12:08 sort of well studied something. And, and a couple Google searches later, you know, led me to the, you know, pseudo code that I, you know, wrote up in, you know, a couple hours into, you know, a couple hundred lines of code and had my, it took a kind of a long time to run, actually, I just let it run overnight, but had the thing running overnight and cranking away at trying to improve my answer. Very cool. Yeah, the next step now would be to try to export your problem to TSP
Starting point is 00:12:39 and see if some GitHub project has some, I don't know, like Gaussian process or something that's going to like really blow. Yeah, I saw there were some some like toolbox out there that are specifically for solving this. But my data set was actually bigger than most of them sort of had listed. So I'm sure they might work. But I wanted to find one that was like, yeah, I give it however much data you want. Because I had kind of a lot. You need to find one that's written in Julia.
Starting point is 00:13:08 That's next time, when I come back to spending some time on this problem. Very cool, man. So I have the first news, and this is Microsoft releases their training for artificial intelligence. We've seen kind of a lot of recent releases of videos and materials for training about machine learning and artificial intelligence.
Starting point is 00:13:32 These ones look pretty well produced. I haven't, to be full disclosure, I haven't actually watched any of them yet, but they seem well done and they're free. I like free. And Microsoft stated that they did this because they feel there's a gap in being able to hire people for doing machine learning roles.
Starting point is 00:13:51 Probably also as an advertisement, although I don't know. They are, I think, in their cloud platform rolling out some stuff for supporting people doing machine learning tasks. So I'm sure it's like a multi-faceted reason that they're they're releasing this but if you're interested and you haven't found something that really clicked with you yet check it out and see if uh if you can learn machine learning if you can learn to okay yeah i i haven't seen the videos either but uh uh you know i'm subscribed to like a bunch of ai like newsletters
Starting point is 00:14:26 and stuff and this is very very popular and so usually things that are popular just tend to be good that's kind of how it works the cream rises to the top or whatever so uh yeah i mean i i i haven't seen the videos but uh they come highly recommended um yeah my news is pretty interesting there's a you know a lot of these video games some of them cost money some of them are free but but they all have loot boxes and so for people who don't know a loot box is uh you have this box where you open it up and you get something random and it's usually something that doesn't affect the gameplay it's just cosmetic so for example um you could get you know a suit of armor for your character or a different suit of armor let's say so instead of your character looking black they look purple um you could get you a
Starting point is 00:15:16 new helmet or something but generally the these items they're just cosmetic and that way you don't really have regret like if you open the loot box and box and it's a scarf and you wanted a hat, it sucks, it's a bummer, but it doesn't affect your game at all. But the thing about it is, people, like anything, they associate social value to it, and so there's value to some of these items. Some of the items are very rare. So I think on Counter-Strike, there's a knife that's like a golden knife. It's just extremely rare.
Starting point is 00:15:51 And it sells for hundreds of real dollars to get one of these knives. And so because there's an economy around it, it is kind of gambling. It's like, you know, you open this box. Oh, and the part I didn't mention, you get some of the boxes, you know, as part of playing the game, but you can't open them without a key and the key costs money.
Starting point is 00:16:15 So, you know, the way it works is you both have to play the game a lot and you have to spend real money. So even if you had infinite money, you're limited in how much content you can get because you have to spend real money so so even if you had infinite money you're limited on in how much content you can get because you have to play and even if you play all day you're limited by money so on so forth um but you know you pay two dollars you unlock this box and maybe it has the 500 knife um or maybe it has you know i don't know the scarf that's worthless um and, you know, I don't know, the scarf that's worthless. And so, you know, especially in Europe, they're starting to kind of equate this with gambling. And I don't know.
Starting point is 00:16:52 I don't really I haven't really formulated a strong opinion here, but I do think it's super interesting. I can definitely see the gambling argument. So, yeah, I'd be interested to see what hear what your take is Patrick but but yeah the article basically goes on to explain that in Belgium they've banned loot boxes so they've officially called them gambling and so all these games if they are operating in Belgium they need
Starting point is 00:17:18 to turn that that feature off this is tough I mean to be fair I don't think I've ever spent money on a free to play game like this i think i've spent money to like buy levels or something but i've never spent money for like a random chance at something or other uh including like i've i played hearthstone a little while you know the card game and i never paid to like open packets of games and i don't it that's that seems a little easier for me to reason about because in hearthstone it's sort of like opening magic the gathering cards right like i go to a store and i pay three dollars to get magic the gathering cards some of which are rare
Starting point is 00:17:58 and some of which are not i mean i don't but in theory i could um and i don't think you can sell the cards in hearthstone unless maybe not but but but the way it works like magic is going to a physical store and buying magic the gathering cards gambling uh i think it is wait uh i'd have to double check okay i don't actually hang on okay i would assume it's not considered gambling because i know people normally gambling is restricted or at least how i think about gambling in the legal sense is normally restricted to having to be 18 and i don't think you have to be 18 years old to to buy magic the gathering cards um oh that's true but but of course gambling could could mean lots of things um and so to me
Starting point is 00:18:41 like hearthstone like you said maybe the difference there is is gambling that i can sell it back or that i can get cash from it because in hearthstone i'm able to play the game better in theory i could play the game better and enter a tournament and then make money um because i have better cards and you need the better cards to be able to enter the tournaments or else you're just gonna to get, you know, crushed. And so in the, and I know in, in the one that's always brought up in Japan, is it called Pachinko? I think there's some sort of machine that they play with ball bearings and you
Starting point is 00:19:13 buy money and you sort of put the ball. Oh, I've heard about that. And it's, it is, it is really gambling except that you only get, you know, these ball bearings,
Starting point is 00:19:21 which aren't really worth anything, except then you can go down the street and trade the ball bearings in for you know like uh something that has hard cash equivalents like a little gold coin like made of actual gold that has value for the gold in it um and so it's like one step removed but okay i mean if you go to a casino and they give you token, you know, what do they call poker chips? Those are technically not money, but you trade them for money. So I have the official rule on Magic the Gathering. I don't I'm not saying this is right, but I'm saying this is what is. Apparently, because you're getting something physical, it's OK.
Starting point is 00:20:03 And so I think the idea there is you know let's say you buy a car and i buy a car and your car ends up being a classic like let's say let's say like you buy the first model tesla and i buy just a honda civic and your tesla ends up being worth a lot of money just because it was the first one and my honda civic doesn't right like it doesn't that's not gambling and so uh i think the claim is you know you're buying these magic the gathering cards and you're you're paying for the cost of the card yeah and even though you don't really know what you're getting they also don't know what you're getting because they don't know in advance that something's going to be valuable even though they kind of do yeah that seems yeah that seems right it seems like convenient but because and if you say that i mean in reality what's the
Starting point is 00:20:54 difference between the digital games then because sure the company can artificially just make more or less but magic the gathering could just make more or less of any card past present or future they could just reprint a card. Yeah, I agree. Right? Yeah, yeah. I don't think it's a sensible argument, but that is the logic. Yeah.
Starting point is 00:21:11 So, I mean, I do understand that it does seem an awful lot like gambling, right? Like, oh, I put money in, and sometimes I get big stuff out, and sometimes I get something that's not worth the money I put in. But the not worth the money I put in is applicable for lots of things. Like if you bought Magic the Gathering cards and were guaranteed to be able to sell every card, if the total value of the cards you had were always sellable for less than the packet price, you would buy infinitely many, right?
Starting point is 00:21:39 Your expected value is higher. So we know that's not true. We know the expected value of an open packet of magic the gathering cards is different than the expected value before you open it right and it's going to be less on that yes or else you would buy infinitely many right you would always take that gamble okay um yes it's it's it's interesting i mean that's that's the rules i mean we'll see i mean i'm sure the video game companies are going to lobby as hard as they can. You know, and they probably have a case.
Starting point is 00:22:09 My thing is, I think, you know, any type of, you know, any type of thing where you buy and there's an element of chance like this should probably be age restricted um i have a feeling like you know if you're 12 you probably can't really you know grasp this this like you know concept you know like you probably waste a lot of money like i know i waste a lot of money at the arcades and you know not a lot of money but like you know these people might be spending hundreds of dollars and see i feel like you probably should be a certain age or have parent consent well i will say for certain regardless of my feelings or the ethics or morality of it is that it's going to have a huge impact on the profitability of games if this becomes widespread yeah that's true although to be fair uh um well first of all you're totally right. But second, I think these kind of games rely on these people called whales who are just like a few people who spend an incredible amount of money.
Starting point is 00:23:15 So if they could get it age-restricted, I think they would still get 99% of their money probably. But who knows? Yeah, so that's a pretty controversial article. We'll have to see what happens. I mean, it's just one country in the EU, so it could be the whole EU bans it. It could be that it gets overturned.
Starting point is 00:23:36 We'll find out. Next article is on the taxonomy of tech debt. And this was posted on the Riot games engineering blog uh who are famous for making league of legends right yeah and um talks about actually some of the work behind league of legends and you know everybody talks about technical debt and i i guess technical debt is one of those things that is unavoidable if you always work to have no technical debt, then you're probably not going fast enough. You're probably going too slow.
Starting point is 00:24:11 But this is an interesting approach with some real world examples. And I won't go through all of it because you should just read the article. But he basically comes up with some measures that he thinks it's important to measure, like impact, the cost to fix, and then what he calls contagion, the likeliness that the problem will spread throughout the whole system.
Starting point is 00:24:29 Um, and you know, sort of cause disruption. And then also whether the debt is sort of like local to an area or global, um, whether it's like somebody came in and did something crazy, like just sort of like, what would you call those?
Starting point is 00:24:41 Like arch types, arch types, uh, like prototype archetypes. There we go. Thank you. thank you uh it's late my brain's not working well archetypes of you know here's the kind of things that would cause various styles and he kind of writes about it so i encourage you to read it and i thought it was pretty well put and it's always a struggle to talk about technical debt and instead of shipping a new feature you know taking time to fix something that is probably not broken but is either has a risk to make something broken or is causing
Starting point is 00:25:14 problems to slow down or hurting you know the joy of working in the code whatever it might be it's always difficult second so having more thoughts on how to think about and describe that is always welcome yeah totally makes sense yeah the worst kind of technical debt that i've been experiencing a lot of lately is where things just fail silently you know and that's one thing over the years i've gotten more and more loud with failures like you know if there's an input and it should be between 1 and 10 and it comes in as 11, I just crashed the whole binary. And part of it is because, you know,
Starting point is 00:25:49 I'm not working on like a rocket ship or something where you can't do that. But, you know, we've been really burned lately where, for example, we had this issue where this library was reading rows of data and if the data didn't fit you know if the data had errors basically it just skipped the row but it didn't warn you or anything and so uh we found that only 10 percent of our data was being read which uh and of course it wasn't a random 10 percent so it
Starting point is 00:26:20 totally skewed you know all of our results um, yeah, stuff like that is the worst. So, yeah, that's, that's, that's especially, but yeah, this is cool. It's especially bad. Yeah. If you're doing something where you're building statistics or measuring something, because you could easily be missing, like you said, 90% of your data and it wouldn't be immediately obvious you were. Yep.
Starting point is 00:26:43 Yeah. It went on for a long time. Oh man. be immediately obvious you were yep yeah it went on for a long time oh man my article is ubuntu 18.4 is available so this is a big deal so ubuntu has um what's called lts versions long-term support versions and these are basically versions that um you know have been vetted very carefully and also if you're a paid you know um like if you're a corporate uh i guess sponsor of ubuntu or if you if you pay into their customer support all that uh they will support the lts versions for you know years and years and years so if you're on you know 17.10 after maybe 12 months they're like done like done. Like if you need help, I mean, I'm sure you could pay somebody to help you,
Starting point is 00:27:27 but, you know, it's going to be much harder. But if you're on 16.4, you can get help for a long time, even years from now, right? And so the LTS versions are pretty rare because of the amount of, you know, customer support and all that that goes with it. Also, you have a lot of libraries. So if you need proprietary libraries, such as the CUDA library from NVIDIA, NVIDIA is actually pretty good about having it for different versions, but a lot of people just support the LTS version.
Starting point is 00:27:58 So if you have some custom driver, you know, you're stuck on 16.04, right? And so 18.04 is the LTS version, which means a lot of people who've been waiting to update can update. And, you know, you go from, I think it's like GCC 5 to 7 or something like that. It's a huge update, right? It's out. It came out today. I haven't updated yet any of the machines in my house or anything, but I'm looking forward to it. I think it looks a lot nicer.
Starting point is 00:28:30 A lot of the graphical issues have been fixed. I think they were using LightDM. They switched back to GNOME, so it's going to look pretty different. I'm not sure what the upgrade path is, but if the upgrade path switches it back to GNOME, it's going to look pretty different. But yeah, it's a pretty big announcement. I'm looking sure what the upgrade path is but if the upgrade path switches it back to GNOME it's going to look pretty different
Starting point is 00:28:46 but yeah it's a pretty big announcement looking forward to getting everyone on there Do you run Ubuntu at home? Yeah so I have basically I have two media center PCs one per television and they both run Ubuntu and my desktop
Starting point is 00:29:04 dual boots but uh yeah i typically just stay in windows for that but i do have a bunch of on the desktop what about you are you running a bunch of no i run windows i'm a horrible person yeah you run uh i'm just kidding temple i'm just, I run Windows. I mean, my wife uses the computer, and so it's good to have Windows on this, which she's used to. And then, you know, I do it for some gaming. Yeah. I think Ubuntu has probably come a lot further,
Starting point is 00:29:37 and last time I used it, it was way better than the time I had used it before. So I'm sure it works pretty well. I just find myself not using desktops and laptops as often anymore. So yeah, I just don't have them up very often. And so they're just on Windows because that's what they've always been on. So like, do you have PCs hooked up to your television? So I have like Chromecast hooked up to my TV. Oh, okay.
Starting point is 00:30:04 Got it. And then I have a... go ahead oh i was gonna say i i i like pre-date chromecast so i just have computers for each tv but like uh you know yeah when they break i'm absolutely going to chromecast but for now yeah chromecast like the fire tvs like i think these ones work pretty well having a media pc does allow you to do some stuff i just found the hassle of dealing with it wasn't worth the few extra features that i wasn't using very often yeah and then i have a nas that uh has the ability to do stuff like have a plex server on it and stuff um but it runs a custom os from i think it's synology or whatever yeah so it runs some version of linux under the hood i don't know which one um but you i've i've
Starting point is 00:30:51 not like jailbroken it i'm sure i could just run whatever on it i just run whatever it came with because i just wanted to be stable and you know keep itself happy yep so yeah boring setup i'm sorry there's no reason to do something crazy i should do something cool i had i mean we talked about this before the show but i you know we we talked about our networking setup a few shows ago and i had this totally jacked up uh you know netgear router that i just hacked and had all these extra services on and it basically died so uh yeah and i pretty much voided the warranty by you know doing all this crazy stuff so uh i'm just running stock stuff as well uh time for book of the show show my book of the show is econa economics but with an x
Starting point is 00:31:43 so i think my last book of the show is basic economics by thomas soul i'm actually still reading that it's a very long book it's like 30 chapters um and you know it's also pretty dense so i have to kind of keep going back and rereading um so i'm kind of you know charging my way through that but uh there's a person on my team who is an actual economist um and he recommended this book as as a as another kind of book for for getting into economics this one is actually a um a comic book style um so if you're into like graphic novels and things like that um you know you'll like this um i haven't read it yet, so I can't vouch for it directly, but I've been some people who know way more about economics than me said this is the
Starting point is 00:32:33 book to get people started, get lay people started. And I'll definitely be reading it once I finish the Thomas Sowell book. Very nice. Yeah, you've been really into economics recently. Yeah, I think it's, it's, it's really, you know, got ahold of me. I think it's fascinating. I'm not so interested in like the stock market or anything like that, you know? But yeah, the way the engine works is just, is super, super interesting. And I feel like computer scientists should really study economics like the the you know thinking of it as this like really complex adaptive system taking it from
Starting point is 00:33:11 that perspective i think it's really interesting so we've now recommended that everyone go study more cs that everyone go study ai and machine learning that they all go learn economics we're gonna create an army of superhumans. This is, yeah, we're going to just keep going. We're going to have tons of recommendations. Yeah, if you've done any of these things, let us know. If you do the Microsoft course, you know, we're on Facebook, we're on Twitter.
Starting point is 00:33:39 Actually, I think, so, you know, Facebook definitely has the biggest audience. But I think if I had to pick one place for people to, you know, message us, I think Twitter is probably it. When he says us, he means him. No, no, no. I mean, yeah, the Twitter is the Twitter is technically mine, but I never tweet unless it's about the show. So. So, yeah, it's at neural nets for life.
Starting point is 00:34:04 You can look it up on our homepage. But if you tweet us and you add us, unless it's about the show. So yeah, it's at neural nets for life. You can look it up on our homepage. But if you tweet us and you add us, then it's public. You know, like if you comment on our Facebook, it's kind of hard to find that. But I've noticed when people tweet at us, they typically, you know, then other people respond to them and it actually starts kind of a nice thread versus when someone comments on our post on Google Plus or Facebook, it just kind of dies nice thread versus one when someone comments to our on our post on google
Starting point is 00:34:26 plus or facebook it just kind of dies the comment dies i haven't been on google i should go in there yeah i mean yeah if you've done uh any of these things writer economics book or or taking the microsoft course or anything let us know man it'd be great to hear my book of the show is black prism by brent weeks this is the first book in uh i think it's supposed to end up being five books i think the fifth book isn't out yet i'm not exactly sure because i'm only on the first book um and i think one of the there's like a book in between one of the books i maybe a short story or something. But Black Prism is pretty good. I've not read anything by this author before, Brent Weeks. I'm actually not quite done with it. I'm like one chapter away from the end or something. So it's like, you know, everything's
Starting point is 00:35:18 kind of wrapping up or at least no spoilers. You know, I don't know, maybe it will or won't. But like one or two chapters from the end and I'm really enjoying it. It's a fantasy book. Um, and they have magic, but the magic is sort of based on a light, hence the name prism. Um,
Starting point is 00:35:36 and so people use light and it has, it's not, uh, you know, super scientific, you know, whatever, but it's a sort of an interesting read
Starting point is 00:35:45 and an interesting play where people are able to use certain wavelengths of light to do things and so you might be able to use red light to do magic using red light and I might be able to use green light to do magic with green light and it just talks about various
Starting point is 00:36:01 things along those lines for the magic system and i find it pretty interesting and book's been a good read so far some intrigue building up you can definitely tell it's gonna be part of a series so and i think the author actually has several other series in various states as well but um this one is part of the light bringer um saga so i'm enjoying it i'm enjoying i'm pretty pretty far through it and i recently started uh picking up a little bit of of podcasts too but i i don't know as much as we make a podcast and you should keep listening to our podcast uh something about like listening to a book i just
Starting point is 00:36:37 like i don't know i get really into it and it's like really long form i'm actually doing both i'm listening to uh there's this podcaster stefan molyneux and he he talks about um um he's just like a really really hardcore libertarian like way more libertarian than i've ever seen like he's like you know there shouldn't even be public schools and just like way out there and And I just find it fascinating. I mean, I can't say I really agree with everything. But but yeah, I've been following his podcast and a couple others. So, yeah, I mean, I enjoy audio books. I use Audible. I have for like a long time now. I have so many books because I have a pretty long commute. But if you're interested in trying
Starting point is 00:37:23 out Audible and you want to help the show, you can go to audibletrial.com slash programming throwdown and they'll give you a one month trial, which is good for a free book. It's pretty much any book in their whole catalog, which they have just like tons of stuff. And so you could check out,
Starting point is 00:37:41 Jason said economics is a comic book, so I won't even bother looking and seeing if they have that. But you could check out the Black Prism or look back through our show notes and see many books we've recommended or whatever your favorite might be and enjoy that. So that's like one. Yeah, do want a book that we have on the show and you have, let's say, the Audible credits, if you click on the link and then you buy the book, even using your Audible credits, that still helps the show, by the way. Oh, I did not know that. So, yeah, all our Audible listeners can still sort of help the show and get the book they want.
Starting point is 00:38:18 So it's kind of free for you. It's like no effort by clicking on our link and then choosing the Audible choice. Oh, I didn't know that. That's a good tip cool yeah um you could also if you are already an audible customer or want to help out the show another way you can subscribe on patreon just to give you an update on the patreon so patrick has made all of the christmas prizes i know we're woefully late um but you know i still have all the addresses also by the way if you we only have
Starting point is 00:38:48 addresses for about half of the Patreon subscribers so if you you know don't have your address on Patreon you know at this point just email me so if you send me an email just give me your name and your address your
Starting point is 00:39:03 social security number your credit card yeah email uh just give me your name and your address your social security number your credit yeah no just just give me your name and your address and i will you know connect the dots and i will make sure that you get um a christmas present um but yeah i mean at the moment we actually have extras because uh so many people didn't uh don't have their address. You should post something on the Patreon feed too. I did already. Yeah, yeah. But if you didn't see that, or maybe you don't want your address on Patreon,
Starting point is 00:39:34 it's totally fine. You can just send me an email, and we'll make sure to add you to it. Yeah, and it's also fine if you are like, I don't want to give these guys my address, and I don't want a prize. That's fine too. Oh, yeah, of yeah of course you want to be anonymous and mysterious if you don't want this i'm looking at them right now a whole stack of they're pretty cool i'm excited actually my my
Starting point is 00:39:55 my son loves it uh you know i gave him one wait i don't know that those are childproof last i think they have sharp corners don't they Actually I think he broke one Oh don't let him eat it I would feel terrible if your son No he's five years old he's not going to eat it Time for tool of the show Tool of the show is forceps To get things out of your child's mouth
Starting point is 00:40:21 After they've eaten it My tool of the show is brutal doom brutal uh this is really really cool so here's how it works um first you have to buy doom step one um you can either get doom one or doom two actually sorry you have to buy doom two um then you get this brutal doom so what this does does, it's kind of built on top of layers and layers. So there's a lot going on here, but I'll try to break it down as simple as possible. Basically, so doom, the source code for doom was released by id Software a long time ago, maybe like 15 years ago or something, right?
Starting point is 00:41:02 And maybe not that long ago, but a long time ago. And someone, you know, just went through and, you know, took the parts of the source code that load all of the data, and they, you know, brought that over, but then they rewrote the whole game engine. And so you can use the mouse to look around. You know, it's just faster. There's no limit to the number of enemies that could be on the screen at one time.
Starting point is 00:41:28 I mean, all these, you know, all limitations are gone. And it looks way better, et cetera, et cetera. So it plays just like a modern FPS now, right? And so then there's this thing called Brutal Doom, which is where somebody has modified the engine to just make the game basically more intense. And so the way it works is it it kind of sits on top of the existing game content and it kind of patches it and then also patches the engine. So, for example, there's all the weapons are different. The enemies are different like
Starting point is 00:42:06 their ai is totally different they look different they don't look different but they um uh uh they have different attacks for example like the imps will actually jump at you the demons like jump um these so they act different and they have different animations and stuff. And it's also just extremely brutal and very satisfying. It's kind of, I don't want to say it's like it messed, it is kind of messed up. It's kind of messed up. Like if you shoot one of the enemies, sometimes they like lose a limb and then they start like kind of like crying and you have to kind of put them out of misery it's like kind of weird yeah it's kind of messed up but it's super super intense um everything is really fast you're like it's way it's it's by far the fastest
Starting point is 00:42:59 fps i've ever played like you just move so. You move faster than the rockets and stuff, right? That's always kind of been true in Doom. But this really takes it to the next level. You know, you can play co-op. It supports, like, playing over the internet, so you don't have to play over, like, an IPX wire or anything anymore. And it is just super,
Starting point is 00:43:22 super fun and satisfying. If you like Doom, you'll just absolutely love this. The other part of this is this guy actually went ahead and built his own campaign. So a whole new set of levels. And he calls it the Hell on Earth pack. And it's something like 30 or 40 levels. They're extremely, extremely well done. Super high quality, like some really interesting stuff.
Starting point is 00:43:49 He kind of keeps you on the edge of your seat. He's got friendly AI. So there's a part where you fight like a huge battle. You and a bunch of AI Marines fighting a bunch of enemies. There's a part where you lay siege to a castle with catapults. Like it's insane um and uh to top it off he's actually releasing another whole new set of 30 levels like a completely new campaign um and they're going through the beta testing now you can get the campaign if you subscribe to him on patreon
Starting point is 00:44:19 or you can just wait i think it's going to come out in a few months. Um, but I played this, I thought, Oh, the other, the last part of this is, you know, you don't have to play these new campaigns. You can actually play the original doom or doom too, just with, you know,
Starting point is 00:44:34 the modified, um, uh, you know, engine and, and it will, you know, the,
Starting point is 00:44:40 the, the designers have made sure that the games are beatable and, and all of that. Um, super, super fun super fun I highly highly recommend it it's brutal it's brutal well prepare to groan
Starting point is 00:44:55 my tool of the show is YouTube I was telling Jason before the show know i stand by this you know there's my life would be different in many ways if youtube didn't exist um yeah i mean joking aside youtube is probably the best tool we've had on the show i mean if we just look at it objectively yeah i mean i i think i take it for granted and we've been on seven years now so there there are probably people listening to the show now who are like, yeah, man, YouTube's like TV. Like you wouldn't be like TV is the best tool. But, you know, thinking about, oh, I'm going to go.
Starting point is 00:45:35 I went skiing a couple months ago and I've I'd never taken lessons. My dad sort of taught me how to do it. I'm really horrible at it. And I was like, I kind of want to be better. lessons are expensive i'm gonna look on youtube sure enough when on youtube there's like you know super professional videos and instructions about how to ski and like do better at skiing and sure it's probably not anything close to paying good money for a real instructor but you know it definitely helped me and I know I skied better because of it. Um, and I didn't, it didn't cost me anything other than time that I probably
Starting point is 00:46:11 would have spent doing something else anyways. Uh, and just the amount of learning you can do on YouTube and using it for like repairs around your house or, uh, fixing problems and things that just would never like reading someone talk about skiing just doesn't work i couldn't have found someone's blog and been like oh i see what i'm done wrong no you really video is the way right i mean it's just it's it's sort of obvious yeah yeah when i had to learn how to uh basically a part of my son's bed kind of broke and i wanted to fix it and also kind of just reinforce the bed. Cause it's cheap Ikea bed.
Starting point is 00:46:48 And, uh, yeah, I went on YouTube and I looked up, you know, how do I use a jigsaw? How do I use a table saw? And,
Starting point is 00:46:54 uh, yeah, I mean, just seeing someone do it is so important because especially you can watch 10 people do it or a hundred people do it. And each time you'll learn something a little different. Yeah. And it is true that sometimes you can get bad advice uh but but i think you said earlier you know kind of cream
Starting point is 00:47:11 rises to the top i think often especially in the like how-to stuff like the people who kind of are doing stuff that's very dangerous often get flagged for doing stuff that's very dangerous so yeah i mean i looked up how to use a jigsaw, and the video had millions of views, and it was just very professionally curated. And yeah, I mean, in theory, yeah, and if someone could trick you, for one, they'd probably have a lot of thumbs downs.
Starting point is 00:47:37 That has a big impact on the search results and all that. So yeah, I wouldn't worry too much about it. But specifically the thing, and this relates to kind of what we were talking about uh you know things that you don't use often but when you do wow that's nice uh is i've been watching this channel three blue one brown and this guy goes into like all sorts of discussion about math and not like oh here what is the oh man con academy you know it's like very practical math and how to learn that's great too um but that's very different this is like for math that you would never or i
Starting point is 00:48:12 personally would never have attempted before like the riemann zeta function uh and he'll describe in like a it makes me feel like a superhero like i understand the riemann zeta function and what the zeros and how it relates to prime i mean i don't but i watched it he convinced me that like oh it's totally obvious and intuitive how these things relate to the primes and why and um just a great video great channel i don't remember how i came across it i think maybe i had number file on a while ago i think last time uh and this i think was sort of referred to it and i may have even talked about it last month if i did oh well
Starting point is 00:48:49 because it's really good the videos are a little long um but you know definitely worth it the explanations he gives and the understanding of math and i think it's one of those things where although i'll never probably have use for the riemann zeta function like the way he breaks down and thinks and he does this talking about mapping from one problem onto another for looking for solutions which is very common in mathematical proofs um and that technique right it just helps get you thinking about those kinds of things enormously valuable so youtube and for a specific channel recommendation because why not two for one three blue one brown very cool yeah i mean a similar one that i follow is called ted ed where it's um i don't know how it's affiliated with ted but it's just high quality
Starting point is 00:49:38 uh no uh it's it's high quality like uh uh like cartoon style animations but explaining some concept like they had one uh the other day that was uh why you can't divide by zero and um but i mean the thing is i mean obviously you can't they go into like why you can't do that and why if you could then one would equal two or whatever but then they explain how you can't even really fudge around it like you can't say one over zero is infinity like you can't really even write a rule to to handle that because any rule you write ends up contradicting itself and it's just super interesting um very cool time for talking about julia julia my wife actually saw you know julia on my computer and she's like who's that i would name some famous actress but i'm drawing a blank julia there's some
Starting point is 00:50:38 julia julia roberts ah maybe i was thinking julia childs she's a chef right oh yeah right yes we know pop culture um yeah exact first cultural reference seven years in um so you know to talk about julia you really have to talk about scientific programming like at a high level because julia is in this class of languages you know that contains you know matlab and and R and things like that, NumPy. And the core idea behind all of these has been that you have a slow interpreter, like the MATLAB interpreter is just extremely slow, but then each individual instruction is super fast for what you're doing. So to illustrate an example, let's say you have two vectors, and they're of length a million each, and you want to add them together.
Starting point is 00:51:41 Well, if you write a for loop in MATLAB, for 1 to a million, c of i is a of i plus b of i. That's going to take a long time. I mean, like, maybe a minute right but if you do c equals a plus b you know if it's just one line in the interpreter that line can be very complicated and time consuming and matlab will do that just extremely fast like a i don't know not even acond, like a fraction of a millisecond, right? And so the way that these things work is under the hood for each instruction, each instruction maps to a bunch of really complicated but extremely fast logic. So there's BLAS libraries, which we've talked about in the past. BLAS means basic linear algebra system.
Starting point is 00:52:26 So, for example, you know, there's sort of an API that you can adhere to to be a BLAS library. And it says things like, you know, add two vectors, add two matrices, multiply matrices, so on and so forth. And if you implement all of these functions, then you support, you know, BLAS level one or whatever, right? And so, you know, the best, these BLAS libraries, you know, they have trade-offs, and MATLAB typically has all of them, and it knows to use
Starting point is 00:52:56 the right one at the right time. There's things like FFTW, which stands for Fastest Fourier Transform in the West, which is just, as it says, just a super fast Fourier transform in the West which is just as it says just a super fast Fourier transform library things like OpenMP for multiprocessor support things like that
Starting point is 00:53:14 and so you don't have to know how any of these things work or that even any of them are happening because it's all kind of behind the scenes but the price you pay there is that you know each instruction now requires you know a lot of thinking you know my life has to really think about um you know what to do and so things like for loops are just going to kind of kill your performance so um the last oh go ahead so the when you said that, you know, the realm of scientific programming or whatever, I mean, this is one of those places where
Starting point is 00:53:48 that there's actually still a lot of people using Fortran, using, see, they, you know, sometimes I think like scientific programming, people using SciPy and NumPy. But I mean, there's still a lot of people using languages much older than that. Yeah, that makes sense i mean like i feel i you you're more in that realm i guess than i am so i mean is like of the mindshare is julia competing against these old ones or competing against something like python i think julia is really competing with matlab um so so at work um you know there there's some
Starting point is 00:54:28 people using julia uh not really on my team but uh it's a huge company and there's a whole group of people um using julia and i noticed almost all of them are xr or x matlab people so yeah i think um you know so yeah to your point, I mean, when you say scientific programming, of course, like, you can do scientific programming in anything. But typically, like scientific programming languages are ones that are more high level, that make it easy to experiment. And so that's why most of these languages will have an IDE built in. So for example, MATLAB has MATLAB. You start MATLAB, and it pops up this whole developer environment where you can see the status of variables and look at plots
Starting point is 00:55:20 and things like that while you're coding. And so for Julia or NumPy or any of these, you'd be using Jupyter, which Jupyter is the rebranding of IPython Notebook. And so one of the reasons for that rebranding is Jupyter supports Julia, supports Torch, which is in Lua, and a bunch of other things. Nice.
Starting point is 00:55:43 Supports, what's it called? Spark. You can do Spark in Jupyter now. So what are the, so for Julia itself though, what are the features that it really has? Yeah, it's a good question. So like, why does Julia, you know, like really stand out, right? So if you, let's say you're a MATLAB user or an R user, what's really the reason to switch, right? about back in episode 41, which was probably years ago. But in the Node.js episode, we talked
Starting point is 00:56:27 really about this whole async paradigm. And the idea with async is pretty simple. It's just, you know, you call a function, but instead of it doing what it's supposed to do, it just goes off and starts working and it gives you a future. So let's say you and Julia, and I'm going to kind of be a little hand-wavy here just so I don't have to, like, speak in code. But in Julia, you say async 1 plus 1. And it doesn't return that line. If you say a equals async 1 plus 1, that's not just going to, a is not going to be 2. a is going to be equal to a future.
Starting point is 00:57:05 And then whenever you go to use a, so let's say you now say c equals a plus b. Now c is going to be a future. And this keeps going and going. And eventually you're going to need to know a value. So let's say you print c or write c to a file or something like that. Now all of a sudden Julia says, whoa, hang on. on all of these features I need to know now what they actually are and so what it's going to do is it's going to you know start waiting blocking on these features so it's gonna say hey see you know do you know what you are yet and see says no, no, I'm waiting on A. He says, oh, okay, A, have you figured it out yet? No, not yet? Okay, I'm just going to hang out.
Starting point is 00:57:49 And then A says, oh, yeah, I figured it out. One plus one is two. And then C says, oh, now I got my value too. And then now you print C, right? And so, you know, when you're writing code like this, you're just accumulating a lot of these features. But then, you know, while this interpreter is running and doing this, you know, those features correspond to, you know, tasks that are running and they could be their co-routines. So they're running in the
Starting point is 00:58:17 same process, just, you know, in a separate, I guess, a separate thread, just to be a little more hand wavy. They could be separate threads, they, a separate thread, just to be a little more hand-wavy. They could be separate threads. They could be separate processes. They could even be on another machine. And that's one thing that really sets Julia apart. In Node.js, you can do async function, and you'll get a feature and same kind of thing. But Node.js won't actually ship that function over to another machine.
Starting point is 00:58:47 That's a whole different universe, right? Because, I mean, you think about the complexity there. Like, you know, for you to ship a function call to another machine, that machine has to have all of the context. You know, if that function uses a library, then that library has to exist on of the context. You know, if that function uses a library, then that library has to exist on the other machine. You know, then there's also some things that just can't happen, right?
Starting point is 00:59:11 Like if that function tries to read from disk, well, now you're kind of in trouble if you assume that it was going to be on the same machine, right? And so, you know, in Julia, there's ways to say, you know, run this asynchronously, but it has to be on my machine versus I don't care, just run it anywhere.
Starting point is 00:59:29 But the cool thing is, let's say you have some program where you're loading some images from disk, you're doing a Fourier transform, and then you're running a convolutional neural net, and then you're adding the two, and you're doing some other stuff, and you're running a convolutional neural net and then you're adding the two and you're doing some other stuff and you're calculating bounding boxes. Like you could just do all of this and Julia will farm out all of these tasks and it'll use as many resources and machines as you give it and as are allowed by the commands you're specifying.
Starting point is 01:00:02 And then it's going to try to keep itself busy. And it's got a lot of built-in sort of pool support. So let's say you have 120 images that all need to be processed. You could just say, hey, Julia, process all 120 of these as fast as possible. And it's going to go off and do that. And so there's a lot of complexity there
Starting point is 01:00:24 that's hidden from you. Like, for example, let's say you have 10 computers. And you tell Julia, process these 120 things as fast as possible. Julia will send the first 10 out. But then let's say the 10th one comes back first. And the other 9 are still processing. It's not going to wait for the other nine to finish. It's going to just send the 11th one to that machine that's done with the 10th one. And so it's kind of keeping track of everything for you and making sure that none of the computers
Starting point is 01:00:57 are really waiting if they don't have to wait. So that's the really kind of big add. And it seems really cool. I mean, if you come from sort of a MATLAB environment where you're loading an image, that happens probably instantly, but then you're on a Fourier transform, that might take a while, or you're writing a for loop
Starting point is 01:01:19 to loop through all these images and process them. And you go to something like Julia, where you just have this one line that says, loop through all these images and process them. And you go to something like Julia where, you know, you just have this one line that says, Hey, here's 10,000 images. Just know that's, that's really nice. Right. So, so, so you compare it to MATLAB, but one of the things about MATLAB is MATLAB is really expensive. Yeah, that's true. And so I was going was gonna say and even if you know for things that are
Starting point is 01:01:50 free we've had this issue with java recently where uh you know oracle actually ended up winning that lawsuit and so uh yeah google is gonna have to pay oracle is like billions of dollars it's something crazy but there are some languages that they're not um or packages or whatever where they're not they're free but then they have sort of like a catch right like that they have a really restrictive license or whatever yeah although i mean i guess for java most people are probably not doing what google did um yeah i don't know the details on that so like if you just use Java is it okay I'm not a lawyer so I'm yeah that's true but let's just say that you don't have that issue in Julia because Julia is completely MIT licensed which is for people who don't know MIT and BSD are the two licenses where you know uh if you talk to a lawyer you know that
Starting point is 01:02:50 those are the licenses that will make them smile right like if it doesn't say MIT or BSD the lawyer is going to have a lot of questions and be really nervous about using that software so so Julia is totally unencumbered so I'm I don't know if this is correct i for home use matlab even just for home use is 150 dollars for a standard license for one year presumably for a company it's 860 dollars wow that's wild i yeah, I mean, there's probably more. Like, I think at many companies, they have, like, sort of network licenses that get checked out and stuff.
Starting point is 01:03:30 So maybe it's cheaper. But, I mean, that's a lot of money. Yeah, I mean, it's insane. And the open source community has, you know, caught up. I feel as if that might not be not be matlab might not have a sustainable business yeah i mean but matlab is really good to be fair like it's not like some stuff where you know oh this is some arcane package but if you really need it you'll pay the money i mean matlab it you know i don't know it's hard to say you get your money's worth when you compare
Starting point is 01:04:03 money's worth to free that's the divide by zero thing, right? You get good support probably. You probably do. But Matlab is a really good piece of software. And I think we should be willing to pay sometimes. But if you're not going to use it a lot, it's hard to be like, I'm going to pay this money and I'm not sure if I'm going to use it. Yep. Yeah, exactly. And keep in mind,
Starting point is 01:04:25 like if you're an enterprise customer, you're invariably going to run into some problem and you're going to have millions of dollars on the line and you're going to just pay someone a lot of money to fix that problem. And so even though, so people might say, why is this free?
Starting point is 01:04:43 What's the catch? Well, that's the catch, right? The catch is, you know, people might say, why is this free? What's the catch? Well, that's the catch, right? The catch is, you know, that I'm sure this company is charging for support and, you know, things like that. With that said, it's not a trap in the sense that, you know, the software is extremely professionally done, very worth, you know, the effort. But it's a bit of a question mark like with matlab i guess you pay the 800 but presumably you get some level of support for free um the forums and and you're i said go to the forums the matlab no but i mean i'm assuming if you have a license there's a phone number or something i don't know maybe i'm not maybe i'm making that up i mean i know i'm making
Starting point is 01:05:24 it up but maybe i'm wrong but i mean yeah i guess to point out too we've talked about this in our matlab episode but for a one-to-one replacement for matlab style stuff i guess you'd probably consider octave so julia isn't going to be a drop-in one-to-one replacement but for the style of work that is often done in matlab that, that would be where you consider Julia. Yep. Yeah, exactly. In terms of like, you know, one of the hesitations using Julia might be that it doesn't necessarily have so much support in terms of library. Like, for example, let's say you need to load, I don't know, some geospatial data that's in some GIS custom format or something like that. Or you need protocol buffers or I don't know, whatever, right? You know, you might say, well, you know, I'm taking a risk using a language
Starting point is 01:06:16 like Julia because it's not going to support something I really need. They do have a JuliaPy library, which lets you run Python code inside of Julia. It is pretty good. It actually, they wrote a bunch of logic there to handle NumPy arrays. So if you create a NumPy array in Python, you know, as part of some process, part of this JuliaPy process, and they need to bring that back to Julia, they'll actually just do a pointer assignment. They're not going to actually copy it. Actually, I think they, yeah, if you create a NumPy array using the PyData or the JuliaPyData object, so there's a little bit of some stuff you have to do
Starting point is 01:07:03 that's a little bit special. But basically, it's very performant. object. So there's a little bit of some stuff you have to do that's a little bit special. But basically, it's very performant. You can call into Python if you need to. And that shouldn't stop you from trying it out. So one of the cool things that I found about Julia was that there are only four languages, four high-level languages that have ever been used to write computer programs that executed at greater than one petaflop sort of compute power.
Starting point is 01:07:35 And so those are C, C++, Fortran, and Julia. So those are pretty good accomplishment. And you were talking about the, you know, support for distributed messaging and working and that kind of stuff and right that i mean this is sort of evidence of that that that you know isn't every language that you would use in such an environment and one day i guess everybody will have a petaflop under their desk um yeah but but that day is not today um and it was interesting that i would have thought the number of languages would have been higher. But at least according to Wikipedia, this is, yeah, it's only four languages, four don't have an intuition as to how flops relates to, like, megahertz or gigahertz.
Starting point is 01:08:30 So, like, can you put it in? So, sure. Okay. I wasn't ready for this. Flops is floating point operations per second. So, a petaflop is 10 to the 15 floating point operations in one second. So that is, if you think about... That's a million gigaflops, is that right?
Starting point is 01:08:54 Gigaflop is 10 to the 9, a million gigaflops, yes. Yeah, okay. So if you think of a gigahertz computer as doing that many instructions, and if you can assume that you do like a flop in one hertz, then this would be a million gigahertz. I didn't follow that math. Something like that. But I mean, the idea is that each,
Starting point is 01:09:21 so floating point operations can take longer and often do take longer than integer calculations so in your computer's alu right you might be able to say i want to increase this number by one and for an integer that's straightforward like there are literal like gates that just execute that not instantaneously but within one clock cycle and handle the results but to increase a floating point number by integer value of one you can't just sort of directly manipulate some bits like the amount of logic you need to do for the various parts of the floating point number uh mean that it takes a little longer often. So depending on your architecture and the exact computers,
Starting point is 01:10:07 and this is why you have things like high-performance computer clusters that often, not always, but often run different hardware or might run certain kinds of processors that are different, is because of this ability to focus on floating-point operations. So if you're doing something like computational fluid dynamics, where you're say, modeling how air flows over an airplane wing, and you're trying to understand
Starting point is 01:10:33 where there's turbulence being generated. And so you're sort of figuring out how air molecules move around roughly, right? Then you're doing all of this with floating point numbers, and you need to do a lot of them because there are many, many, many things to be evaluated all at one time. And so that's where having these supercomputer clusters
Starting point is 01:10:55 measured in petaflops is they're basically running one gigantic distributed computation that is like, this isn't exactly right, but imagine if you were going to actually simulate every air molecule right so the simulation wants to advance one millisecond and you need to for every air molecule in the volume of interest you need to figure out where that air molecule would go would it bounce off of an object would it bounce off of another air molecule in this you know sort
Starting point is 01:11:33 of one millisecond interval and do that for every air molecule and then you update now you have the new state and now you need to keep doing that except when you bump into another air molecule you sort of have this cascade effect it's very complicated right so if you that's a sort of contrived example that's not how they do it but if you sort of think about that if you were running a simulation that did that that would be enormously computationally and expensive and so when you have these things measured in petaflops the supercomputers some things, you can let them run really long, but if you're trying to do weather forecasting, if it takes you five days to forecast what the weather's going to be tomorrow,
Starting point is 01:12:13 that's actually not useful. I mean, I guess it kind of is useful, but it's not useful for forecasting. No, it makes sense. I guess the thing I'm not sure about is if Julia is C++ and C under the hood, then like, does it count? Wait, but it's not C++. What do you mean by under the hood? So in other words, like the Julia operations, I mean, you know, obviously the farming to other machines and things like that are written in Julia or maybe written in some high level language. But under the hood the thing is doing the computation it's still calling to some blaz library or something i mean it's
Starting point is 01:12:50 ultimately calling machine code right but the the program itself the thing that is doing the high that is it's not scripting but doing the high level hooking together of all of the pieces is written in julia i think is what they're trying to say but i guess my question is why isn't every language on that list because with any language that has a c++ binding you could use you could run this the the the code really fast because you wouldn't actually be running i don't know java code you'd be running c++ just called from java you know what i mean no but that's not i mean you're i guess it is the difference between libraries calling a library and your
Starting point is 01:13:38 actual code so sure if you wrote one big library that was do really complex math for my problem in its totality and all I did was write a Java program that said call library, do my gigantic program. Yes, you could do that. Sure. Well, I guess maybe another way of saying it is
Starting point is 01:13:59 why isn't MATLAB on this list? Because nobody, that's what I'm saying because nobody describes the computations in MATLAB for this list? Because nobody, that's what I'm saying, because nobody describes the computations in MATLAB for supercomputers that run at that scale or hasn't according to this thing. Oh, I see. Because it's so big that it's really a distributed.
Starting point is 01:14:16 That's right. So there's no single machine that has 1.5. So it's a whole bunch of things, right? And so MATLAB has no like, or at least not built-in TCP support. Right, if you wanted to do it in Java, you're going to have to, like, well, I mean, again, if you're not going to do it in a sort of hacky cheat way, you would need Java to handle all of the networking communication back and forth.
Starting point is 01:14:37 You would have to have it doing the computation. Sure, at the lowest level, you say, like, transpose this matrix. Maybe it runs machine code that originally came from C++. But, I mean, so does everything else, right? Right, I guess. But the reason why they're not all on this list is because of the distributed part. Well, because of the distributed part and the complexity of the calculations and the suitability for it. Yeah, like, presumably, you know,
Starting point is 01:15:05 let's say you want to invert a huge matrix, right? So to invert a huge matrix, it's kind of complicated. Like you have to give entire rows and entire columns to certain machines of the matrix. And it could be that doing that is so slow when it's Java calling into C++ or whatever, that just doesn't work. And you can only really do that in Julia or by writing the whole thing in PRC.
Starting point is 01:15:36 Because you have to take a row of a matrix and memcopy it into a TCP buffer, and that's just not possible in java right yeah that's i so yeah that makes sense so basically if you want to do distributed high performance computing and it's not embarrassingly parallel because if it's you know if if you need to invert 10 million small matrices or a billion small matrices, you could achieve 1.5 petaflops. Like you would just give a small matrix to each machine and you just do this with as many machines as you need to get 1.5 petaflops.
Starting point is 01:16:17 But the issue is if you need to invert one huge matrix and it's going to take 1.5 petaflops to do that and all the data is kind of dependent on each other in weird ways then you're pretty much either writing julia or you're writing low levels yeah and i mean i guess the thing is to these machines the the computers i mean we look at the supercomputer list the supercomputers are very expensive to to build and so you're not going to just run, you know,
Starting point is 01:16:46 haha, cheeky, I want to get Java on the list. I mean, I guess they could. If someone cared enough to do it, they probably could write for any language, right? But the point is, these are typically used
Starting point is 01:16:55 for real processing that makes money or government is paying for or research or something because, you know, they need to be doing that and so yeah to spend the time and effort to develop for these highly customized systems you would want to know that you were going to get value out of it yeah yeah totally so i'm looking it looks like there are 305 in the whole entire world systems that run at a petaflop.
Starting point is 01:17:32 You mean clusters or just? Yeah, clusters. Oh, okay. So. Wow. Wait, you think that's high or low? No, no. I think, I mean, yeah i i think that that sounds reasonable so it is just
Starting point is 01:17:49 the 305th highest ranked so i went to the top supercomputer ranking list uh and i guess these are ones that are disclosed right so something like uh uh some uh uber data center not on uber maybe twitter data center or whatever maybe has some and it's not disclosed and it's not really set up but i don't think yeah i was gonna say i don't think those cali you could say aws is the most powerful cluster in the world and i mean technically yes except it's not like a coordinated cluster so so the 300 so i went to the i just scrolled down the sorted list until i found the last one that is still above a thousand teraflops and that is the 305th one and that one has 27 608 cores wow it takes 27 608 2.4 gigahertz xeon cores to get that performance. 26,000. 27,000.
Starting point is 01:18:48 27,000. Now in theory, because these are only 2.4 gigahertz xeons, in theory, you could probably have less cores. Oh, so here's one. So there are some on here with newer hardware that have only like 17,000 cores. That's still unbelievable. Here's one with 15 000 cores if each board has 64 cores i don't have my calculator up yeah let's just say each board has a hundred cores that's still a lot of machines right i mean that's 1700 machines yes
Starting point is 01:19:22 if i'm reading this list right yeah Some of these have 100,000 cores, yes. Wow, that's wild. But the lowest one I saw was sort of like 15,000 cores to get a petaflop. Yeah, so Julia works at... We're off on a tangent now. Yeah. But yeah, it's cool. It's compiled, which nowadays I think most things are compiled.
Starting point is 01:19:48 Like even MATLAB, I think it compiles it the first time you run it. Like Python has the PYC files. But they're still going to be pretty slow. But Julia, you know, it must compile down pretty quickly. You can tell they spent a lot of time on making it really fast. Yeah, and so I think it sounds pretty cool. I'll definitely try it out, you know, start using it for something and see how it goes. I'll report back.
Starting point is 01:20:22 All right. Until next time. Cool. Have a good one the intro music is axo by biner pilot programming throwdown is distributed under a creative commons attribution share alike 2.0 license you're free to share copy distribute transmit the work to remix adapt the work but you must provide attribution to patrick and i and share alike in kind

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.