About this episodeThis show covers Rust: A memory-safe systems programming language. Tools of the show: Jason: This War of Mine Patrick: Vainglory. ★…
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
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Rust
Email. It's such an integral portion of our lives. It is. But what is it? Where does it come from? What? Does it taste like? What does it taste like? It's delicious. So Jason and I were talking about how email has become increasingly a portion of our business lives. I guess personal lives as well. 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 Inbox Zero, whatever approaches. And it turns out I just end up using my email as some sort of weird to-do. And I like seeing things—whether they're unread, read, out, in, labeled. All of these are various levels of to-do for me. But
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. 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 it—I call it the boomerang feature because that was the name 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.'
Yeah, I have this one mailing list that work and they put automated emails like test results. But then it's also used for like real communication. And that's the worst because 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.'
Silly. Yeah. But actually, you know, there was that time where they were trying to do Google Wave as like a replacement for email. But that didn't really take off. I really think email is one of the last few things that needs like a refresh. You know, I mean, we completely refreshed the way video works. Like with, you know, you go from your camcorder to YouTube. Like so many things now are just so just completely fundamentally different than they were before. But email is basically the same thing. 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 none of that whole hacky protocol has stayed the same all those years.
Well, even the fact that most of the email has moved to conversations like threads, right? Kind of like more like forum posts or whatever. It would almost be better of like when you sent an email. Instead, you were just creating like a wiki entry somewhere. Yeah. 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. Yeah. So it needs to support both cases.
And it has to be backwards compatible. Because you're not going to get everyone off email in a day, right? That's right. I think the big problem with Wave was that, you know, the first thing Wave should have done is like allow it should have taken your entire inbox and converted it to Wave, you know?
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 emailing a version Word Doc around is the worst idea.
Email it back. Oh, that's so bad. That's so bad. So there's another thing, actually, now that 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 was a bunch of pictures. I wanted to send it to my parents. And I realized there's just no, there's just no way for me to do this. I mean like, you know, so that's such that my parents could receive the file without being like wizards or anything, 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 a copy. But two gigabytes is a lot for them not to agree to accept. 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, 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 Simon Yu, 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. So I haven't tried it or anything, but it looks cool. It's on GitHub, so I'm assuming it's open source. It looks pretty awesome. I wonder how it works. Let me see. Overview.
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 is so bad, that if you can do that, that you can make, as they said, mad money.
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. 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. 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. But I think it's interesting. I mean, it's obviously a different perspective. 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. 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, you know, nothing's like impacted immediately. But, yeah, I think he did bring a valid point. And the article is actually quite interesting. So, definitely check it out. It's a different perspective on it.
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.
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, you know, killing the entire binary and now nobody can do anything, then obviously you have to not throw any exceptions there. Finally, you have a Bens Magyar. Hopefully I got your name right. Bens Magyar. He linked to this pretty cool Python library called Bokeh, and it's a visualization library for the browser written in Python. So, I definitely want to check this out. Like 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 a look at this. And you guys should too. It looks pretty cool. That does look great. All right.
Time for the news. For the news. First article is mine of Virginia. Oh, I guess the 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. Is there a magazine called Computer? I don't know about.
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 about what we talk about. For example, representing three-dimensional space, you use four-dimensional matrices. And they give a little bit of explanation about why that is. About some of the things that having a GPU allows you to do that weren't really feasible before. About shaders. About general GPU. Just kind of like a cursor overview. It looks like about five pages long, so not that long, but a good thing. We've talked about GPUs a number of times, and this is a good overview of what it is and the context behind it.
Hmm. Yeah. I'll have to check this out. Actually, you know, the GPUs... I have a friend from NVIDIA who is telling me that they're doing a lot more machine learning GPU activity. 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, that's pretty... It's pretty awesome. I mean, I think you know, a lot of processors are now coming with GPUs, either on the die or... Or, you know, a lot of devices have GPUs in them and stuff like that. So, this is... We might have to revive our GPU skills. So... 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. 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 use the term 'open source' for something that isn't sourced. So, 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 used to secure their like VC funding. They got something like 70 million or something in Series B or Series C. And it's about how they did that. And, 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, it was 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 like not really in that area. So, for example, there's a term called KPI. That's Key Performance. I forgot what the 'I' is. No. Do you know what the 'I' is? Let me look it up. But, it's like KPI and it was about, oh, 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. 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 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.
was just a hypothetical. Yeah, right. Even if, like, you, uh, even if you literally have something completely brand new, 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 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, uh, 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. So most people have probably at least come across Dr. Dobbs at one time or another. They have a huge corpus of like programming related content. So they get a lot of search hits when you search various programming topics. 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. That's where they put it on a dead, dead tree paper. And like, I don't know the magazines are that common anymore. I guess they are. And so they're finally stopping. And the guy was making a point. He's like, it's kind of the person writing the article. It's kind of interesting because their website currently has more page 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. But that, you know, how much they're making is going down because basically they relied on pay-per-view ad and the pay-per-view ad industry is just like drying up. Yeah. Right. Cause it turns out no one clicks on those ads. No one like it's not helping anybody by seeing them. People block them from their vision. And so they're, they're actually, their ability to make money has suffered.
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 feels like their business hasn't hadn't really adapted. I wonder how like TechCrunch and these other sites make money? That's through pay-per-view ads, right?
Yeah. That's what it is. That's actually the right answer. I mean, yeah, that they—uh, yeah, you're right. All of these people, even like no JS and stuff, they have the NoJS conference, and it's like a thousand dollars to go, you know? Um, yeah. These people didn't really 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. Dodds 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. 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 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, you know, keep it on the Internet Archive or something so that, you know, all their historical, you know, information.
Oh, okay. They just won't make new content. Gotcha. Gotcha. Okay. Cool. So, 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? The thing in Bash. I'll look it up. Keep going. So there's Bash. There's the Heartbleed, which everyone knows about—the bug in SSL. Shellshock. Shellshock. 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 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 exploit is very, very simple. Basically, you know, the way your Git repository works, you have a folder called .git. And in your .git folder, you have all these things, among of which is this folder called hooks. And in the .git/hooks folder, you can do hooks. So, for example, every time you commit, you can, you know, save the date to a file, or you can... 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 stressed he was when he was making the commit. Just goofy 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 if it's not auto-formatted, then fail the commit, etc. So now if somebody in their Git repository has like a .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 .git folder because you would be able to do this, right? But they didn't think about case insensitive. So if you have, for example, like a .git 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 HFS case insensitive by default. So yeah, all you have to do is make a .git folder and then make a hooks folder. And then, you know, rm -rf 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 do
Oh, I see. So I haven't heard anything about it. Maybe this is how those hackers got into Sony. Oh. 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
Tool of the Show. My tool is not out yet. I played it on the desktop. What? 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, 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, The Sims on hard mode. You know, 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 learn how to cook. You do things at your own pace. And, 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. 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 Sims-like experience, but with a game where, like, I could lose and there are enemies. 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.
like The Sims, so it's single-player. I mean, you're managing multiple Sims, but it's totally single-player. It has another thing that's pretty cool. So in later versions of The Sims, they had this sort of vacation mode where you'd go on a vacation somewhere. And then it becomes almost like an adventure game. This kind of took that idea. So at the end of every day, so after I think it's 12 hours of in-game time, you can scavenge. And so you pick one of your Sims and you send them. And now the game becomes kind of like a point-and-click adventure in a sense. But you gather resources. You trade with people. So during the day, you can make moonshine. And then at night, you can sell the moonshine to soldiers for money. 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 an incredible amount of fun playing it. I got kind of burnt out because I was playing like all-nighters playing it. It was kind of ridiculous. 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. And 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 on advertisements on the actual television. They've been running ads for it. And I believe it was part of the WWDC presentation 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. 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. But it looks really beautiful. Like it's really amazing. Like on, it doesn't feel like it's a mobile game. It feels like it could be a PC using a mouse. Like it really feels good and high quality. And it doesn't feel weird or hard. Like I've played other games where there were supposed to be, you know, sometimes PC ports or PC quality style games. And like the controls are very awkward and weird and just doesn't work out well. And I didn't ever feel like that with this one.
Right? Yeah, 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. And then when I have the spot I want, I use my index finger to just tap anywhere on that screen.
Know this. And so that makes a gigantic difference. Because in Dota, 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 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. So yeah, basically they got a bunch of things right with this game. So I think it's pretty awesome.
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 I know.
Yeah, I think that's right. So yeah, the Defense of the Ancients, they give you all the characters, but you can spend money on silly hats and stuff like that. They actually, they added some things recently, which are pretty cool in Defense of the Ancients. Like you can spend money 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 basically the same thing. Like you're getting silly hats. But because it's like they basically, you pay for this gambling minigame that you play while you're playing Dota, kind of. Like you can bet against your own team and stuff like that. So those things are actually kind of... Wait,
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, 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. Yeah. Rust is pretty cool. Actually, this was a user request, I believe. Somebody...
It's just, it's the same as this new trend of languages to have the same name as common things. Go, Rust. Yeah. 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? Yeah, that's right. So for a long time I thought they were talking about the video game.
But do you know what that's from? Oh, X, Y, Z, Z, Y is the code you have to put in Adventure to open this door. And 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. It's meant for, you know, system software, web servers, socket servers, 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 Pi—well, Raspberry Pi is a bad example—but for your crazy architecture, Motorola, whatever. For your architecture, yeah. Then, it can, it'll work. You don't have to, you don't need any 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, 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, but with that in mind, Rust does not allow unsafe pointers. So, for example, if you have some FPGA that's running on a certain memory address, and you just know that that address, you know, is 0x12345678, you can't just say pointer is equal to that. It won't let you do that. So all the pointers have to kind of come from references to objects. And wait, so how
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. So yeah. So same thing with like in place, new and things like that placement new. You can't really do that yet, but in exchange, you get a bunch of cool stuff. You get type inferencing, you get complete memory safety, bunch of cool features. One thing they have, 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 like keep track of who owns this object. 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. 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. Yeah, and so the which thread created the Box is actually encoded sort of in the Box type. So there's that. There's 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, like in Java, if you have an interface, you can't have int a as a member of the interface. 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 that catches the function body. You know, basically your only parameters can be what gets passed into the function. Which is cool. So, for example, if you have, you could have an interface called like Square and have a function called area. But it would have to take the size, the length of the square as a parameter. But yeah, there might be cases where you need functions like that. Or, you know. So, this
Yeah, yeah. It's basically a function pointer. So so that's pretty cool. I thought that was very clever. It has two runtimes, which I thought was interesting. So it has native and green. In native mode, Rust behaves just like C or C++. You know, if you create a new thread using pthreads or Win threads or whatever in C++, then it's a new thread. And so the OS keeps track of all the threads and all of that. But 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. And now it behaves like Go.
Actually, it's identical. So, for both of them, there's an idea in Rust called a task, which is basically like a thread or, you know, they're all kind of the same thing. In Rust, you create tasks. And if you're using the native Rust runtime, a task becomes a thread. If you use the green runtime, a task is a coroutine. But none of your code changes. So, it just guarantees change. Like, if 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 2. So, you have... So, you have... That means that you have, you know, one thread available for your main 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 2, it can't execute both of those. Because it's already using one for the main thread, and it 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?
That's right. That's right. So, but with the coroutine, you know, if you have a thread pool size of 2, and you execute, you know, 10,000 coroutines, 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, but, you know, in theory, that's how the native one works. So, I would imagine the native mode is only for people doing, like, very low-level embedded where they really need that, you know?
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, then, you probably you're probably doing something wrong. But, you know, who knows? So.
Yeah, exactly, exactly. I'm thinking in practice, either one of two things: 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.
But I mean, their wheelhouse is also very well aligned with what the internet would think is cool, right? So, Mozilla is concentrated mostly on making browser and web-related tools and products. I don't know if they do anything else. But I don't even think they're doing server stuff or whatever. But maybe, maybe.
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 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's just there's no way to do it, but this does, so. 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. So, yeah, on the cons, we talked about this already, but you know, obviously going to be slower than C++. 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 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? Yeah. 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, 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 to do this and see. 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, you know, 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, 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, you know, shared. It's not premature optimization. Well, maybe it is, but I don't think
Yeah. My biggest con with Rust is that 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.
Yeah, there's no RPC support. And so, yeah, I mean, there's, you know, basically, you know, you have to write, if you wanted to write part of your application in Rust, you would 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 in 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, you know, today's development branch than the stable release from three months ago. And that's, that's about something. So
Exactly. I mean, it's basically where Go was when we talked about Go. And now Go is much more mature. So, you know, I'm sure this will shape up just fine. But in the meantime, it's a cool language to learn so that you're ready for when, when it, you know, becomes more, becomes more widely accepted.
Wait, is that the equivalent of like playing the stock market? Like if you guess at what language you think will be big next and you invest like a lot of time and effort into trying to learn it so that when it becomes big, you'll be one of the first people to be ready for it. Is it like a speculative learning thing?
So I think it's down; I'd have to look at it. I want to say it was down like 50% this year, and so that's always the problem, right? Like your friend who's a multimillionaire, 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, I shouldn't say most likely. All these people invested in Bitcoin and 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, if Rust was a stock, I would invest in Rust. The only thing, it comes rather close to Go, to, you know, the Go language. So, it's unclear like why would you use Rust if you use Go? I mean, Rust 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 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 know, the vector called Realloc. Now you're trying to access this pointer again.' It's like it feels cool to see the compiler like 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, you know, wait a couple years until it's awesome. So,
I'm trying to calculate in my head the orders of magnitude is throwing me off. Oh. So, okay, let's say it was a dollar and it went up to $900. That's two orders two times. So, if you spent it as $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.
A legitimate thing, right? Like, what is it? It's like survivor bias. So, if you look at the S&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 which used to be in the S&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 because 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? 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 least 10 years.
Yep, that's right. You know, one thing that amazes me is Silicon Valley still. 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% from their $19.99 price. Like that just blows my freaking mind. Yeah.
Yeah, that's right. They wrote an IP tracer in Visual Basic or whatever. Did you see that CSI episode? No. It was a CSI episode that's kind of internet famous where this guy's like, a hacker is hacking into our CSI database. We have to stop him. And this woman shows up and she goes, I'll write an IP tracer in Visual Basic. And he's like, good, get on it. So
Yeah, that's right. The, the, the, the, the, the, the Bitcoin of podcasts. The activity on Google Plus on Facebook has been great. Lots of user questions. This time 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. Thanks for listening and checking out your books and tools of the show and all of that. And
