Programming Throwdown - Rust

Episode Date: January 7, 2015

This show covers Rust: A memory-safe systems programming language. Tools of the show: Jason: This War of Mine Patrick: Vainglory. ★ Support this podcast on Patreon ★ ...

Transcript
Discussion (0)
Starting point is 00:00:00 Hosting provided by Host Tornado. They offer website hosting packages, dedicated servers, and VPS solutions. HostT.net. Programming Throwdown, Episode 39, Rust. Take it away, Patrick. Email. It's such an integral portion of our lives.
Starting point is 00:00:24 It is. But what is it? Where does it come from? What does it taste like? What does it taste like? It's delicious. Jason and I were talking about how email has become increasingly a portion of our business lives. Well, I guess personal lives as well.
Starting point is 00:00:39 But that a large portion of our day is spent using email. And we were talking about our experiences with Google's new inbox and trying to change how email is done and sharing our opinions about email for me i find that i have a horrible organizational scheme for email and i have tried all sorts of like inbox zero whatever approaches and it turns out i just end up using my email as some sort of weird to do and like i like seeing things whether they're unread read out in labeled like all these are various levels of to do for me um but inbox is nice i like it i like that i can zero inbox kind of person i don't argue that way like i can't if i have an unread email it just like makes me tick a little bit no no i have lots of unread emails in fact my lead came by one day and saw my inbox and was like you have how many unread emails so
Starting point is 00:01:32 we're talking like i was like no no it's okay it's okay yeah yeah no not hundreds of thousands no no like hundreds oh hundreds okay i'm not that bad anymore yeah like i have it a little bit better now basically if it gets past a month i just i just archive it all like oh nice um but but yeah i use it as like a to do like i read a message and then i mark it back as unread if it's like i need to take action yeah right uh and yeah i know it doesn't work and now inbox the google one i use it for my personal and i really like it and i don't quite get to inbox zero like i still leave stuff in my inbox um although i have gotten to inbox zero with it because you can sweep away like large portions of messages which i like yeah yeah i like the whatever they call i call it the boomerang feature because that was the name
Starting point is 00:02:13 of a startup trying to do the same thing where you like say give me this email new again in a day or in 12 hours oh yeah yeah yeah when i get to work i love that feature i actually should use that i haven't used it but i think it'd be really useful. I just haven't incorporated it in my flow. But I use a lot of the, like, filters so that, like, I have a bunch of different categories and most of the email gets routed correctly. And that way things like... I have filters as well, but I find that if it's filtered out of my inbox, that just means
Starting point is 00:02:43 it does not get read. Yeah, pretty much. Yeah, it's true. Who am I kidding? People fuss at me like, you didn't see this email mess? I'm like, no. It's in a busy stream. I don't check.
Starting point is 00:02:52 Yeah, I have this one mailing list at work, and they put automated emails, like test results, but then it's also used for real communication communication. And that's the worst. Cause basically that's just, that's just a black hole for me. Like people are like, Hey, did you get my email? I said, did you post it to this group? And they go, yeah. I'm like, Nope, that's not going to happen. And then they're always like, there's ways around it. Like, Oh, well, this, the test emails always come from the same thing. Or always having a suffix at the end or something and it's like now my rules just have to get really yeah this is silly yeah
Starting point is 00:03:30 um but actually you know there was that time where they were trying to do google wave as like a replacement for email but that um didn't really take off i really really think email is one of the last few things that needs a refresh. We completely refreshed the way video works. You go from your camcorder to YouTube. So many things
Starting point is 00:03:57 now are just completely fundamentally different than they were before. But email is basically the same thing. I i mean there's smart filters and there's some ways to manage it but the medium itself hasn't really changed i mean in fact just the way email uses those greater than signs to like tell you that it's a reply email like like none of that that whole hacky protocol has stayed the same all those years well even the fact that most of the email
Starting point is 00:04:25 has moved to conversations like threads right kind of like more like forum posts or whatever it would almost be better if like when you sent an email instead you were just creating like a wiki entry somewhere and like this is kind of the wave thing a little like and everyone can kind of edit it but not just like an open form edit, but just more like a, you know, instant message thread, but it's indexed like an email, right? Like somewhere, the problem is some people use email as documentation, like a true wiki or, you know, online document or even emailing word docs. Other people use it as ephemeral, like text messaging. So it needs to support both cases. And it has to be backwards compatible because you're not gonna
Starting point is 00:05:05 get everyone off email in a day right that's right that's i think the big problem with wave was that you know the the first thing wave should have done is like allow it should have taken your entire inbox and converted it to wave you know um yeah it's hard though because even like at work we use google docs a lot and we had a vendor we were working with and we sent him a link to the google doc which he could access just fine but he's like oh i didn't like working in the google doc so i copied all your google doc into a microsoft word doc so like let's use this to collaborate and it was like what this is like fine you may not like google docs but like emailing a version word doc around is the worst microsoft go to like parallel editing i thought microsoft had a cloud-based thing now but people i don't as far as i know people still just like
Starting point is 00:05:58 take a dot doc and email it and then you're supposed to make edits or suggestions and email it back that's so bad that's so bad so so there's another thing actually now i think about it is sending a file like that still hasn't been solved like why is that still so hard you know like if i have the other day i had like a two gigabyte file and i wanted it it was a bunch of pictures. I wanted to send it to my parents and I realized it's just no, there's just no way for me to do this. I mean like, you know, so there's such that my parents could receive the file without being like wizards or anything,
Starting point is 00:06:36 you know? Well, the problem is like, where do you store it? Like your parents want a version of that file or the option to keep the file, but so you can't just host it from you because they also want to copy. But two gigabytes is a lot for them not to agree to accept.
Starting point is 00:06:51 Right. Yeah. And there's no like third party like Dropbox or someone could like host a file and you could email the Dropbox link. But then you trust that they copied it down before you remove it or whatever. Yeah, I mean the best thing I've ever used for this, and by best, I mean, like, most idiot-proof, was AOL Instant Messenger, where I could literally just drop a file into AIM, and it would just get sent to that person,
Starting point is 00:07:15 and they would have it. But that was only if the person was there. Yeah, I mean, that's fine. Oh, yeah. But anyways. But for that, you can use Dropbox, dropbox right like you can put it in dropbox send the link and then when they download it just delete it yeah if i had two gigs free on my dropbox but uh i don't have that that's the problem anyway you mean you're not paying them
Starting point is 00:07:39 i know i'm i want to freeload but I also want everything they have. That's called buying. Yeah. So we have some user feedback. Yeah, we have some awesome user feedback. Thanks. This is collected from email and from the G Plus and Facebook pages and community, or community and page, respectively. But Simon, or Simmon, you, he he told us he gave us a pretty cool link there's this tool called ispc and it lets you take c code and turn it into simd
Starting point is 00:08:14 um so i haven't tried it or anything but uh it looks cool it's on github so i'm assuming it's open source. And yeah, I mean, it looks pretty awesome. I wonder how it works. Let me see. Overview. So SIMD was, for those of you not following along, was last episode, episode 38. That's right. So yeah, apparently it's an extension to the compiler so and it uses LLVM so you compile a bunch of your code to LLVM you compile this to LLVM and then
Starting point is 00:08:54 now everything's LLVM so it just kind of works cool I'll have to check that out it's pretty awesome so not exactly SIMD but we've talked about CUDA before and I had someone tell me today because we were talking actually about simd and they brought up cuda that if you are a cuda programmer apparently you can make mad money really that's what they told me i don't know if that's true but they said that the demand for gpu programmers is so crazy and the supply so bad that if you can do that that you can make as they said mad money are you doing gpu right now oh so you're so there's the potential i mean we both so so just some background patrick and i did
Starting point is 00:09:31 gpu programming uh several years ago so yeah so that's what i was thinking is like man apparently i'm not apparently there's mad money to be made. But he also wasn't doing it. So apparently, the money must not be that bad. You know, that's like an investor who tells you, you know, buy this stock, buy this stock. But then, you know, they don't have any of it or they're shorting it or something. So cool. So Nicholas Baring. And oh, by the way, all these people's names were public. So, but if I am saying your name and you're super offended, let me know, because I won't do it anymore.
Starting point is 00:10:10 But as far as I know, it's okay. Nicholas Baring said, I made a comment in an earlier episode about how it's better to throw exceptions. He found some article where they said basically never throw exceptions um you know like the program should always survive and if there's some crazy case you know you should handle it and maybe log an error or something but don't like crash the program um but i think it's interesting i mean it's obviously a different perspective um i think a lot of it depends on the specific program. So, I mean, for example, if you're doing like a front end web server, then you don't want, you know, the person clicks the follow button and, you know, it just crashes.
Starting point is 00:10:56 So there's definitely things where, and I would maybe even go so far as to say the majority of things you have to sort of fail gracefully. It just so happens that most of the things I work on you can kind of fail loudly and if the whole binary dies nothing's impacted immediately. But I think he did bring a valid point and the article is actually quite interesting. So definitely check it out.
Starting point is 00:11:22 It's a different perspective on it. It probably depends on the language too, so yeah that's true like some languages are so like even for instance like in java right like in java you a lot of those libraries and stuff you call will throw exceptions and then you're kind of forced to deal with it so if you're already dealing with it throwing your own in my opinion i'm going to get flack for it probably but is that like throwing your own isn't that big a deal since code's already having to be set up to handle it. Versus like in C++, that's not normally the default, throwing exceptions. Right. So if you start doing it, who knows if other people who try to use your code will be set up to handle exceptions or not.
Starting point is 00:12:00 Yeah, and it depends on the framework too. Like if you're doing, say, a website, you typically have like a thread pool. And if one of the threads crashes, it just spins up another one. And so all that really happens is that specific web request kind of fails, but you move on. But if you're doing something else, like some kind of device app, device side programming or something, and throwing an exception that isn't caught means killing the entire binary and now nobody can do anything, then obviously you have to
Starting point is 00:12:32 not throw any exceptions there. Finally, you have Bence Magyar. Hopefully I got your name right. Bence Magyar. He linked to this pretty cool Python library called Bokeh
Starting point is 00:12:47 and it's a visualization library for the browser written in Python. So I definitely want to check this out. Personally I think this would be pretty cool. I see a lot of value in this. I've been doing a lot of Python lately and doing a lot of visualization so I'll definitely have to take
Starting point is 00:13:04 a look at this and you guys guys should too it looks pretty cool that doesn't look great all right time for the news first article is mine uh of virginia oh i guess a university of virginia i don't know but there's a link in the show notes but there was a very good pdf that i found on how GPUs work. It looks like it was part of a magazine or something, but I didn't see it when I skimmed it, what magazine it must have been a part of. It says computer.
Starting point is 00:13:35 Is there a magazine called Computer? I don't know about that magazine. Yeah, I haven't heard about it. Anyways, but it's how GPU works, written by someone from the University of Virginia and someone from nvidia and it talks a little bit like we talk about and so even representing three-dimensional space use four-dimensional matrices and they give a little bit of explanation about why that is
Starting point is 00:13:56 about some of the things that having a gpu allows you to do that you know weren't really feasible before about shaders about general gpu just kind of like a cursor overview it's looks like about five pages long so not that long but but a good thing we talked about we've talked about gpus a number of times and this is a good uh overview of what it is and the context behind it yeah i'll have to check this out um actually you know the gpus uh i have a friend from nvidia who is telling me that they're doing a lot more machine learning gpu activity um so i think nvidia specifically is building a bunch of machine learning libraries and stuff like that for the gpu and making that available to everybody and so uh that's pretty it. I mean, I think a lot of processors are now coming with GPUs,
Starting point is 00:14:50 either on the die or a lot of devices have GPUs in them and stuff like that. So we might have to revive our GPU skills. Skills with a Z. Make mad money. Yeah, that's right, to make mad money. Mad monies, also with a Z. Oh. So, this article is pretty cool.
Starting point is 00:15:13 It's Mixpanel's pitch deck. Actually, it's funny. The article originally was open sourcing our pitch deck, and they got blasted on Hacker News for using the term open source when it wasn't source code i didn't realize this was a big deal but it's currently like a big social faux pas at least on hacker news to to use the term open source for something that isn't sourced so
Starting point is 00:15:37 anyway so they changed it to here's our pitch deck or something but it's pretty cool it literally is their pitch that they use to secure their like uh vc funding they got something like 70 million or something in series series b or series c and it's about how they did that uh i mean so it's the deck but it's also if you read the Hacker News comments, they also, the Mixpanel founders are there answering questions and adding commentary. And it's actually a really good read, so definitely check it out. It's pretty cool. There's a lot of things I didn't know because I'm not really in that area.
Starting point is 00:16:24 So, for example, there's a term called KPI. That's key performance. I forgot what the I is. Do you know what the I is? Let me look it up. But it's like KPI and it was about key performance indicator. And basically it's a fancy way of saying how they're going to measure success. And they also had like, you know, their graph showing their growth and stuff like that.
Starting point is 00:16:46 So I thought the whole thing was pretty cool. They talk about some of the things that we've talked about on the show, like have a vision and the vision is really important, have, like, a good mission statement, all that stuff. But it's cool to see, like, a living example. Oh, they have a whole thing in here for their competition yeah they had that little that uh was like an x chart or t chart or however you say that but it's the other competition they had to break it down into free paid and then
Starting point is 00:17:15 i forgot what the other axis was yeah i always find that funny when talk to people who have an idea for something or like you ever watch like that shark tank show on the tv and then like people like oh i have no competition there is it's like well yeah you're probably doing something wrong seems really unlikely you have no competition it's like tesla tesla saying like who else makes electric sports cars well no one we have no competition it's like well your competition is every other kind of normal car. Yeah, I mean, the other thing, too, is like, even if... Now, I don't know that Tesla actually says that. That was just a hypothetical. Even if you literally have something completely brand new,
Starting point is 00:17:56 your competition are the audience of people who can clone you over the next five years, right? I mean, you always have somebody you know who can who can duplicate what you're doing given enough time and that's so yeah you should always have competition um at any rate the next article is goodbye dr dobbs who fun fact dr dobbs is not a real person it's a it's an amalgamation of two people's names i forgot what they were now i guess i should have had it ready but i looked it up earlier uh um so it's two people together founded the magazine dr dobbs and i 38 years ago apparently and they have decided the current editor and staff or whatever and the company that owned them have decided to stop publishing dr dobbs um so most people have probably at least come across dr dobbs at one time
Starting point is 00:18:50 or another um they have a huge corpus of like programming related content so they get a lot of search hits when you search various programming topics um and i don't know that i've ever subscribed to the magazine in college i think they had it around so i think i've read dr dobbs in print before okay um that's where they put it on a dead dead tree paper and like um i don't know the magazines are that common anymore i guess they are and uh and so they're they're finally stopping and the guy was making a point he's like it's kind of the the person writing the article it's kind of the, the person writing the article, it's kind of interesting because their website currently has a more page
Starting point is 00:19:29 views than ever has had before. And it's been growing for over the last three years. That's still, you know, a pretty significant clip. Um, but that, you know how much they're making,
Starting point is 00:19:38 it's going down because basically they relied on, um, pay-per-view ad and the pay-per-view ad industry is just, like, drying up. Yeah, right. Because it turns out no one clicks on those ads. No one, like, is not helping anybody by seeing them. People block them from their vision. And so they're actually, their ability to make money has suffered.
Starting point is 00:19:57 Yeah, I mean, it's like they didn't really keep up with the times, you know? I mean, they, like, the website itself looks very dated, and the content is up to date. But, yeah, it just feels like their business hasn't really adapted. I wonder how, like, how do, like, TechCrunch and these other sites make money? That's through pay-per-view ads, right? Is it just so there's, like, display ads or whatever, but it also, like, click ads, maybe click ads. Oh, I see. Also, I don't think, like, when these people say they have a lot of views, I don't think the views approach something like, you know, TechCrunch.
Starting point is 00:20:39 TechCrunch probably has, like, an order or two of magnitude more page views. Yeah, right. That makes sense. So, I mean, I don't know um yeah yeah i mean that i mean and then also i think people like tech crunch and stuff they now like they run conferences and stuff too right and like people pay to go there be a vendor there yeah that's what it is that's actually the right answer i mean at that they uh yeah you're right all of these people even like node.js and stuff they have the node.js conference and it's like a thousand dollars to go you know um yeah these people didn't really
Starting point is 00:21:12 jump on that bandwagon among other things but uh yeah so i mean i still get like magazines but the magazines i get are typically much like lighter fare uh dr dobbs is like i guess would it be considered like a trade journal i don't know like i've never really read sat down and read computer science magazine trade journal type stuff yeah right it's either more tactical where i go to like stack overflow like how do i solve this problem yeah or like someone's blog post which i guess would be similar to this yeah another part of it is they didn't really handle the social side correctly. Like, you have to log in to comment. And so, like, nobody's going to do that. But,
Starting point is 00:21:50 anyways, I won't sit there and bash Dr. Jobs. Dr. Jobs is a great site. It has a lot of good... I really hope that they keep it on the internet archive or something so that all their historical information... No, I think he said the intention is to keep serving the webpages because they are enormously popular. they are enormously popular they just won't make new content
Starting point is 00:22:07 that's right okay um cool so uh yeah this is pretty interesting so there's a bug so you know you always see these articles like the bash one what was that called um the thing in bash i'll look it up keep going so. So there's Bash. There's the Heartbleed, which everyone knows about, the bug in SSL. Shell Shock. Shell Shock. And usually, I don't know too much about the Bash one, but I know the Heartbleed one, it's something, like, ridiculously complicated with, like, somebody can, like, look at the response times
Starting point is 00:22:40 and, like, you know, fit a distribution to it and, like, do all this crazy math. And it's, like, something you'd see in csi but this this this like exploit is very very simple basically um you know the way your git repository works you have a folder called dot git and in your dot git folder you have all this all these things among of which which is this folder called hooks. And in the.git slash hooks folder, you can do hooks. So, for example, every time you commit, you can save the date to a file. I have a friend who every time he did a git commit, it took a picture using his laptop camera. And so he has a picture annotated with the commit so you can see like how for how stressed he was and he was making the commit just goofy
Starting point is 00:23:30 stuff but you could also do really productive things like you know check the code make sure it's formatted and if it's not formatted like it was not auto formatted then fail the commit etc so now if somebody in their git repository has like a dot git folder and then had a hooks folder and made their own hook then that'd be pretty bad right because what could happen is you would clone the repository and you would also end up inheriting all of these hooks that could you know basically execute arbitrary code on your machine so git tries to be smart about this and they say look in your git repository you can't have a dot git folder because because you would be able to do this right but they didn't
Starting point is 00:24:16 think about case insensitive so if you have for example like a dot capital g IT folder, then it says, oh, that's fine. But on Windows, that's not fine. And on Mac, it's not fine because the Mac has the HFS case insensitive by default. So yeah, all you have to do is make a dot capital G git folder and then make a hooks folder and then, you know,
Starting point is 00:24:39 RMRF someone's hard drive and anyone who clones your repository and does a commit will wipe out their own hard drive and of course you can do a lot worse than that right so um so do they actually find this happening or they just someone discovered this was a possibility and then they kind of stopped it um that's a great question you know they're never going to tell you that right um they're never gonna say like you know who uh like how they found this right um let me look yeah no well sometimes you know because sometimes like you find like the way it's found is a circulating worm or something right oh i see so i haven't i haven't heard anything about it. Maybe this is how those hackers got into Sony.
Starting point is 00:25:27 Oh, yeah, it's another story. But, yeah, so basically if you have Git, you should upgrade to 2.2.1. Or at least, you know, until you do that, just look at the repository you're cloning and just make sure it doesn't have a.git folder you know if you're doing this well GitHub is saying that they're blocking it like they're not allowing it anymore that's right yes
Starting point is 00:25:51 and then they scanned all their repositories and fixed it so it should be impossible to happen on GitHub that's right so on GitHub you're fine I'm assuming most of these sites are doing something similar so yeah in general it shouldn't be a big deal if you upgrade to git 2.2.1 you're guaranteed not to have this problem
Starting point is 00:26:07 but yeah I thought that was kind of interesting time for tool of the show tool of the show my tool is not out yet I played it on the desktop I know I'm totally this is the worst kind of cheating but they said it would come out in 2014, so they have like, what,
Starting point is 00:26:28 12 days to pull this off. But it's on desktop. It's coming to Android and iOS this year. It's called This War of Mine. And basically, it's The Sims, but think of it as like
Starting point is 00:26:43 The Sims on hard mode. You know, like like if you've ever played the sims it's very tame right like you the only thing that's really getting in your way is aging and you can turn that off so you know you kind of go through you you learn how to cook you do things at your own pace and uh but it's fun because you're constantly getting better and you grow a family and you see the growth and the growth is addicting you know being a part of that um the thing that kills me about the sims is that it doesn't feel like a game to me it feels like a simulation kind of as the name says and i really wanted the sim like experience, but with a game where like I could lose and their enemies.
Starting point is 00:27:26 And this is exactly that. So in this game, you basically are playing the Sims, but in this war torn Yugoslavia. And it's very hard to survive. Even to just grow food is extremely difficult. And the goal is to survive for, I won't spoil it, but for a certain number of days. And as things go on, you get more and more desperate because it's very hard to become sustainable.
Starting point is 00:27:54 So I'm trying to look here. I don't actually understand. Is it a multiplayer game, a single-player game? It's like The Sims, so it's single-player. I mean, you're managing multiple Sims, but it's totally the sims so it's single player i mean you're managing multiple sims but uh but it's totally single player um it's it has another thing that's pretty cool so in later versions of the sims they had this sort of uh vacation mode where you'd go on a vacation somewhere and then it becomes almost like an adventure game um this kind of took that idea so at the end of every day so after i think it's 12 hours of
Starting point is 00:28:27 of in-game time uh you can scavenge and so you pick one of your sims and you send them and now the game becomes kind of like a kind of like a point and click adventure in a sense but like you gather resources you trade with people so like during the day you can uh make moonshine and then at night you can sell the moonshine to soldiers for money and then uh and then use that money to buy bread and anyways there's a whole economy thing going on but it's really cool i had a incredible amount of fun playing it i got kind of burnt out because i played i was playing like all nighters playing it was kind got kind of burnt out because I was playing like all-nighters playing it. It was kind of ridiculous.
Starting point is 00:29:07 And then I beat the game, and then I was like, okay, I got to take a break. But I actually want to play it again. I'll definitely be buying it on iOS when it comes out. So, yeah, check it out. All right. My title is also, well, I guess it's only iOS, but also mobile, and it's called Vainglory. You may have seen this
Starting point is 00:29:25 on advertisements on the actual television they've been running ads for it and i believe as part of the wwdc presentation uh where they talked about the new metal api for doing graphics processing on ios and this is a massive online battle arena is that right moba um which is apparently the hot thing i'd never played a moba before until i tried this one and i did really miserable at this one for a while and now i think i'm doing slightly less miserable um but it looks really beautiful like it's really amazing um like on it doesn't feel like it's a mobile game it feels like it could be a pc using a mouse and a keyboard it really feels good and high quality, and it doesn't feel weird or hard.
Starting point is 00:30:08 I've played other games where there are supposed to be sometimes PC ports or PC quality style games, and the controls are very awkward and weird and it just doesn't work out well, and I didn't ever feel like that with this one. Yeah, I've also been playing Vainglory. Yeah, I think it's great. I actually always kind of wondered how the UI would work one yeah i've also been playing vainglory uh yeah i think it's great it's it's i actually i always
Starting point is 00:30:26 kind of wondered how the ui would work for a moba because you know there's times where you have to click across so you've played other mobas before though yeah i've played like desktop mobas and you know one of the things like clicking on the other side of the map to go to a strategic location the way they did that where i mean i don't know how you do it but the way i do it i use my middle finger on the mini map to like pan it around then when i have the spot i want to use my index finger to just tap anywhere on that screen yeah something sort of like yeah yeah so the way they did that was very clever um also so in most MOBAs, the enemy's health, like the little grunts, their health doesn't turn colors when you can one-shot them.
Starting point is 00:31:11 And that actually makes a huge difference. Because with, like, Dota... Oh, I didn't know this. Wait, wait. So when they're on their last hit from you, is the only time it changes colors? So, yeah, like, the enemies, the little grunts, they have a regular health bar but when you can like when the game calculates you can last hit them the bar turns like a bright red
Starting point is 00:31:30 oh i didn't yeah and so that makes a gigantic difference because in dota um you have to constantly like you know because you have a desktop with a big screen the health bars are bigger and you have to sort of look at the health bar how many pixels wide it is and make a judgment call on if you can do the last hit and often you're wrong and it doesn't completely kill the enemy and so as soon as you go to mobile this becomes even more frustrating with the health bars being small right so they they just they just said look we're not going to play this game we're just going to tell you when it's a last hit and i thought that was clever um so yeah basically they got a bunch of things right uh with this game so i think it's pretty awesome and it's free to play i think most mobas are now right yeah that's right yeah totally free to play
Starting point is 00:32:20 you can that's like the and so in this one the only thing as far as i can tell that you spend money on is they have a rotation of characters and only a subset are available for free to play at any given time so if you want to guarantee your favorite character is always available you have to you know buy it with either in-game currency or currency that you converted normal dollars you converted to in-game currency or whatever but right now they don't have any other way to spend your money as far as yeah that's i think that's right so yeah the um defense of the ancients they give you all the characters but uh you can spend money on silly hats and stuff like that um they actually they added some things recently which are pretty cool in defense of the ancients like you can spend money to um to like make a bet on who will win the game and based on the results of the bet you get items and so it's it's basically the same
Starting point is 00:33:15 thing like you're you're getting silly hats but because it's like they basically you pay for this gambling mini game that you play while you're playing dota kind of like like you can bet against your own team and stuff like that so uh so those things are actually wait that sounds awful because if you bet against your own team you can just you can just make your team lose uh that's true yeah i never really thought about that but uh this is like why gambling is so controversial amongst people who are professional athletes. But I think the consequence of winning or losing the bet is low enough that it's like, I'm not going to spend an hour playing a game that I've thrown so that I could get, you know,
Starting point is 00:33:57 one one hundredth of a silly hat. So anyways, they have a bunch of cool things like that. So I'm sure Vainglory will go in the same direction eventually all right all right so on to rust on um yeah rust is rust is pretty cool i uh actually this was a user request i believe um somebody's i think multiple user requests yeah that's true multiple so uh i didn't even know about rust um and uh you know it hasn't hasn't really made hacker news or at least i haven't seen it on hacker news uh actually i take it back you must not look at it very often yeah i was gonna say i'm sure it's made hacker news but i just happen to not catch it um but uh it's just
Starting point is 00:34:43 it's the same as this new trend of languages to have the same name as common things. Go, Rust. Uh, I don't know of another good example, but it's this problem. Like you see it and it's not clear that it's this. Also, there was a video game called Rust or is a video game called Rust. So for a long time, I thought they were talking about the video game. Yeah.
Starting point is 00:34:59 Yeah. Why do they do that? They should make it something very clear. X, Y, Z, Z, Y or something. No, do not call it that that do not name a language that um do you know what that's from oh x y z z y is the is the code you had to put in adventure to open this door and uh there was some way to figure out it was that, but it was super hard. Anyways, so Rust. Okay, so Rust, it's like C++. It tries to be close to the metal.
Starting point is 00:35:32 It's meant for system software, web servers, socket servers, those kind of things, embedded. It compiles straight to machine code, so it could be used for embedded. It uses LLVM. those kind of things, you know, embedded. It compiles straight to machine code, so it could be used for embedded. It uses LLVM. So if you have like an LLVM to machine code compiler for your, you know, Raspberry, Raspberry Pi is a bad example, but for your crazy architecture, Motorola, whatever, then it can, it'll work.
Starting point is 00:36:02 You don't have to, you don't need any, an Intel processor or anything like that. It tries to be very memory safe. So what that means is you actually can't get a null pointer exception at runtime. So the way the language is designed, if it's possible for you to null pointer exception, the compiler will just not allow that code to be compiled, which is pretty cool because most null pointer exceptions,
Starting point is 00:36:33 it's not because someone is doing something absolutely crazy and there's a chance of it happening. Most of it are just blind user error. And so if someone is doing that, it's just a bug that they need to fix. Very rarely do you have to do something really wacky with pointers um but with that in mind rust does not allow unsafe pointers so you know for example if you have some fpga that's running on a certain memory address um and you just know that that address you know is 0x12345678 um you can't just say pointer is equal to that um it won't let you do that so um
Starting point is 00:37:15 all the pointers have to kind of come from references to objects and wait so how do you how do you do that then i don't think you can do it i mean i'm assuming they'll add like an unsafe pointer you know some way to do that but at the moment you can't do it um so uh yeah so same thing with like in place uh new and things like that placement new you can't really do that yet um but in exchange you get a bunch of cool stuff you get type inferencing you get you know complete memory safety um a bunch of cool features one thing they have um a common problem is if you have multi-threading and you share a pointer to an object with another thread then it's very difficult to to keep track of who owns this object.
Starting point is 00:38:05 It's always kind of a nightmare. So what Rust does is it says the thread that created... So the way that Rust works is you create a box, and a box is basically a wrapper around a pointer, which says that I want this pointer to go to another thread, this data. And you can share boxes with other threads, but at the end of the day, you have to own the memory. So if another thread tries to delete a box that it didn't create, the compiler gets unhappy.
Starting point is 00:38:40 Yeah, and so which thread created the box is actually encoded sort of in the box type. So there's that. It has traits, which are similar to interfaces in Java. But one difference is you can actually have function bodies in traits, but the functions, there can't be any data members. So in other words, you know, like in Java, if you have an interface, you can't have like int a as a member of the interface.
Starting point is 00:39:14 It doesn't let you have data. And that's because of the diamond problem, right? Like if you have two interfaces with an int a and you have a class that implements both of them, now it becomes like very a nightmare right it's ambiguous so they don't let you do that but you can have functions the catches the function body you basically your only parameters can be what gets passed into the function which is cool so for example if you, you could have an interface called, like, square and have a function called area.
Starting point is 00:39:48 But it would have to take the length of the square as a parameter. But, yeah, there might be cases where you need functions like that. So this is like, yeah, that's the same thing as a function pointer. Yeah, yeah, it's basically a function pointer. So that's pretty cool that was i thought that was very clever um it has two run times which i thought was interesting so it has native and green um in native mode rust behaves just like c or c++ you know if you create a new thread um you know using p threads or win threads or whatever
Starting point is 00:40:23 in c++ then uh it's it's a new thread. And so the OS keeps track of all the threads and all of that. As you remember from our Go podcast, we talked all about coroutines and Rust supports coroutines. So if you use the green Rust runtime, then you get support for coroutines, which is pretty cool. So, you know, there might be cases where you have very limited memory or you need real-time guarantees and things like that. You can use the native Rust runtime for that. And for everyone else, we can use the green Rust runtime,
Starting point is 00:41:01 and now it behaves like Go. But you have to choose one per program? You have to choose... That's right. Per binary? That's right. It's actually, I think, a different compiler or something like that. Oh, okay. Yeah. Is the API similar enough that you can move it back and forth? Actually, it's identical. So for both of them, there's an idea in Rust called a task,
Starting point is 00:41:32 which is basically like a thread. They're all kind of the same thing. So in Rust, you create tasks. And if you're using the native Rust runtime, a task becomes a thread you use the green runtime a task is a coroutine but none of your code changes so it just the guarantees change like if um you actually specify the size of the thread pool so let's say just keep things simple let's say you have a thread pool of size two so you have that means that you have you know one thread available for your main uh thread then there's one other thread so if you spawn two tasks in rust and you have a green runtime with a thread pool size of two
Starting point is 00:42:20 it can't execute both of those because it's already using one for the main thread and only has one left. So it'll execute those two spawned tasks serially. So if you use the native version of the runtime, then every time you call spawn, you're going to get a new operating system thread and it's going to start. So it's a guarantee that if I call spawn, this code is going to start executing as fast as possible, right? Well, it's gonna let your OS try to decide. Yeah, that's right. I mean, yeah, the guarantee is that is that you will be it will do the best the language can. That's right. That's right. So, but with the coroutine, you know, if you have a thread pool size of two and you execute, you know, 10,000 coroutines,
Starting point is 00:43:14 they're all going to execute sequentially. Whereas if you have 10,000 threads, they're all going to execute in parallel. I mean, that might, yeah, that might hurt you. Yeah. So in practice, you know, 10,000 threads, probably not a good idea. But, you know, 10,000 threads, probably not a good idea. But, you know, in theory, that's how the native one works.
Starting point is 00:43:31 So I would imagine the native mode is only for people doing, like, very low-level embedded where they really need that, you know. Yeah, that's interesting. I've not really heard of something that like out of the box wanted to support two runtimes other things do support multiple runtimes but well this actually came from go so i so one of the common criticisms of go is that you can't guarantee that a go routine is going to start even you know within minutes of when you create it. And so I guess that's a pain point for some people. So, you know, I personally, not a big fan. I feel like if you need something to start, you know, within a minute,
Starting point is 00:44:16 then you're probably doing something wrong. But, you know, who knows? Yeah, I don't know sometimes these pain points, if people actually ran across a legitimate problem or they're just imagining in theory this could become a problem. But in practice, you wouldn't actually hit it. Yeah, exactly. I'm thinking in practice, either one of two things.
Starting point is 00:44:39 Either you're doing like a web server where, you know, if you have a few seconds in between like when you spawn a task and when it executes, it's not that big a deal. Or you're doing some very low level embedded, in which case you don't have that many tasks. So they would just start right away anyways. So, yeah, if you're not if you're doing embedded, you're not running any of these languages. Let's just be honest. That's true. But you could be.
Starting point is 00:45:09 There's no reason why you could maybe it'd be nice there's really no reason why you couldn't run rust on even a motorola i've not looked enough at its compiler but yeah well it goes through llvm which is what clang goes through they make the claim that their whole goal of the language is to be as fast as clang or be as close to clang performance wise as possible while still having you know these features and they claim to be pretty close so who knows okay um so yeah it was made by a motor mozilla employee so actually i wanted to talk about this for a little bit so have you heard of m scripted yes so m scripted we've talked about it i believe yes in our javascript episode yeah yeah so m scripted was created by mozilla employee and this was and basically i feel like mozilla employees are just very creative people
Starting point is 00:45:57 like it just seems like or at least these two were well yeah maybe it just i i get the impression that like a lot of the cool stuff that's coming out now is coming out from mozilla employees but i could be wrong i don't know i i guess for the size of the company it just seems like they're creating a lot of cool stuff but i mean they're also their wheelhouse is also very well aligned with what the internet would think is cool, right? So, you know, Mozilla is concentrated mostly on making browser and web-related tools and products. I don't know if they do anything else. But, like, I don't even think they're doing server stuff or whatever.
Starting point is 00:46:38 But maybe, maybe. Yeah. And so, but that's what people would find cool. Because if you're a web programmer, right, you're going to be very interested in something like Emscripten or Rust. You know, not so much. It doesn't seem as exactly in their wheelhouse, but. Yeah, that's a fair point.
Starting point is 00:46:52 Yeah. I guess I can explain how it would be work related and how, what you're working on there would be of interest to like, it's a very popular thing right now. Right. Yeah. Right. Um, yeah, it's still, but that's a good point there's a lot of good stuff seeming to come out of mozilla i can't dispute that yeah oh the other thing is they
Starting point is 00:47:10 created like an all javascript pdf renderer which i thought was pretty cool i don't know it's just kind of goofy stuff nothing nothing like groundbreaking but just kind of cool like this is what i would do if i had a bunch of free time um anyways well you should go work at mozilla then apparently yeah apparently mozilla gives you a lot of freedom um so i have a it says your great standard library so uh this is the batteries included thing yep so a lot of tools out of the box that you get to do common operations so you're not gonna have to go write your own json encoder or decoder yeah i mean that's one thing about c++ that kills me like there's no easy way to go from c++ objects to disk and back without having to write a bunch of boilerplate like the
Starting point is 00:47:58 best is the boost serialization library and even that one's not that great i mean ultimately c++ doesn't have reflection so you know it just there's no way to do it but this does so uh actually this this doesn't have reflection but the language it's like the compiler itself has this auto serialization built in that's how they get that's how they pull it off um so yeah on the cons we talked about this already but you know obviously going to be slower than c++ um they make the claim you know if you tried to write all of these memory safety checks and stuff yourself in c++ that they would be faster but that's not saying much because uh that's not what people want to know people want to know is like what kind of performance hit am i going to take you know um the other con is too early yeah that's not what people want to know. What people want to know is like, what kind of performance hit am I going to take?
Starting point is 00:48:47 The other con is too early. Yeah, that's always the problem, right? Is like in C++ for right or wrong, you don't do that. But there are certain areas where you kind of say like, I want to sacrifice, I get in trouble for this. I do a lot of low level programming and I get in trouble all the time. People are like, oh, this is not considered the safe way
Starting point is 00:49:04 to do this in C. And it's like, oh, this is not considered the safe way to do this in C. And it's like, well, this is some graphics routine that needs to run X number of times a second a lot and needs to run really, really, really fast. So yes, you may think that it's not harmful to add, not make this an inline function, like just make it a normal function. But it's like I measured it and turns out on our platform that it's 10% i measured it and turns out on our platform that
Starting point is 00:49:25 it's you know 10 faster to make this inline at the expense of a little bit of code size even though that's a violation of like the standard it's like but i measured it on our platform and in this circumstance i need the speed over the the you know share it's not premature optimization well maybe it is but i don't think it's premature you know we got to the point we needed the speed and now it's time to do it. And you can. Yeah. Versus like something like, you know, when you hear tools or whatever saying, oh, well, if you try to do all this in another language, you know, it wouldn't be as fast.
Starting point is 00:49:55 It's like, well, but sometimes I don't want to do all that. Yeah, exactly. I mean, if you use Rust, you're handcuffed to doing all that stuff, whether you want it or not um but for 99 point some number of nines you probably don't actually need to you shouldn't be skipping those things anyways yeah um my biggest con with rust is that uh it doesn't have good third-party library support and specifically it doesn't have any way to communicate with other like programs written in other languages you know like protocol buffers thrift avro like even just having one of these would make a huge difference so no good rpc support yeah
Starting point is 00:50:38 there's no rpc support um and so yeah i mean there's you know basically it's you know you have to write if you wanted to write part of your application in Rust, you'd have to talk to it through JSON, you know, and you'd have to handle all the deserialization yourself and all that. And so, you know, I'm sure someone will make it. It's just not there yet. And, you know, on top of that, it's it's still an alpha mode. And the developers encourage you to download like the latest bleeding edge build they basically say don't download the stable build because it's missing so many features and we fix so many critical bugs that you're better off getting
Starting point is 00:51:16 you know today's development branch than the stable release from three months ago and that's don't use this for your work project, but for your hobby project, have at it. Exactly. I mean, it's basically where Go was when we talked about Go. And now Go is much more mature. So I'm sure this will shape up just fine.
Starting point is 00:51:37 But in the meantime, it's a cool language to learn so that you're ready for when it becomes more widely accepted. Wait, is that the equivalent of playing the stock market? If you guess at what language you think will be big next and you invest a lot of time and effort into trying to learn it so that when it becomes big,
Starting point is 00:51:57 you'll be one of the first people to be ready for it? Is it like a speculative learning thing? Yeah, I mean, in some way, we were speculators by learning the gpu we just never cashed in on it yeah we didn't get our mad monies story of my life but yeah i remember when tesla ipo'd and i was gonna buy some and oh now it's i had a friend who was telling me like buy tesla buy tesla buy tesla when it was like 40 a share and uh yeah that guy's like rich now he's like a multi-millionaire that hurts you know even like our first show was on bitcoin and if if any of the people no bitcoin has slid a lot now though yeah that's true that's true
Starting point is 00:52:39 so i think it's down i'd have to look at it i i want to say it was down like 50 this year um and so that's always the problem right like your your friend who's a multi-millionaire if he cashed out all his tesla right now but most likely he'll hold on to it and then it'll go down and then like and i shouldn't say most likely all these people invested in bitcoin said oh i'm so rich like my bitcoin's up tenfold 10x right like and then so it's still up 5x but they'll all feel bad because they lost half of what it was worth yeah so then they'll wait for it to go back up as it continues to slide down to zero or goes back up i don't know what bitcoin will do yeah yeah i don't know it's true that is true like uh you whenever you reflect on these things you always reflect on the high. It's almost impossible to time that.
Starting point is 00:53:29 I think that... Learn a language before it becomes a real thing. If Rust was a stock, I would invest in Rust. It comes rather close to Go. The Go language. It's unclear why would you use Rust if you use go I mean rust
Starting point is 00:53:47 does have the memory checking I guess that is a big thing that go doesn't have but yeah I guess that would be the that would be the the number one reason to stick with rust but but yeah it's pretty cool check it out you can actually do some pretty fun stuff like get a pointer to a vector and then do pushback and then try to access that pointer. Rust gets unhappy. It says, hey, you did pushback on the vector. You have a vector called Realloc.
Starting point is 00:54:16 Now you're trying to access this pointer again. It feels cool to see the compiler experience something that you would over the course of hours as you tried to debug like that whole process was kind of cool for me so check it out you know compile a few programs it's pretty cool and then uh uh you know wait a couple years until it's until it's awesome so it looks like the high of bitcoin was 950 and it's currently trading at 310 what was it when we made our first episode? That was like five years ago.
Starting point is 00:54:49 Hang on. The chart doesn't go back that far. In 2011, it was worth 40 cents. Yeah, there you go. So if you listened to our first episode and bought $1,000 worth of Bitcoin, you're like a millionaire now or something. Wait, if you bought... Oh, I don i don't even know yeah that'd be ridiculous think of that like a thousand
Starting point is 00:55:10 dollars is you know for most people like what two paychecks or something and uh it's just like weird to think about that but again there's no way to know that that would have happened. I'm trying to calculate in my head. The orders of magnitude is throwing me off. So, okay, let's say it was $1 and it went up to $900. That's two orders two times. So if you spent $1,000, you would have made $100,000. So, yeah. So if you invested like, yeah, $1,000, you'd have been like a millionaire.
Starting point is 00:55:41 Yeah, isn't that wild? And then if you had done it in like Dogecoin, you'd have been like a millionaire. Yeah, isn't that wild? And then if you had done it in like Dogecoin, you'd have like nothing. Yeah, that's the other thing too, is like your brain is trained to see the outliers. It's not thinking about the millions of other like crazy things that came out that were not popular. It's a legitimate thing, right?
Starting point is 00:56:04 Like, what is it? It's a legitimate thing, right? Like stick, what is it? It's like survivor bias. So if you look at the S and P 500 today and say, if I had bought all those stocks, you know, 10 years ago or whatever, and you say like how much money I made, it's actually not fair because a bunch of stocks,
Starting point is 00:56:19 which used to be in the S and P 500 10 years ago are now bankrupt and worth nothing. So like you would, it's like survivor bias. You can't take a stock that exists today and trace it back 10 years because you have to look at the number of stocks available 10 years ago. You know what I mean?
Starting point is 00:56:36 Like when you pull from the distribution 10 years ago of stocks that were on the market 10 years ago, it's different than pulling from today stocks, which also existed 10 years ago because that guarantees they are good companies that survived at market 10 years ago is different than pulling from today stocks, which also existed 10 years ago, because that guarantees they are good companies that survived at least 10 years. Yep, that's right. You know, one thing that amazes me is Silicon Valley still,
Starting point is 00:56:54 like many parts of Silicon Valley still haven't recovered from the dot-com boom. Like I was looking at specifically housing prices and there's many places like around san jose morgan hill like all these places where housing prices are down like 20 30 percent from their 1999 price like that just blows my freaking mind um but uh yeah the dot-com boom was like a very popular boom right like a lot of people were in on it yeah i mean your stories i remember hearing stories this we were well i don't know about you but i was in high school you're probably in high school right at the time no i don't think i was
Starting point is 00:57:35 even in high school yeah but the uh i mean i was hearing stories about like you know yeah like you get a you know you get a brand new car as a sign-on bonus and stuff like that just like ridiculous stories like a like a like a nice car you like a lexus as a sign-on bonus but uh those days are gone and that was someone who just like sat and did excel all day long yeah that's right they wrote a they wrote a ip tracer and visual basic or whatever did you see that csi episode no it's a csi episode it's kind of internet famous where this guy's like uh a hacker is hacking into our csi database we have to stop him and this woman shows up and she goes i'll write a ip tracer and visual basic
Starting point is 00:58:17 and he's like good get on it so funny, thank you to all our listeners and current viewers. Yeah. All the dozens of you. Yeah, yeah. I mean, we have a number of people on the Twitch stream. My Twitch, for some reason, is flipping out. So I can't actually tell how many people are on the Twitch stream. But I feel like it's more than there was last time, which is pretty cool.
Starting point is 00:58:43 We're the new Bitcoin, baby. Yeah, that's right. We're the Bitcoin of podcasts. The activity on Google+, on Facebook has been great. Lots of user questions. This time
Starting point is 00:59:00 we did something a little different where we just picked a few of the top user feedback and read it out. I felt like it went pretty well. It's a lot of interesting content. So thanks for that. Um, thanks for listening and checking out your books and tools, the show and all of that. And, uh, and there actually are way more than dozens of listeners and we appreciate all of you. That's right. We have, we have dozens of viewers, but thousands of listeners and a big shout out to you guys for guys for, you know, it's because of you that we make this show. So that's what sort of keeps it fun for us. Well, see you in the 2015.
Starting point is 00:59:35 That's right. Have a happy new year, happy holidays and all of that. And I will see you next year. The intro music is Axo by biner pilot programming throwdown is distributed under a creative commons attribution share alike 2.0 license you're free to share copy distribute transmit the work to remix adapt the work but you must provide attribution to patrick and i and share alike in kind

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