About this episodeThis show covers Fortran: An old (but still very useful!) imperative language for numerical calculations. Books of the Show Jason: A…
This show covers Fortran: An old (but still very useful!) imperative language for numerical calculations. Books of the Show Jason: A Theory of Fun in Game Design http://amzn.to/1FShtR6 Patrick: Monster Hunter International http://amzn.to/1EeqWO2
★ Support this podcast on Patreon ★Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Fortran
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. Wait,
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.' 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. 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?
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.
That was a weakly typed argument. 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.
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.
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.
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.
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.
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
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,
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. 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. 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,
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.
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
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
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.
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.
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.
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
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
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.
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?' 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
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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?
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.
Show? Um I totally forgot my sideline time for. 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.
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.
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.
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.
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.
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
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.
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. So Crouton. Well now,
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
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.
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
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 still one instruction as issued to the processor.
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
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
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.
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. 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.
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.
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—
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.
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.
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
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.
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++.
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. So what are some pros of Fortran punch cards? Punch cards? I mean, come on! Like what language is freaking punch cards?
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
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.
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
oh interesting 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,
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
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?
