WEBVTT

0:00:00.000 --> 0:00:08.700
<v A>Hosting provided by HostTornado. They offer website hosting packages, dedicated servers, and VPS solutions. HostT.net.

0:00:15.600 --> 0:00:20.660
<v B>Programming Throwdown, Episode 42, FORTRAN. Take it away, Jason.

0:00:21.580 --> 0:00:29.427
<v A>Hey, everyone. So we got some interesting listener feedback. We got a lot of interesting listener feedback. One of them in particular. Listener feedback.

0:00:29.427 --> 0:00:30.320
<v B>Is interesting.

0:00:31.460 --> 0:01:17.860
<v A>That's true. Just put it out there. We got some feedback of which all was interesting. And one in particular was strong versus weak typing. So somebody corrected me and said that Python, JavaScript are strongly typed languages. And I remember kind of having this debate with somebody at the time, but we didn't have smartphones, and so it didn't get resolved. So I went and looked into this, and it's actually really interesting. This one's like, as engineers and scientists, like our field is kind of very sort of pedantic and deterministic and sort of explained very well. That's kind of part of our nature. But this is one of those things that's completely up to interpretation.

0:01:19.765 --> 0:01:19.849
<v A>Wait,

0:01:19.849 --> 0:01:23.000
<v B>Wait. Are you saying you're wrong or not? Because I don't want to have to print another attraction.

0:01:25.140 --> 0:01:27.100
<v A>So actually, nobody's right.

0:01:27.713 --> 0:01:29.451
<v B>Oh, we're just kind of right. I

0:01:29.451 --> 0:01:59.180
<v A>Know. There's a gradient. On one side of the gradient is the most weakly typed languages, like Ruby or R, or languages like that, where there's no type system and there's no type errors. So for example, like in R, you can do like 'Patrick plus one.' And I think in R, it typecasts to string. So if you do like 'Patrick plus one,' you'll get 'Patrick one.'

0:02:01.080 --> 0:03:07.859
<v A>And so that is like, and also R doesn't have any type safety or type checking or types as you're programming or anything like that. So R is considered like very weakly typed, right? And it supports bare words, things like that. You can make Ruby similar. Like you can make some changes to Ruby and Ruby will support bare words. And bare words just means that you can say like, 'Jason go to the mall.' And it will just like interpret that as a string. It's kind of weird. So like at some point, your code can be a string, and it's kind of goofy. Anyways, so that's like very weakly typed. So then strongly typed is say like Java where, you know, everything is a type. The type is defined, you know, explicitly and at compile time, you know, by you. And you have to adhere to that type. You can't say, you know, 'Person A equals like new restaurant' or something, you know, like, except for some extenuating circumstances.

0:03:09.679 --> 0:03:20.820
<v A>Yeah, you think about that talk too. Except for some extenuating circumstances, you can't do that. It won't let you, right? So those are the two ends of the spectrum, right?

0:03:21.179 --> 0:03:23.540
<v B>So wait, you put Java on the other end? That's what you said?

0:03:24.059 --> 0:03:24.927
<v A>Yeah. I would.

0:03:24.927 --> 0:03:31.739
<v B>I have gone with like Haskell or something. Haskell. Or like the type type is actually used to great strength. But okay, it's okay. Go ahead.

0:03:32.480 --> 0:03:33.679
<v A>That's fair. I guess.

0:03:34.560 --> 0:03:37.500
<v B>Like something with a more in your face type system.

0:03:38.580 --> 0:03:45.220
<v A>Yeah. Yeah. I mean the type. So Haskell definitely makes better use of the type system, but I don't know if it's stricter or not.

0:03:45.360 --> 0:03:48.889
<v B>Okay. I don't know. Yeah. The exact axis this is being drawn on. It's

0:03:48.889 --> 0:05:34.060
<v A>probably the same level as Java. Anyway. So, Java is very strict. Like you can think of C++ as being kind of in the middle somewhere because, you know, it can be as strict as Java, but you can also just cast anything to void. You could, I guess in Java you could have everything as an object. It's like all of your classes just had objects. And then it would kind of. So one part of this is it really doesn't depend too much on the language, but how the language is most often used. Because you can make Java more weakly typed if you wanted to, but nobody actually programs that way. So the other part of this is I sort of always said it's weakly typed if there weren't any types known at compile time. So in other words, like Python, you could say X equals three. Then the very next line could say X equals Patrick. And that's fine. Like X can be whatever you want it to be. And so because of that, I would say Python, JavaScript—these languages are weakly typed. But these languages are more strongly typed than, say, R. Right? Because in Python you can't say Patrick plus one. You get a type error. So it really just depends on sort of where you draw the line in the sand. Like there's this gradient. And if you draw the line at, you know, being able to support bare words and automatically type casting everything so that there's no errors, then you're going to look at everything else as strongly typed. And so we drew our line where we drew it. But even like professors, things like that, there's no one has gone out and said, 'Okay, here's, here's what it is.' And so it's totally up to interpretation.

0:05:34.599 --> 0:05:37.020
<v B>That was a weakly typed argument.

0:05:39.299 --> 0:06:39.760
<v B>All right. Well, anyway, while Jason was trying to assuage his problem of feeling like he got it wrong, I'm just happy it wasn't me who got it wrong. No, please, no one write in and tell me the things I got wrong. I know it's everything. So I posted a link here, and you can just search W-A-T-W-A-T programming talk is what I searched to find it. And there's a lecture someone gave or a presentation at a conference where they go through various languages. And I think this made it around several times through the internet. So you've probably already seen it. Yeah, this is so good. It's a couple years old where the guy is, you know, giving kind of a slick prepared presentation about various languages and kind of using and abusing them. And he talks about bare words in there, like getting JavaScript to give you the Batman theme song by causing things to be not a number when they don't seem like they should return not a number. Yeah. Anyways, I guess JavaScript doesn't have bare words. I guess bare words is in Ruby.

0:06:40.520 --> 0:06:47.280
<v A>That's right. Yeah. And even then you have to do something special to, you know, enable that bug.

0:06:48.080 --> 0:06:53.200
<v B>Oh, I see. Oh, maybe that. Wait, you mean that internet talk I watched wasn't completely up front?

0:06:53.720 --> 0:07:03.760
<v A>Well, actually they are. If you see like the part where he's like, you can do this and then Ruby supports bare words, he actually like hacks together some function, which like does some ridiculousness. Yeah.

0:07:04.000 --> 0:07:05.420
<v B>Oh, okay.

0:07:05.540 --> 0:07:17.800
<v A>Well, I've always felt like if a language is weakly typed, like Python or JavaScript, then it's only good for kind of like... so there's a bunch of different definitions.

0:07:17.800 --> 0:07:18.880
<v B>You should say weaker typed.

0:07:19.520 --> 0:08:19.120
<v A>Yeah, it's true. Weaker type. So my litmus test is this: if the program is meant to run for an hour or longer, then you use a strongly typed language. Other people have said things like, oh, if it has more than a hundred lines of code, don't use Python. And so there are just various different metrics, but at a high level, the weaker the typing is, the better you have to check—either if it's weakly typed or if your program needs to run fast. In which case, if the program takes a second to run, then it really doesn't matter whether you get a compiler error or runtime error. Or you have to do a very good job checking all of the code paths. So if it's intended—the program is intended to run for like days and days—then hopefully there isn't some syntax error or some just goofy type error in some if statement that only runs once a day.

0:08:19.200 --> 0:09:16.400
<v B>Yes. That is something that annoys me about Python. I had written a tool that had worked flawlessly. My team was using it, no complaints. And it turned out there was this bug where if you—it was properly looking for the error to occur. It was reading data in. And if it saw improperly formatted something, it was supposed to print out what, why it was improperly formatted, except that the thing I was printing out was of a different type than I expected it. Like, I was assuming it would be a list and instead it was just an array, and it said it was just a string. So I was trying to kind of undo the wrapping of the list to print it cleanly. And no one hit this bug for however long. Then finally, we had some bad data come across, and it crashed Python instead of giving the nice printout of like, 'Hey, I saw you did something wrong,' and I'm going to close gracefully. It just stack unwound.

0:09:16.920 --> 0:09:19.680
<v A>Oh, really? You didn't get just a Python error?

0:09:19.820 --> 0:09:41.860
<v B>Oh yeah, no, no, no, but a Python error, but like the whole, you know, traceback, the traceback for Python. Right. That had been there for who knows how long. Yep. And a compiler, I guess, in theory, if there was stronger typed than it is, I would have been able to detect that the thing I was passing around wasn't of the type it once had been and that I had since changed.

0:09:42.540 --> 0:09:58.975
<v A>Yep. Yeah, exactly. I have a bunch of JavaScript code. I have that TitleWave, you know, the company wiki is on that. And I have the—I actually wrote a meme gen meme generator. So I work, we just make like funny jokes and send them to each other. And I'm thinking about, you

0:09:58.975 --> 0:10:02.040
<v B>really want to get fired. I know.

0:10:02.319 --> 0:10:39.840
<v A>I'm actually thinking about—there's this language called TypeScript. We've talked about TypeScript before, but the cool thing about TypeScript is you can just start with JavaScript and then slowly add type annotations. And eventually everything is statically typed. If you don't have a type, TypeScript will kind of complain, but not too loudly. So you can sort of migrate slowly. I want to do that because for this—what you talked about—like occasionally someone crashes the wiki for the whole company. And it's because it's like some area of the code that I hadn't really tested well, or just some goof that would have been caught with type safety.

0:10:39.840 --> 0:10:45.000
<v B>So it's not strong or weak typed. It's stronger or weaker typed.

0:10:45.600 --> 0:10:50.840
<v A>Yeah, that's right. Yeah. Before you say something is strongly typed, you have to put your reference point.

0:10:51.180 --> 0:11:12.027
<v B>So what would be the most strongly typed would be like if you only allowed one type? Um, like a whole program, like that one where it's all, uh, it's all music or something. There's only one operation, right? Oh, what is that called? It's like the computer built only out of NOR gates. Oh yeah. Anyways. Yeah. I forgot what that's

0:11:12.027 --> 0:11:36.968
<v A>called. But I don't know if like having just one type makes the, um, I mean, I guess a language that had no polymorphism, right? Would be more strongly typed because you couldn't really do anything goofy. Um, like Java has, you know, object, but, but nobody actually uses it unless like it's very specific circumstances. So, uh, so I would say Java is like,

0:11:36.968 --> 0:11:43.904
<v B>I guess if you had only one integral type, like only unsigned 32-bit integers. You're talking about

0:11:43.904 --> 0:11:48.120
<v A>like Fortran, like the early version of Fortran. So yeah. Shhh, shhh.

0:11:50.380 --> 0:11:51.740
<v B>Foreshadowing. Foreshadowing.

0:11:54.040 --> 0:12:03.060
<v A>That's called, uh, that's called Jason not, not picking up on the. Spoiler alert. Oh my God. All right. That's funny. To the news.

0:12:05.839 --> 0:14:03.160
<v A>Oh man. Okay. So, first news article is this pretty cool thing. It's called Disc. So, um, so there's Redis, and Redis is pretty cool. So actually let's step back even further. There's Memcached. Memcached was written by the, um, I guess CEO or like head engineer of LiveJournal, which was like a social network that was popular, you know, like, I don't know, 15 years ago. Um, and what Memcached does is just simple, like key-value lookup. And if you have like keys that are accessed very frequently, Memcached does exactly what it says. It caches them in memory and then doesn't have to go to disk. Um, and if you have some key-value pairs that are not used very frequently, then Memcached falls through and then you would then go to your database or what have you. And so the idea is, you know, your logo, your company logo, which everyone sees every time they load a page is accessed very frequently. So, um, Memcached would just like for free in a sense, take things like your company logo and, and, um, cache them in RAM. So you wouldn't have, it optimizes your, uh, reduces your database overhead. So, um, so Redis is basically Memcached plus one. So it's just the interface is much easier. It's much cleaner. There's, um, it can do like some cool persistence. So, you know, if your machine dies, it can store the disk. So when the machine comes back up, it doesn't have to like rebuild the cache on the fly. Um, it has a bunch of cool things like that. And it's just much more modern. Um, so now if you look at the, um, message queue space. This is where you have different machines. They want to pass messages to each other. Um, you know, the same kind of thing where there's RabbitMQ. There's Kafka. There's Camel.

0:14:03.520 --> 0:14:39.825
<v A>There's like a bunch of these, but all of them are kind of old and antiquated or they're slow. Um, so finally someone kind of went through and built Disc, which is a completely in-memory message passing subsystem. It looks pretty cool. Um, I'm going to definitely look into it. And so I can tell you guys more in the future after I've done some study on it. But, um, it looks like, it looks like it'd be pretty useful. I mean, a lot of people right now use Redis for message passing, but it's not really designed for that. So they're kind of, you have to do like a lot of trickery to make it work. Well,

0:14:39.825 --> 0:14:57.966
<v B>message passing is, needs a lot of tuning. Like the, all the different options, like messages being re-deliverable if the host, the recipient dies or that kind of configurability. But this one has a giant warning that it's still alpha state and don't use in production. Right.

0:14:58.440 --> 0:14:58.720
<v A>Yeah.

0:14:59.000 --> 0:15:16.600
<v B>Uh, so I never know when stuff says that, if it really means it. Cause a lot of software says that and it is like, everyone uses, like everyone uses the alpha version of the next release because it's so much better. And it's been out for a year versus like, Oh no, literally I wrote this last weekend and it's probably awful. Don't try it.

0:15:17.280 --> 0:15:44.541
<v A>Yeah. That's the thing. Like, you know, obviously you're fixing bugs as you get them. And so like, as time goes forward, you've, you know, like in version two, you have more bugs fixed than version one. That is a guarantee because the number of bugs fixed is just monotonically increasing. Right? Or at least month is not decreasing. But as you said, like, you know, the alpha version has a whole bunch of new features and presumably adds new bugs. And so it just, so

0:15:44.963 --> 0:15:46.499
<v B>the number of bugs might

0:15:48.692 --> 0:16:12.081
<v A>be higher, but yeah, I think like what you said, you kind of have to read the documentation and just try and read between the lines and figure out if the person really means, 'Like, this is alpha because I hacked it together at TechCrunch Disrupt. And, uh, I was, you know, drunk at the time,' or 'This is alpha because, you know, I haven't formally proven all of the lines of code yet.' Like, or what happens more

0:16:12.081 --> 0:16:21.660
<v B>is like, 'This is a breaking change and I just don't want to deal with the community at this time. So I want to just keep hacking away and do it all at once and rip the band-aid off,' which is what happens to a lot of projects.

0:16:22.199 --> 0:16:22.520
<v A>Yeah.

0:16:22.719 --> 0:16:27.620
<v B>When I push this out, a lot of people are going to be mad. So I want to make sure I really know what will change and then I'll push it out.

0:16:28.560 --> 0:16:41.400
<v A>Yeah. That's what happened with Spark. Like for a long time, Spark was just kind of very unstable. And then at one point, at some point they said, 'Okay, like, let's just kind of, you know, refactor the whole thing and make it nice and clean.' Clean.

0:16:44.144 --> 0:17:57.060
<v B>So, recently Amazon's quarterly earning report came out, and our obligation to give you news not related to programming—their stock jumped through the roof. One of the main reasons, other than people just saying the stock went up because the stock went up, trying to pin it on some reason because stock movements always have to have a reason, was that new, Amazon for the first time reported their revenue from their web services. So Amazon Cloud, AWS, Amazon Web Services—I guess, AWS. Yep. They are selling servers, renting servers to other people to be able to run on. And, and, you know, it's become really popular. Everyone probably has heard about it. But before it had always been kind of just under other parts of the business, but this quarter they finally broke it out and they had a revenue of $1.57 billion, which is a lot. But in true Amazon fashion, they managed to take a lot of dollars and profit much less dollars, $265 million. So $265 million is still a lot of money. But $1.57 billion is really a lot of money.

0:17:57.160 --> 0:18:05.025
<v A>Like Amazon, this is the thing I don't understand about Amazon. They're known for like really good sort of supply chain management and

0:18:05.025 --> 0:18:06.880
<v B>having very low operating costs.

0:18:06.915 --> 0:18:12.720
<v A>Yeah. They're also known for blowing through most of the revenue. I don't understand how that's possible.

0:18:14.040 --> 0:19:27.400
<v B>I don't know this. Yeah. I mean, this is like what they're known for, but part of it is, I think they have a strong belief in growing and not sitting still. So they could sit still and make a lot more money, but they want to keep hiring engineering talent, investing in warehouses, pushing delivery times down. I was thinking about that the other day. You know, I have Prime and I had to start paying taxes. And now eventually, because of that, like a lot of—they took a lot of flack, a lot of people left it. But now I actually get a lot of packages on one day or on Sunday because they've put warehouses in my state, California, because they lost the tax shelter thing, or that's not what it's called. Yeah, that's right. So like, I think they are willing to aggressively pursue things which are expensive for kind of securing future total income growth, even if it means that their profits will be down for a while. But they feel like this is how they can't—they don't just become another cheap place to buy stuff, right? It's why they didn't get beat out by eBay or by someone else because you still go to Amazon. They still supply millions of products, deliver them in a day or two. People really like that, but it's expensive to keep people. People would leave for any reason. So you can't give them even one. Yeah.

0:19:28.820 --> 0:20:19.219
<v A>Amazon also does a bunch of really cool stuff. They had this thing where they took sort of like the head of their distribution, like the most commonly sold items. And then they took their population and they tried to estimate like the likelihood given, you know, a city of a million people. What is the likelihood that one of them will buy like one of these popular items? And once that's high enough, they just ship it. So in other words, like, like HDMI cables, like they're already sitting in the distribution center closest to your house. Because the likelihood of one person in California wanting an HDMI cable, like in Central California, wanting an HDMI cable is so high that they can just always keep a supply there. And then literally they just have to drive it like 10 miles to that person.

0:20:19.699 --> 0:20:27.219
<v B>You can think about the same thing as Walmart knowing that the first cold blizzard headed to a town, a bunch of people are going to go buy heaters.

0:20:28.520 --> 0:20:33.154
<v A>Yeah, right. It's like that, but much faster. But

0:20:33.897 --> 0:20:44.039
<v B>Anyways, they're AWS. I mean, they've continued to push and be a market leader, and they are the biggest cloud services provider by a pretty good margin. And this chart

0:20:44.039 --> 0:20:49.118
<v A>is super interesting. Like they actually even though they're the biggest, they're only 28%.

0:20:49.118 --> 0:21:11.444
<v B>It was crazy. I don't know. Jason's looking at a pie chart that's showing the breakdown of percentage of cloud revenue, cloud businesses. And there's a huge chunk which is just kind of like everybody else, but it's a big chunk, so I don't know exactly how this is from The New York Times, how they're classifying what constitutes a cloud service, yeah assuming

0:21:11.882 --> 0:21:31.542
<v A>they do it in order. Then what that means is 43% of the market is consumed by companies who have less than three percent each. Yes, which is so that means like yeah, at least like 12 companies that are all sharing, you know, two or three percent, but like

0:21:31.542 --> 0:21:39.929
<v B>on here there's no like Dropbox isn't on here, right? But like given these other names like Salesforce, I would imagine Dropbox is probably on here. I think.

0:21:39.929 --> 0:21:42.038
<v A>Dropbox runs on Amazon, right? Doesn't it? Oh, does.

0:21:42.038 --> 0:21:51.100
<v B>It. Oh yeah, well Dropbox, but like if you had something like that, right? Like if you had Dropbox or Netflix, right? They would be big contributors. They haven't run on Amazon, I think.

0:21:52.922 --> 0:22:06.254
<v A>You're right, but yeah, that's super interesting, man. Unbelievable. I had no idea that. I always thought actually, I thought Amazon was much larger. Like I was expecting Amazon to be like 50%, and then they're not to be much up. Yeah, but

0:22:06.254 --> 0:22:14.016
<v B>look how much money that would be if they were 50%. That would be like over three billion dollars. Yeah, quarter wow.

0:22:14.674 --> 0:22:23.280
<v A>A quarter wow! Unbelievable, and it's very consistent money too. It's not like you know you have to wait for the holiday season or something.

0:22:26.774 --> 0:22:27.972
<v B>Cool. So that's

0:22:27.972 --> 0:23:21.516
<v A>Awesome. Yeah, so my next article is jq, which is a command-line JSON parser. So a lot of people definitely if you're doing any web stuff, but even if you're not, you're probably using JSON for something. It's like XML, but it's much more terse, and you don't have to get like matching the opening and closing tags, which is always a nightmare. So definitely, you know, if you want to store some data, JSON's a good way to go. This is a pretty cool command-line parser, so think of it as like a sed tool for JSON. So you could say, 'You know, hey, go in and rip out this one object,' you know, search for objects, filter out objects, things like that. It looks pretty cool. I'm definitely going to give it a shot. I actually just found out about it today, but you know they have some—they have some examples here, and I kind of

0:23:23.204 --> 0:23:23.920
<v B>I find myself

0:23:23.920 --> 0:23:52.280
<v A>often needing stuff like this to on like server side, like just to do some analysis. Like we use a lot of MongoDB, and in MongoDB, you know everything is a BSON, but it's really a JSON stored in binary. But from your perspective as a database client, MongoDB is storing, you know, JSON documents. And so if you want to dump it to disk and then take a look at it, this is a pretty cool, pretty cool tool. So yeah.

0:23:52.280 --> 0:24:02.691
<v B>Check it out! It's called jq. I may or may not have done something awful. I wrote a command-line tool that took a JSON string as a command-line argument. No, that's good. No.

0:24:04.834 --> 0:24:05.661
<v A>It's crazy. Yeah.

0:24:06.218 --> 0:24:19.465
<v B>I mean, I did it. It was—it worked really well, and I thought it was an elegant solution. But when I told people like, 'Oh yeah, this tool,' they're like, 'You know what parameters does a tool take?' I'm like, 'It takes this, this,' and then it takes a JSON string.' And they're like, 'What?'

0:24:21.439 --> 0:24:44.963
<v B>I was like, well, so it was like a templating system. So you have like a template file, and you're trying to run something on it, and the JSON string holds what to replace in the template, but you could name it many, many different like the individual variables, many things. And it was kind of the fastest way to say, 'I want to provide a whole list of replacements dynamically,' and it—you don't ever create the string by hand, like you typically run this tool from another tool.' Um, right. Right. But

0:24:44.963 --> 0:24:45.537
<v A>Yeah, I was.

0:24:45.537 --> 0:24:56.927
<v B>Kind of like people looked at me funny when I was like, 'So yeah, one of the command-line arguments is a JSON string.' So this is the reverse of that: the command-line tool that parses the JSON string. Yeah, I

0:24:57.602 --> 0:25:12.100
<v A>mean I think that like if it's if it's a simple thing where it's just, you know, a list of objects or maybe just—I mean, a list of numbers, or it's just like one object, then like yeah. I mean, why would you do that parsing yourself when you could just

0:25:12.100 --> 0:25:29.580
<v B>Tell that was it. I could have written like arbitrary command line parsing, like right? Like name colon replacement, name colon replacement. Like yeah, why would you do that? But it comes from an already comes from a file that is anyways there's a there's reasons for it, but I felt kind of like there's probably a better solution. I just don't want to wait.

0:25:30.458 --> 0:25:39.689
<v A>Around yeah. I mean JSON this is a great idea for that. I mean yeah, depending on the circumstances, it might be better to read from a file that has the JSON in it there.

0:25:39.824 --> 0:25:41.629
<v B>Was reasons? I couldn't do that, but fair.

0:25:41.849 --> 0:25:44.970
<v A>Enough. Fair enough. Okay, you got the next one.

0:25:45.399 --> 0:27:06.060
<v B>Yep. So this one is a little bit old now, but I thought it was really interesting. So GitHub came under denial of service a couple weeks ago. And it turned out that specifically a website hosting circumvention for the firewall of China, the Great Firewall of China—whatever it's called, the Chinese Firewall—that prevents people inside of China from getting censored news. It was a I guess like a proxy for it, and it was like getting pretty well known. And the Chinese government now in retrospect seems like it got mad about it, and so they made an attack against GitHub specifically this page. Of course, you know China has like many many computers, and it actually looked like this one was coming from not a single isolated place, but all the computers in China. And further analysis showed that Baidu, which is the search engine—the biggest search engine in China—was everybody who ran a search on Baidu. So, you know, lots and lots of different computers. They would inject an ad, and part of that ad would be to go ping, you know, retrieve data from this website that they were trying to take down. And so it would do it every two seconds, so as long as you were on the search results page, it would keep hitting the GitHub server, and they would do this connection.

0:27:06.060 --> 0:27:09.885
<v A>Between Baidu and oh, Baidu is the Chinese web search, right? But

0:27:09.885 --> 0:28:01.287
<v B>What it was is a website hosted behind the firewall, and no one knows exactly how they're doing, but I guess suspected was that they when the firewall was serving the page, it was automatically swapping the ad. So Baidu wasn't like necessarily in on it, but the firewall was able to switch the ads dynamically. Oh, interesting! So everyone who was going to Baidu was getting this ad injected replacement, right? Um that was causing this. And so GitHub's response, which was pretty good, was they in the string being pulled, they added a JavaScript alert like 'Please stop doing this' or something. And so if your computer was repeatedly trying to do this, it would get an alert, and the JavaScript processing would stop until you cleared the alert, which meant that each person's computer would only do it once until they clicked okay. And it would annoy.

0:28:01.287 --> 0:28:03.582
<v A>People like people would immediately be like, 'What?'

0:28:03.632 --> 0:28:14.534
<v B>What is this? Yeah. So it is interesting that the Chinese government lashed out at GitHub because you don't think of GitHub as being like I don't know politically active, but yeah, they probably.

0:28:14.534 --> 0:28:23.477
<v A>Just didn't know what it was like. They didn't know that GitHub was just open source. Anything? They probably thought it was specific to this thing. Well,

0:28:23.477 --> 0:28:46.022
<v B>Maybe the Chinese government had asked GitHub to take it down, and GitHub was like, 'No.' And I mean, it could be any number of things. I don't know the story there, but it was just interesting to read about like how the attack went down, finding it, figuring it out. It didn't kind of scary that like the Chinese government was attacking a corporate like a company, right? Like not another government. Yeah, it's

0:28:46.022 --> 0:28:47.085
<v A>Unbelievable and then you

0:28:47.339 --> 0:28:58.004
<v B>know the U.S doesn't necessarily respond like, 'Hey, stop attacking GitHub, or we're going to attack you.' Like, but yeah, it—yeah, I thought that you could.

0:28:58.004 --> 0:29:10.069
<v A>Like, I guess so. Just looking at it mathematically, it seems like you can trivially break through the Chinese Firewall just by using some kind of BitTorrent-based internet browser, right? Well, I—

0:29:10.457 --> 0:29:20.987
<v B>Mean, I think there's lots of ways around it for people who know or want to get around it. But the problem is there's still intimidation: 'If you circumvent this, we will come and find you.'

0:29:22.034 --> 0:29:25.324
<v A>But they can't, right? I mean, you could make it like pretty untraceable.

0:29:25.324 --> 0:29:27.788
<v B>Right. Yeah, but are you going to bet your—

0:29:29.239 --> 0:30:06.887
<v A>Life on it? Actually, you know the hard part is not getting the information, but then it's not using it. Like, in other words, if I use like a some kind of Tor browser to read CNN, now I know things that nobody else in China knows. And so if I start telling my neighbors about this cool CNN article, now all of a sudden—like that's how you're going to get caught. Right? It's like when you're eventually, you're going to tell somebody who's like sympathetic to China, and they're going to tell the police on you, and then you're going to go to jail. Like that's actually how you'll get.

0:30:07.242 --> 0:30:41.127
<v B>Caught? Yeah, I've tried to talk to people about it, and I always get different responses from people who have spent time in China or lived in China or born in China. But you know, I think part of the Chinese government is just not trying to keep a determined individual from being able to see the information, but to kind of just stop it from entering the zeitgeist of society. You know, it's not become like the average person just hearing a whisper of a word on the street can't just go look it up and figure it out. Like you'd have to be seeking it out, going determining that you're going to go find it.

0:30:42.629 --> 0:30:54.677
<v A>I was working once. I worked at this company where they blocked like a bunch of pages on the internet. It's like Gmail was blocked and things like that. And I are—

0:30:54.677 --> 0:30:56.567
<v B>More than one such company.

0:30:57.377 --> 0:31:29.560
<v A>Yes. Yeah, I wrote this fork of Google Chrome called Google Crime Chrime.exe, and it was just a fork of Chromium that would just basically bounce the data off my computer at home and let me get on Gmail. I found out like a few months ago that there are people at this company still using it. Like, and it's not updated, so there's like there's a bunch of people who are still using like Google Crime circa you know seven years ago to get on Gmail.

0:31:33.878 --> 0:31:35.009
<v B>But everyone has smartphones now.

0:31:35.987 --> 0:31:45.260
<v A>I know, right? That's what I said. But they're like, 'No, well, you know we want Gmail on the desktop,' and this is the way to get it. So why—I guess it's like, you know the.

0:31:45.260 --> 0:31:56.305
<v B>Like stuff has come so far on mobile now. Like I have my phone and it gets you know automatic notifications without even using that much data. It pushes them to me; it just pops up a notification like I don't need it on my

0:31:57.149 --> 0:32:14.659
<v A>desktop. I think it's like it's just the risk reward, right? Like they feel like—I mean, the Google Crime stuff is already done, so there's no risk, and they don't feel like they're gonna get fired or anything. And so it's like there's just virtually no risk, and so even if the reward is just marginal, like you have Gmail on your desktop and your phone, they just do it anyways.

0:32:14.659 --> 0:32:27.068
<v B>I would say these people should find a new job. But if they're just using your tool from seven years ago instead of rewriting it for themselves to get it updated, fair, fair point. Those

0:32:27.996 --> 0:32:28.907
<v A>people are.

0:32:29.025 --> 0:32:35.809
<v B>Probably listening. Anyways, all right, time for Book of the Show.

0:32:35.940 --> 0:33:52.860
<v A>The Book of the Show. So, um, oh, I had something I really wanted to talk about, but uh anyways, we can save it for next show. But actually, we'll talk about it after Book of the Show, just a very short interjection. Um, so my Book of the Show is A Theory of Fun in Game Design, which is pretty cool. This book was loaned to me from a friend, and basically, it goes over um like a theory of fun, like if you were making a game, then like—like—you know, you might ask someone like, 'Is this game fun? Is Pac-Man fun? Is GTA V fun?' You know why are these things fun? These are like super hard questions at least for me because it's like deeply psychological and things like that. Um, but this tries to formalize it, and I felt like it did a pretty good job. It's pretty interesting. Um, you know, obviously a lot of it comes down to like patterns and the satisfaction that you know your brain gets when it um encounters different patterns, when it recognizes the pattern and things like that. Um, it also just talks about game design at a high level, and it's pretty—it's a pretty good read. It's very short book; it's almost written like a comic book, so it's not it's not heavy or anything, but uh yeah, it's pretty cool.

0:33:52.860 --> 0:34:01.639
<v B>A Theory of Fun. I feel like it's like weaker—strong. It's not fun; it's funner or more fun or less fun.

0:34:02.108 --> 0:34:04.875
<v A>Is Pac-Man funner than GTA? The internet tells.

0:34:05.787 --> 0:34:09.500
<v B>Me. All people do in the new GTA is find crazy ways to.

0:34:11.372 --> 0:34:13.954
<v A>Die. Yeah, yeah, pretty much it's all the only.

0:34:13.954 --> 0:34:23.168
<v B>Videos I see about it. One summer that oh wow, look how realistic this is, and like in-game photography—that's one thing, and the other thing is like look at this crazy way this guy died. Yeah.

0:34:23.944 --> 0:35:43.324
<v A>GTA. I feel like did a huge disservice. I don't know if this is true for the public at large or just me, but you could pre-order GTA V a long time ago—like I think like six months ago—you could pre-order it, and they would give you like three million in fake like GTA V money because I guess the way it works is like even when you're playing single player, you need an internet connection. And so it keeps you from cheating even in single player, and you have to use in-game currency to buy things, right? Now you can't—you can't actually spend money. It's not like a freemium or anything like that. You can't turn real money into in-game money, but the in-game money has to be kind of respected. I'm assuming GTA 6 will have something where you could spend real money; it's like going that path. But the—but so yeah, so they gave you like three million, I think, in fake money. Then like about two months before it came out, I saw some article about it, and I was like, 'Oh, that's cool.' So I went to see if you know maybe I'd pick it up, and they had like said that you get one and a half million in fake money because basically like you're no longer an early adopter. So they only gave you that in fake money, and I kind of felt screwed, like, 'Hey, just because I didn't pre-order it earlier, you know, you're gonna like screw me out of 1.5 million of fake money.' So I didn't buy it, and then it came out now.

0:35:43.324 --> 0:35:44.556
<v B>You got zero, and then yeah.

0:35:45.130 --> 0:35:54.512
<v A>And then it came out, and a bunch of people like, 'Oh, this game's great!' So I was like, okay, maybe I'll buy it. But now there's nothing. Like you start with zero, so now I'm like, forget it. I'm gonna wait until no.

0:35:54.512 --> 0:35:59.760
<v B>They've got you because now you're gonna buy, you're gonna pre-order GTA 6 the first day it's available for pre-order.

0:36:00.402 --> 0:36:04.350
<v A>Oh, that's their long-term strategy. Yes, maybe, but you fell for it.

0:36:04.350 --> 0:36:05.025
<v B>Five. It did.

0:36:05.025 --> 0:36:08.755
<v A>Not work because now I just feel like why would I play when I'm

0:36:08.755 --> 0:36:09.767
<v B>gonna borrow it from

0:36:09.767 --> 0:36:17.091
<v A>a friend. I'm gonna actually wait till it goes on sale instead of spending the sixty. I feel like that's how I'll lose three.

0:36:17.091 --> 0:36:17.834
<v B>million in virtual

0:36:17.834 --> 0:36:22.744
<v A>yeah i'll lose three million in virtual currency but i'll gain 20 dollars in real currency

0:36:22.744 --> 0:36:25.883
<v B>But you'll still have spent the money, so you'll still have

0:36:25.883 --> 0:36:28.600
<v A>lost. Yeah, and their margin is huge, so

0:36:30.220 --> 0:36:53.305
<v B>Yes, we—this would lead perfectly into talking about the new kerfuffle about Steam charging for mods, but we'll save that. My book—that's right. I saw that my book of the show is 'The Programming Title Monster Hunter International.' This is not a book about programming; I lied. Um, okay, it is yet another science fiction fantasy novel. Oh.

0:36:53.676 --> 0:36:54.469
<v A>Okay, this.

0:36:55.060 --> 0:37:49.026
<v B>One happens to be—I guess it's considered horror fantasy. It's everything that's got monsters is considered horror, but this is not. It's not very dark; um, it's a very light book. And I was reading it, and it was just like, 'This is a really fun book.' Um, I read The Martian, and I thought The Martian was really fun. Um, yeah, very light-hearted book. I thought like it was serious, but you know, like also I laughed out loud a lot. Um, this book wasn't quite as funny, um, but it was really good. And you know, just a good fast-paced, goofy story, almost like you'd see in a movie. Um, and I read a lot of like deep thought-provoking science fiction fantasies. This wasn't like that per se, um, but it was a lot of fun to read. And then later I read an article about this guy, and I guess that's what he says he's trying to do is just write light-hearted stuff, like why do we all have to be artistic and literary? Why can't we just write good, fun-to-read stories? Um, cool. So that sounds great. What's the theme?

0:37:50.376 --> 0:37:52.958
<v A>It looks like it's like a vampire, yeah.

0:37:52.958 --> 0:39:08.760
<v B>It's basically about like a guy who's just almost kind of like a superhero. Not—he doesn't have like superpowers, but he just like destroys monsters. So like there's monsters in the world. You know, the government's trying to keep it secret, and this guy like hunts them, and there's other people that hunt them too, and he you know joined forces, and something really bad is happening, and they're gonna work to try to stop it. So literally like every TV show you've ever seen. Um, but I listened to it on Audible because like we mentioned last time—that's how I do most of my listening even though I say reading because I don't have time to read; I'm way too busy or I'm lazy, yeah, to read. So I listen to most of my books. Uh, and I use Audible, and we have Audible as a sponsor now. So if you're interested in getting a month of free Audible, you can check out audibletrial.com/programmingthrowdown—programmingthrowdowns all lowercase, all one word, really long name. Sorry about that. Um, audibletrial.com/programmingthrowdown. You can get a month free. It's pretty awesome. I recommend it. After your month, you get to keep the book. Um, I have many books now, lots and lots of books because I have a long commute, and I enjoy them. There are other ways to, you know, your library has, you know, audiobooks too, but um yeah, you.

0:39:08.760 --> 0:39:09.807
<v A>Had the Overdrive.

0:39:09.807 --> 0:39:17.468
<v B>Yeah, but it's—it doesn't have nearly as many, uh, and you have to kind of wait for them to be available, which is kind of annoying. And I'm really lazy, so yeah.

0:39:18.615 --> 0:39:24.960
<v A>You can support the authors that way too, and support us, and support us, and support our bandwidth issues. Okay, is it time for?

0:39:25.905 --> 0:39:29.000
<v B>Your sideline note, or are we moving on to twelve of the.

0:39:30.006 --> 0:39:33.027
<v A>Show? Um I totally forgot my sideline time for.

0:39:34.579 --> 0:41:14.513
<v A>Tool of the Show? Tool of the Show. I'll have to make it up to you guys. Oh man, I totally failed on that. Oh well, next time I'll have to write it down. Tool of the Show. My Tool of the Show. So um actually, so this is interesting. So I always just used whatever default shell, um, you know, is provided to me, like usually like Ubuntu—it's Bash. Um in Solaris, it's like CSH or what have you. Um but then a co-worker showed me Oh My Zsh. So this is almost like a two-parter. A co-worker showed me Oh My Zsh, which is another great tool um for Mac or Linux, which basically converts your shell to Zsh, but then also adds a bunch of other really cool things. And so I've been using Oh My Zsh for a couple weeks now. I really love it. It's amazing. If you're running Linux or Mac, you should definitely get that. But uh what to do on Windows? Right? So um I have one computer, the computer that I use to do all my main Hub development is running Windows, and uh that as I said, I'm doing development, so I kind of want to have a shell that doesn't—that isn't terrible. And so this is amazing. It's called Baboon, and it is basically think of it as Oh My Zsh for Windows. So it kind of rolls up Cygwin and Zsh and Oh My Zsh all together into one program. Uh it's easy to install. Um and then you just start it up, and you have this like pretty awesome um um know shell like you would have on a Mac or on a Linux computer on your Windows desktop. It's pretty sweet.

0:41:15.137 --> 0:41:19.920
<v B>You've had a lot of good tools, but of ones I didn't know about. This looks pretty.

0:41:21.179 --> 0:41:41.834
<v A>Awesome. Yeah, yeah, this is pretty killer. I mean, the whole point of it is it's for Windows, so if you're not a Windows guy, this is like completely useless. But if you're not a Windows guy, get Oh My Zsh and Oh My Zsh, you will be amazed at your productivity. If you are a Windows guy, use Baboon, and it is pretty epic. I'll have to try.

0:41:41.952 --> 0:42:10.032
<v B>This at home, at work. I tried switching to both Zsh and Fish, and we should talk about shells sometime. Anyways, from away from the default shells, away from the default Bash, but unfortunately my team has a lot of people who wrote really gnarly awful Bash scripts to set environment variables for building our project, and so yeah, like they won't—they're just so specifically Bash-oriented, and I might Bash you. You can always do.

0:42:10.032 --> 0:42:11.264
<v A>Bash, and then the command.

0:42:11.753 --> 0:42:27.548
<v B>No, because it sets local things like it sources the scripts, and you need to be able to execute them. I couldn't figure out how to make it like out back properly. Like it's so weird. I don't—so I would have to run two, and I've just never gotten around to it, or maybe I just don't know enough to run one from the other. Yeah.

0:42:28.206 --> 0:42:44.794
<v A>One of the cool things about Oh My Zsh is you have one global history for all your, you know, terminal tabs. But it's even better than that. Like the first history is local, and then after that it's global. So if like you want to just rerun the last.

0:42:44.794 --> 0:42:45.537
<v B>command on like.

0:42:45.537 --> 0:43:07.103
<v A>Two different shells, like it'll do that. But as soon as you go one more command, it goes into the global history. It's very clever. But I because of that phenomenon, like I'll usually have like one or two tabs that are in Bash, and so that's because these are things where like I don't want them to pollute my history, and so you could do something like that.

0:43:07.103 --> 0:43:17.886
<v B>But it's not ideal. Fish seems like mostly pre-configured Zsh, and I like there that when you start typing something it auto-completes to the right of your cursor like a browser.

0:43:18.949 --> 0:43:21.059
<v A>Oh wait, it's called Fish, like.

0:43:21.278 --> 0:43:24.062
<v B>The animal. Yes. Okay. Anyways, F-I-S-H. Yes, Fish.

0:43:24.687 --> 0:43:26.475
<v A>Shell? Yeah, I haven't even heard of that.

0:43:26.475 --> 0:43:38.355
<v B>Shell. Yeah, so like if you start typing like ls and then the start of a name it'll auto-complete to the right, and you can just push right arrow to choose that, and I think you can do the same thing in Zsh, but it takes extra.

0:43:38.912 --> 0:43:52.682
<v A>Configuration. Yeah, oh my Zsh by default doesn't do this like, but you can hit Tab. You can even auto-complete like get branches and stuff like that. It's pretty awesome, but it does not—uh anyways, does not do that. I said it's enough.

0:43:52.935 --> 0:45:43.365
<v B>Is all very applicable because my tool of the show this week is Crouton, and Crouton is a project that allows a Chromebook to install a chroot Linux distribution so that you can—and now a newly added feature is you can run an XFCE or an Ubuntu, an XFCE version of Ubuntu, or straight what is it? I guess Unity Ubuntu um in a window application window on your Chromebook. Oh cool! So like a Chromebook is kind of limited. I wanted to be able to, like, in the evenings, you know, just like on the couch, like on my laptop. I normally just use my Chromebook for browsing the web and typing, or I use my iPad most of the time, but I have my Chromebook out and I want to be able to, like, hone my programming skills on the couch, and so I wanted to be able to not just have to SSH into my desktop, but actually, like, on the go or whatever, be able to use Linux on this Chromebook because I don't want to buy another laptop just for this purpose. And this is great! It works awesome. So I yeah, I use XFCE and it just opens it up as like a new window. It shares once you get it configured. It's a little wonky, but shares copy and paste between the Chrome browser and the Chrome OS part, and the window that is Crouton. You can paste stuff in and get it configured, run things—you know, script download whatever share between the two. Um and it's really awesome. The only snag I've run across is because my Chromebook I have, and I think most Chromebooks are ARM, and most people's desktops are some 32-bit or 64-bit Pentium Intel processor or whatever x86_x64. There's some tool—most of the tools, the common tools like in Ubuntu repositories, are compiled for ARM, but some stuff is missing. Um oh it's

0:45:44.327 --> 0:45:49.086
<v A>Wild that Chromebooks are ARM. That's they're probably the only laptops that are ARM that I—that are.

0:45:49.086 --> 0:46:12.760
<v B>Don't know that they are all ARM, but I think many of them are. The cheap ones are. And now Windows is starting to push to try to have ARM support as well. But yeah, so like if you download for source sometimes it won't compile for ARM if you're using weird stuff, and apparently there's a way to use QEMU to do on the fly translation, but if you're doing anything more than like a simple task, it's just going to take forever.

0:46:12.760 --> 0:46:27.494
<v A>Well, I wonder if you know, like because Android runs ARM, so I wonder if you're using a Chromebook to do Android development if the Android emulator runs way faster? Because you actually don't need an emulator; it's now a simulator. No idea.

0:46:27.494 --> 0:46:53.240
<v B>I've not tried it, but check it out Crouton. It made my Chromebook suddenly much more useful than it was before to me. Um yeah, that's even though it's another one of those like I was saying before the show that sometimes Linux frustrates me because it takes too long to just get something working, and you've run across a problem and you spend, you know, like a whole day trying to solve your problem, but it's because I'm trying to do something really awesome.

0:46:55.590 --> 0:46:56.451
<v B>So Crouton. Well now,

0:46:56.451 --> 0:46:59.240
<v A>You'll have to go and add ARM support to all the Ubuntu packages.

0:46:59.421 --> 0:47:01.193
<v B>Yes. In all my

0:47:01.682 --> 0:47:02.594
<v A>Free time.

0:47:03.606 --> 0:47:06.340
<v B>Yeah, right. All right. Time to

0:47:06.660 --> 0:47:43.009
<v A>Discuss Fortran. Fortran. So Fortran is a very early language. Um you don't want to be writing Fortran now unless you are, you know, working on existing Fortran code base. Like if you want to start a new web server or something, you probably don't want to be using Fortran for your new website. But it has a pretty cool flavorful history, a long history, very interesting, and it's still in use today. A lot of people use—in fact, you probably run, you know, Fortran executables or code that's part that's been coded in Fortran. You certainly do, and you don't even know it. So that was a

0:47:43.380 --> 0:47:44.200
<v B>lot of caveats.

0:47:44.200 --> 0:48:24.640
<v A>Yeah, so FORTRAN stands for Formula Translating System. And so it was the first sort of optimizing compiler. This is back, you know, when people were writing assembly language. And I don't know if we ever—I think we explained assembly and machine language, you know, like four years ago. We'll recap real quick. So your machine does machine language, which is, you know, each instruction is just a, you know, an integer for the instruction name, and then some operands that are also represented in integer format. Assembly language is a little bit higher than just straight machine code.

0:48:24.640 --> 0:49:14.421
<v B>Yeah, mnemonics—that's what they call it. So like you get an M-N-E mnemonic. Mnemonic for each, like the 16-bit instruction may be like CA, and that's MOV (move) because move makes more sense to humans than CA representing the move instruction. To move one register to another. So it'd be like CA O1 O2 MOV registers one to register two. And then each of those being 16 bits—then eight bits, eight bits—would give you a 32-bit instruction. That's not how they would be divided in real life, but that would be an example that in an assembly language you would have MOV R1 R2 (move register one to register two), for example. But it's just a straight

0:49:14.978 --> 0:49:19.365
<v A>mnemonic is every assembly instruction, one machine instruction, nearly the

0:49:20.125 --> 0:49:36.920
<v B>some assembly language is like it's a two-pass compiler. And in the first pass, it looks for like labels and stuff and assigns them addresses, and then or you know holders, and then so that you can do branch to a label instead of branch with a numerical offset.

0:49:37.742 --> 0:49:38.485
<v A>Oh, I see.

0:49:38.704 --> 0:49:43.463
<v B>So like there are things which aren't actual instructions, but yes. Oh, I see. And then

0:49:43.980 --> 0:49:45.606
<v A>those get kind of

0:49:45.606 --> 0:50:05.384
<v B>removed. Yeah. So think like variable names, almost right? But yeah, pretty much. Yeah, one instruction is one instruction except for that and things like Intel processor stuff. And it's an instruction you write in quote-unquote assembly language may be many, many, many low-level instructions getting executed, but it is

0:50:07.088 --> 0:50:09.500
<v B>still one instruction as issued to the processor.

0:50:11.037 --> 0:50:13.433
<v A>Oh, okay. That makes sense. Yeah, like certain

0:50:13.433 --> 0:50:18.276
<v B>like but there's like wrappers of processors and Intel processors and AMD processors now. Yeah, yeah.

0:50:19.305 --> 0:50:56.852
<v A>Like some CISC machines could actually like sort a list and things like that in one instruction. But then under the hood, of course, there's all sorts of stuff going on in hardware, right? Um, cool. Okay, so Fortran is the first optimizing compiler. So it actually is the first time where somebody said, let's build sort of a higher-level language on top of Assembly and then also let's diagnose what the person's intent was and see if we can make like even better Assembly than what they intended while preserving, you know, they're the same logic while preserving the same computation. Um, which makes

0:50:57.139 --> 0:51:27.340
<v B>sense. Because we think today the opposite—like, oh, if I want to make it better, I'll write it in Assembly. Like that's the ultimate optimization. But there are some optimizations that are just way too tedious. You wouldn't ever code by hand. Uh, like loop unrolling, like just writing the same C code a hundred times to unroll a loop. You just won't. You wouldn't do that. Like that's just annoying. People would tell you, 'Just go write a loop,' but it may make sense if the compiler understands more about the state of the system to unroll the loop for you, but you would never hopefully

0:51:27.340 --> 0:51:28.999
<v A>use like a #define or something.

0:51:28.999 --> 0:51:45.380
<v B>Sure, a macro or something, right? But like an Assembly language, you know, there's not necessarily the same conveniences. So you may not write in that style, and it's a little harder to view the structure of the program with an Assembly language interpreter than writing in a higher-level language where it can understand the flow a little easier.

0:51:46.634 --> 0:51:47.747
<v A>Gotcha. That makes sense.

0:51:49.401 --> 0:52:01.973
<v A>Yeah, I saw something about how like Java, like in certain very specific cases, Java's way faster than C because of the way the Just-In-Time compiler works. It can like unroll loops, right?

0:52:01.973 --> 0:52:11.406
<v B>It understands no things at this moment. Your system all the runtime variables are now known, and if you do it over and over again, it's the exact optimal version.

0:52:12.199 --> 0:52:30.255
<v A>right yep um so history of fortran fortran was first designed 1953 by john w bacchus um it uh he claimed it had 20 times fewer instructions and assembly to do the same task same uh you know coding task sounds like

0:52:30.255 --> 0:52:31.140
<v B>a big promise.

0:52:31.140 --> 0:53:06.756
<v A>Yeah, I know it sounds like the GPU promises that we're seeing now. So his point, he wrote programs for IBM for computing missile trajectories, and he was saying he was lazy and didn't want to write so much Assembly. That's what he's quoted as saying. So he thought it would be more efficient for him to invent Fortran than to have to do all of those all that Assembly programming. And maybe it was, but either way, he definitely could be considered a philanthropist of sorts because he wrote Fortran and everyone else could benefit, which is pretty cool. Um.

0:53:09.962 --> 0:54:06.360
<v A>So Fortran sort of harkens to like a very early day of computing, definitely before our time. But your parents are if your parents are kind of techie—if you're old as we are and you have parents who are techie or maybe your grandparents were techie—they can tell you about these crazy stories of using punch cards. And actually with Fortran, back in the day people would they would use a special machine, kind of like a typewriter, but it would, you know, when you typed C, it would actually punch a hole or maybe two holes into a card and then move the card a little bit, kind of like a typewriter but with holes instead. Imagine like a Braille typewriter or something like that. And so you would you know type out all of your instructions. If you like mistyped something, you would just have to throw that card away and start over. And when you're all done, you would take your stack of cards.

0:54:06.595 --> 0:54:09.261
<v B>that hopefully don't drop them and get them scrambled on the floor.

0:54:09.885 --> 0:54:34.017
<v A>Yeah, if you drop them, forget it. Right? Like I think they're numbered. It's kind of like, you know how your checkbook has numbers? So, so if you drop it, you can like, you know, do a human quick sort and fix it, but nobody wants to do that. So, um, you would take them over to like the—I think there's a special name for it, like a secretary or something, but there's like a reader name.

0:54:34.017 --> 0:54:36.970
<v B>For it? No, no. Like well, you take them.

0:54:37.060 --> 0:54:40.632
<v A>To a person who would feed it into the machine, and then—

0:54:40.632 --> 0:54:41.914
<v B>The computer basically is.

0:54:42.876 --> 0:54:43.560
<v A>That what the?

0:54:43.652 --> 0:54:45.019
<v B>No, I don't know that.

0:54:45.019 --> 0:55:28.400
<v A>But I would anyway. There's a person who would—their whole job was to take these punch cards, like stacks of them, feed them into the machine. The machine would take maybe like half an hour, and then spit out some results on, I guess, like a kind of like a cash register would on a piece of paper, and then they would, you know, attach that to the—to the punch cards and give it back to you. So, you so imagine like you would—you would submit your program depending on like how much work this gentleman or lady had. You'd get your program back hours later, and you'd find like, oh, I had a, you know, some runtime error or something like that. It's just like unbelievable that you could get anything done like that. But people did for years and years, but while you're—

0:55:28.400 --> 0:55:30.987
<v B>Waiting, you just surfed the web on your?

0:55:36.606 --> 0:55:41.027
<v A>iPhone? So I wonder if someone wrote like a FORTRAN. Yeah, there are punch.

0:55:41.027 --> 0:55:44.284
<v B>card emulators I found. I was—I yes, yeah, are there ones for?

0:55:45.162 --> 0:55:46.779
<v A>The web? Let me check out.

0:55:46.779 --> 0:56:11.267
<v B>There were—there were ones on the web. I just was looking. They look like almost like they're just for aesthetic purposes. I couldn't find anywhere you actually punch your punch cards and feed them in or anything. Oh, but there is a punch card computer I found the other day, like a printoutable, like you make punch cards and you like slide it through, and it's an actual like you physically do the computations by. Anyways, it was very intriguing. It's like I want to teach this to my kids one day because I'm a nerdy, but yeah, this is.

0:56:11.588 --> 0:56:19.047
<v A>Amazing. So I found a website where you can type anything you want and it will put it on a punch card, but just imagine I

0:56:20.684 --> 0:56:29.982
<v B>mean the worst is like punching all the stuff on the punch card, and then your program has like a problem, a bug in it, right? Like it doesn't compile, and then it's like

0:56:30.775 --> 0:56:39.899
<v A>Oh yeah. I mean, like there's physical ramifications beyond just crackles of energy for your code not compiling. Like you have to start retyping things. Like think of

0:56:39.900 --> 0:56:42.030
<v B>all those dead trees you wasted. That's not

0:56:43.971 --> 0:56:51.919
<v A>green? Like if you have an error, do you have to type every card from that point on to the end, or can you like splice in? I'm sure.

0:56:51.919 --> 0:56:55.193
<v B>You can splice in. Why? I mean, I don't think it enforces the numbering. Yeah, I

0:56:56.543 --> 0:56:58.600
<v A>guess that's true. It's like how do you? That's how

0:57:02.550 --> 0:57:06.297
<v A>you make V2, man? Yeah. Oh man. Yeah, that's completely mind-blowing.

0:57:06.297 --> 0:57:13.360
<v B>as a new meaning to technical debt. Yeah, that's the literal weight of the cards for your system.

0:57:13.360 --> 0:57:42.207
<v A>So obviously, you know nobody had a computer in 1950 just hanging out. There was a handful of—well, there's more than a handful of computers, but there was your one computer for maybe, you know, 10 or 20 people. And so at least, and so these were called mainframes, and so you know that one person who's just feeding all the punch cards through is interacting with the computer. Everyone else is just, you know, interacting with the punch cards. FORTRAN.

0:57:42.477 --> 0:58:31.650
<v B>Still gets used today, but not punch cards as far as I know, hopefully. But yeah, FORTRAN still lives on in many places where you do numerical processing. So you may have come across it before. I heard about it. It still backs some of the most well-known linear algebra systems like LAPACK, lots of MATLAB modules are still in FORTRAN and optimized that way. And it's just really useful for people doing scientific computing, where this is like where it kind of got its start, and so like in high performance computing and stuff, FORTRAN is used often, and it just carries over that really high performance people wanted to use it. And so the high performance process, high performance modules still often have FORTRAN in them. That's right. Like

0:58:32.528 --> 0:59:01.620
<v A>if you do anything on your computer with images, like any kind of image manipulation at all, even if you just like turn a PNG into a JPEG, you're using FORTRAN code. Like it's absolutely everywhere. It's on every machine. So it's completely ubiquitous. But you know, granted most people probably don't even know what that code is doing. I mean, they know the intent of the code, but they couldn't—they couldn't, you know, fix bugs.

0:59:01.620 --> 0:59:05.350
<v B>Well, it's like anything the more optimized it becomes, the harder to read it typically becomes.

0:59:05.940 --> 0:59:07.662
<v A>That's true too. Yeah.

0:59:07.965 --> 0:59:10.699
<v B>The more obtuse the optimizations chosen are,

0:59:10.700 --> 0:59:48.212
<v A>Yeah, right. So there's a few modern compilers for Fortran. Fortran, just like C++, you know? It had C++. C++ has the original version which was written in—the compiler was written in C, actually. Sorry, the compiler it was written in C, and it also generated C code, so it didn't go straight from C++ to the machine. There's multiple iterations on that. There were kind of tweaks to the language over the years, and then now we have C++11. Right? It's the same with Fortran. There was a original version of Fortran. There's a very popular one called Fortran, I think. We have C++.

0:59:48.212 --> 0:59:50.946
<v B>14. Now what? Yeah, C++

0:59:53.005 --> 0:59:58.675
<v B>14 is a thing, and I think they already have C++17 in the works now. You're you're behind, man.

0:59:58.675 --> 1:00:05.070
<v A>What? I'm so far behind. I have to look into that and find out what they added in '14. Wow, that's

1:00:05.070 --> 1:00:16.815
<v B>like a return type deduction, relaxed constant expressions, variable templates, aggregate member initialization, digit separators, generic lambdas. These are all C++14 features. Oh, generic

1:00:18.360 --> 1:00:21.338
<v A>lambdas really? Like function pointer kind of thing? Well,

1:00:21.439 --> 1:00:28.982
<v B>in C++11, the lambda function parameters had to be declared with concrete types, but in '14 that requirement got relaxed. Oh.

1:00:29.927 --> 1:00:32.003
<v A>Okay, this is Patrick reading

1:00:32.780 --> 1:00:34.264
<v B>excerpts from Wikipedia.

1:00:36.762 --> 1:00:54.227
<v A>So yeah, so compile. So now you know I'm assuming Fortran 95 is implementing the Fortran 95, which is that version of Fortran. Um there's also GNU or New GFortran. Um that's the one I've used to build SciPy, that's part of

1:00:54.227 --> 1:00:55.881
<v B>the GCC collection. That's right.

1:00:56.573 --> 1:01:10.292
<v A>So if you have GCC, which most machines do, you also have GFortran. And so if you have to build SciPy from source or if you want to, um you'll have to—you'll have to have that installed. And you'll see I did that.

1:01:10.292 --> 1:01:13.380
<v B>Once, and yeah, and then I was like, 'Wow, this takes a'

1:01:13.937 --> 1:01:30.441
<v A>long time. Yeah, it takes forever. So the interesting thing is it'll actually um like recompile the same program many times to find the best way to compile it. It's kind of like mind-blowing. Um so yeah, so this is the compilers in a nutshell.

1:01:31.977 --> 1:01:41.560
<v A>So what are some pros of Fortran punch cards? Punch cards? I mean, come on! Like what language is freaking punch cards?

1:01:41.560 --> 1:01:47.114
<v B>Only people who have never had to program in punch cards before would be so excited as punch cards. As Jason and I.

1:01:48.818 --> 1:01:55.399
<v A>Yeah, I just like man. I mean, talk. I wonder if we could get our hands on some punch cards.

1:01:55.399 --> 1:02:01.170
<v B>Someone told me that some of the computer museums have them, but they think that they may not let you run your own programs anymore.

1:02:02.807 --> 1:02:05.018
<v A>Oh, oh. I see. They'll have the like place where you?

1:02:05.100 --> 1:02:17.438
<v B>I really want to one day just to say I could, but I don't know if you could. Like that seems like something that has like moving parts that you couldn't just buy an old one on eBay and expect it to work. So like yeah, besides the refrigerator. Yeah, yeah, yeah, that's right.

1:02:19.277 --> 1:02:24.627
<v A>But if you have an emulator, kind of defeats the point. Like it'd be pretty sweet if we could—you should.

1:02:24.627 --> 1:02:25.820
<v B>make one with an Arduino.

1:02:25.820 --> 1:02:49.619
<v A>Oh, punch cards. If we could take like a transpiler, like Go, like use if there's a G4 trans that goes to LLVM, then you could take like a very complicated, like you could take some neural network, compile it to LLVM, then transpile it to Fortran and then run it on one of those old machines. And I want

1:02:49.619 --> 1:02:56.757
<v B>to compile my JavaScript Node.js program to assembly on punch cards. The server is

1:02:57.870 --> 1:03:06.342
<v A>like, please wait while we read these punch cards. Please wait while we read these 17 million punch cards. Oh no, I'm

1:03:07.675 --> 1:03:13.260
<v B>gonna make that at work. I'm gonna measure my productivity and number of punch cards it would have taken to do my work. So,

1:03:14.948 --> 1:03:22.280
<v B>like instead of like system lines of code or whatever, like I generated 100 slots, it's like I generated 10 billion punch cards today.

1:03:25.478 --> 1:03:26.423
<v B>That'd be amazing.

1:03:26.727 --> 1:03:27.621
<v A>Yeah, using the

1:03:27.621 --> 1:03:29.820
<v B>train. It's like your 3 million GTA dollars.

1:03:31.097 --> 1:03:35.620
<v A>Yeah, that's right. That's right. I generated 3 million punch cards with the code. That's a

1:03:35.620 --> 1:03:42.140
<v B>new byline of our show, increasing your punch card output by immeasurable percentages.

1:03:42.140 --> 1:03:53.423
<v A>I totally think the next logo or a logo of Programming Throwdown has to be this punch card that I'm looking at right now that has that has

1:03:53.423 --> 1:03:55.330
<v B>Programming throwdown punched into it.

1:03:55.330 --> 1:04:33.552
<v A>Yeah, that looks awesome. That's like one of those binary clocks where you get it for the novelty and then you spend a year trying to read it. Okay? And all right, so another pro about Fortran is pretty cool. It's pretty unique. So Fortran actually started some of the trends of doing kind of crazy things to optimize the code, and Fortran kind of started that whole movement. Fortran had a directive called `FREQUENCY`. So have you probably used this? Patrick, have you used the register directive? And see all the time? Seriously? Yeah.

1:04:33.552 --> 1:04:46.000
<v B>Seriously? I would have. Oh really? Yeah, it's actually registers. There's a better way to do it, but yes, I know what you're talking about—register—because that's optional, but there's a way to force it to be aliased to an actual register. Anything?

1:04:46.967 --> 1:04:47.828
<v A>Ah well, it's.

1:04:47.828 --> 1:05:00.020
<v B>Supposed to be a hint, but I don't know that it actually works. But there's a way to actually force the compiler to use to save a register and then use that register for the variable you're using.

1:05:00.020 --> 1:05:01.880
<v A>Okay.

1:05:01.880 --> 1:05:07.740
<v B>Maybe it's GCC specific. I don't know, but there's like a more forceful way to do the same thing.

1:05:07.740 --> 1:05:14.693
<v A>Yeah, that makes sense, like something kind of like `__blah blah blah` or something. It's probably that.

1:05:14.845 --> 1:05:17.477
<v B>it's gcc um maybe i don't

1:05:17.477 --> 1:06:23.560
<v A>remember the syntax the uh um so the register thing in c is not used anymore like modern compilers i don't think respect it anymore because they've found like statistically they took like the top 100 programs that had register and they found that if you took away register it actually performed better nice because the compiler is just so much smarter than we are so uh register became a no-op like i don't know a few years back and frequency is also a no-op in fortran but it used to actually tell fortran to do some monte carlo simulation which we talked about on earlier episodes we talked about like you know rejection sampling and things like that um but yeah the fortran compiler would do a monte carlo simulation to figure out how to lay the blocks of code and blocks of code in a way that is most efficient um and and it makes sense because this guy was at ibm uh working on missile uh you know guidance simulation which is full of monte carlo sampling so he's probably an expert on that and so he put it into his compiler which is pretty sweet

1:06:23.560 --> 1:06:33.432
<v B>i should clarify too my use of register was because i was about to write inline assembly um for accessing special registers on the processor so it wasn't for speed

1:06:34.782 --> 1:06:35.693
<v A>oh interesting

1:06:37.212 --> 1:07:22.470
<v A>Okay, I remember off topic doing FPGA work where you know like you'd write to a certain block of memory. Like you would just do like x equals three and it'd just be hanging out there and you'd never use X. And I remember looking at that code and thinking, like I'm not a you know, I'm like a more theoretical Comp Sci guy, so I just saw this x equals three hanging out and I was like, 'This doesn't make any sense. Like why do you do this?' And someone told me like, 'Oh, that variable X is pointing to like some special memory, and there's this other processor, like FPGA, that's listening to that memory.' And so when you do x equals three, like it immediately goes into this other processor, and um this is just like once you get into low-level stuff, there's a bunch of these kind of yeah. So,

1:07:22.470 --> 1:07:55.410
<v B>I've done it kind of like that. You have to mark it volatile memory map it. You can use a linker if you want or there's other ways to basically place at a specific address. And then when you access those addresses, the bits come out on a special bus, and the FPGA listens to that bus and responds appropriately, either storing the data or writing it back to you when you try to read it. And it's a kind of a way to communicate um that's different than like I²C or SPI or something because the data rates can be much higher because it's meant for as if it was just memory-mapped RAM, but it's really a processor. Yeah. I

1:07:56.575 --> 1:08:04.017
<v A>Mean, I'm assuming it the data rate could be as high as like the trace right or as high as the other processors running or something like that? It?

1:08:04.810 --> 1:08:05.755
<v B>Can be really fast.

1:08:06.734 --> 1:08:07.409
<v A>It's configurable. Yeah.

1:08:07.409 --> 1:08:08.960
<v B>It depends on the processor.

1:08:09.602 --> 1:08:12.184
<v A>How do you ensure that the other person has read it? I mean,

1:08:13.399 --> 1:08:16.622
<v B>They just have to provide a guarantee that they meet the timing spec.

1:08:17.770 --> 1:08:18.833
<v A>Oh, I see. So

1:08:19.103 --> 1:08:34.580
<v B>it gets clocked out and they have to guarantee like an FPGA design that it doesn't work like a processor, right? Simultaneous. So like the logic it flows into is capable of consuming the byte or bytes you transfer before they go away.

1:08:36.602 --> 1:08:40.298
<v A>Got it. Oh, I see what you're saying. Yeah, yeah, that makes

1:08:40.703 --> 1:08:44.095
<v B>sense. Like it's propagation speed, not like processor speed.

1:08:44.736 --> 1:09:46.939
<v A>Yeah, so you basically it needs to read that information, um, and pass it on to the next stage in the pipeline before you get write it again. Yep, something like that. Yep, um cool. So what are the cons of Fortran? Um yeah, basically don't use Fortran. I mean, like you know MATLAB, R, SciPy are just way better. You know, the tooling is way better. Um uh the support for, you know, reading images, all these things, just so much superior in these other languages. So I mean, Fortran is cool, as I said, you know all of us are running Fortran code, unbeknownst to most of us. Um and so for that reason it's very cool, and you might even have to debug some Fortran code, especially if you're doing some image processing or, you know, something like that. Um but really at this point, it's just kind of like a cool history lesson. Um you should not try and build your next website unfortunately what?

1:09:52.455 --> 1:09:54.059
<v B>The ringing endorsement of Jason. Yeah.

1:09:55.172 --> 1:09:59.020
<v A>Yeah, Jason. Jason does not uh does not support this message. I do not.

1:09:59.360 --> 1:10:00.184
<v B>Approve this message.

1:10:00.758 --> 1:10:15.439
<v A>That's right. Yeah, I do not approve this message, but it's cool. Check it out. It's uh it's an interesting one to know. Um as I said, you know you could shock your friends by telling them that their computer is running Fortran code and they don't even know it. Um

1:10:15.439 --> 1:10:20.164
<v B>Because all your friends want to hear that. Yeah, that's right. You'll become that guy.

1:10:20.519 --> 1:10:26.140
<v A>And you are already that guy. Yeah, we're that—we were that guy. We've been that. I am that guy.

1:10:26.509 --> 1:10:35.580
<v B>All right. So next time, I think that's—I think that's it for me. All right guys, have a good one.

1:10:36.000 --> 1:10:57.520
<v A>Intro music is Axo by Binar Pilot. Programming Throwdown is distributed under a Creative Commons Attribution-ShareAlike 2.0 license. You're free to share, copy, distribute, transmit the work to remix, adapt the work, but you must provide attribution uh to Patrick and I and ShareAlike in kind.

