Programming Throwdown - Dart

Episode Date: March 20, 2012

This show covers Dart, a client-side browser alternative to javascript. Dart currently only runs in Chrome, but dart code can be compiled to javascript and then run in any browser. News: Rasp...berry Pi, California allows autonomous cars, Stanford online courses. The tools of the biweek are Disk Usage Programs (WinDirStat, Disk usage Analyzer, and Disk Inventory X), and Spelunky. ★ 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 number 12, Dart. Take it away, Jason. Hey, guys. So we had a little bit of a hiatus. I was kind of doing a whole lot of traveling,
Starting point is 00:00:28 wasn't in my residency very frequently, and Patrick is a new father. Oh, no. Congratulations. Who decided that was acceptable? People did not get a vote on that, I promise you. He didn't get upvoted no oh dear um but yeah so it it uh babies have sort of been uh like a recurring thing you know like it's like one person
Starting point is 00:00:56 has a baby and a lot of our friends are having like my wife and a lot of our mutual friends are having babies now and so made me think about kids and one of the things that i think a lot about kids is i think about the you know how they relate to the internet and to tech and things like that you should think about diapers yeah well i just many diapers i told you know lindsey that like we could just adopt a 12 year old and get to like the cool part you know where they're into tech and computers have you met many 12 yearyear-olds? No. Okay. Yeah, maybe that's not such a good idea. But, yeah. So, you know, I was thinking, like, when we were kids, we, you know, our parents, well, maybe your parents were more savvy than mine, but my parents didn't understand anything about computers or the Internet.
Starting point is 00:01:38 You know, my dad, he thought the computer was like an extension of the sewing machine, you know, using the his foot and everything it didn't make any sense that is awesome so we sort of had complete freedom on the internet like and you know you could argue that maybe it made us more responsible maybe it made us like more like adventurous you know it was really the internet was kind of like the wild wild west and we could you know have access to anything um and now you know the internet's become so big and there's there's there's so much content on there and also there's it's so uh more accessible that you have to wonder like for kids who are growing up nowadays like should you censor their internet um or should you sort of give them the same free reign we had yeah it is interesting we actually had some friends of ours who have a one-year-old over,
Starting point is 00:02:27 and the one-year-old was able to get on the phone and bring up YouTube and find Sesame Street videos and watch them on YouTube. And I looked at the parents and said, you realize there's other stuff on YouTube as well, right? And I guess that's only a relatively dangerous place to go on the Internet. But, I mean, yeah, it is an interesting question. So a lot of people do try to install these nanny software or filter software and block certain sites.
Starting point is 00:02:52 And the issue I have with those is that they don't really work. And then when the kids get older and if they haven't learned what's acceptable and what's not, they just figure out ways around it. And so it's not particularly effective. What I think is effective, I think, is educating yourself. educating yourself so we have an advantage of you know we already kind of know about computers so we understand these things and you know tell your kid
Starting point is 00:03:12 that look you know I need to be able to have access to your accounts now you don't ever use that and you hopefully you never have to but you need to share with them that like look this is important I need to be able to know what you're doing and it's for their safety just like you wouldn't allow them to go with people you didn't know to the park or whatever and i think it's important for them to trust you to not constantly be reading everything but they need to know that you can if they if something happens and that they need to know that that's the kind of thing that they need to be thinking about so i think that's one way and another way is also to have the computer in an area or have the usage pattern
Starting point is 00:03:44 set up such that as especially when they're area or have the usage pattern set up such that as especially when they're really young that the usage is very very limited right so that you only use a computer when they're there with you you know that kind of start sorry they only use a computer when you're there with them other way around like yeah okay bring your daughter to work every day oh no no that'd be hard but uh you know so that you're watching them and helping teach them good habits you know just like the state requires you to have a parent or some adult who's hopefully responsible around when you're learning to drive. You know, same kind of thing. As they're learning, they need to have somebody responsible around so they can learn good habits and, you know, what's the right way to do things.
Starting point is 00:04:16 And then even as they continue to grow up and gain independence, still to have it somewhere where they know somebody will, you know, be around and pay attention to what they're doing and that you know show an interest in in caring about what they post online and you know sharing with them the danger about i think it's even different than when we were growing up because when we were growing up it's still mostly consumer oriented so you would go on the internet and consume things you know you would read things you would you know go to stuff that was a concern is you would view something that was damaging to you or that your parents didn't want you to view versus the relatively controlled media of like tv or cds or dvds or whatever that they would kind of know about um but i think the the extra danger that faces children today that is newer is this ability for phones and computers and everything to take video and then post that online or pictures as well. And I see that a lot.
Starting point is 00:05:05 That's very dangerous because then the problem isn't you get damaged, you know, and then nobody kind of knows about it except you and maybe your parents or whatever, but that you could actually post something that's damaging to you and your family, you know, for everybody to see. And then the way the Internet works, that's really hard to remove references to that, you know. Yeah, definitely. If it's even possible. And so I think that is a far
Starting point is 00:05:26 more dangerous thing is people having youtube accounts where they allow children to upload to youtube or you know even having a facebook account reading other people's facebook statuses can be damaging enough but allowing your children to post pictures and stuff to facebook for others to view that's i mean how that's a very hard thing to control i would struggle with not what i allow my kids to watch or view or read but what i allow them to post yeah that's a good point i mean i think you're totally right on the nanny software i have a corker who's in sort of this arms race with his kids where you know he uh he blocks youtube and then they had some other website which is basically a mirror of youtube um and they just use that to get around it
Starting point is 00:06:05 and then he blocks that and they have this whole back and forth and it really doesn't get the message across which is that you want ultimately what you want is for your kids to be responsible and you know setting up setting up a block and getting your kids to like spend a lot of their time figuring out how to break the system like i don't know might make your kid a great white hat hacker or something like that but it's not really getting the message but i think that that you're totally right that you should try to you know in the beginning walk your kids through the internet and sort of you know hold their hand you know as they get through it and then uh later on sort of i always feel like maybe what i would do is kind of spot check you know like if if if things are
Starting point is 00:06:43 going okay and if if i there hasn't been anything weird or if i jump into my kids emails and you know they're uh there's nothing like weird or anything like that then uh you just give them the freedom to do whatever they want but then if they start getting into things which could be damaging because ultimately you're responsible i mean if they are part of some group that you know that hacks into i don't know some kind of like power plant or something like that like as a parent you'll be responsible for that and i think it's a judge when you're checking to say is this something minor or is this something major you know because it's something
Starting point is 00:07:13 minor you know and it's like it's like the kid who's playing a little rough and you know your parents were like fuss when you and your siblings were playing like hey somebody's gonna get hurt somebody's getting hurt they didn't always stop you then somebody would get hurt and they were right and you learned your lesson you know and that's kind of the way it worked versus if you're doing like you know juggling torches you know they probably would have stopped you like hey don't juggle torches you're gonna you know massively burn yourself so i mean i think that's the thing too is like noticing them doing something that's a little bad versus like something that could cause you know major harm yep yeah definitely it's got to be a case
Starting point is 00:07:45 by case basis so i know growing up i uh was pretty responsible on the internet like pretty well responsible but so my parents kind of let me have free reign even you know as technology grew and understood more about the internet they never really had a problem with that but then like conversely it's really bad about doing chores especially like leaving the laundry i'd leave the laundry in the washing machine like just just sitting like wet laundry in the washing machine for like a day. And then those clothes are like virtually ruined. Like you have to rewash them. First, you have to like let them air dry.
Starting point is 00:08:15 Then you have to rewash them. And so my parents are always on top of me like, do you check the laundry? All of our listeners are very excited about this. They did not know they were going to tune in and learn about the proper way to fix forgotten laundry in the washer. It's kind of the same way with your kids, right? Like if they, you know, this is just another dimension upon which you have to like sort of monitor your kids' behavior and stuff like that. I agree. And I think it's as hard as it is. I guess it's difficult for me. I don't really relate.
Starting point is 00:08:44 But people who are parents who aren't, i guess they're not listening to our post but parents for those parents who we all know who aren't as technical savvy i mean i think as technical people you have to help give good advice to those parents because they really don't know and there's a lot of people who really don't know anything about computers and you know you kind of got to give good advice to those people and help them to know what the right thing yeah definitely all right well news yeah yeah it's been a while but we'll try to keep news to relatively new news so so there's this thing you keep seeing around the internet at first i thought it was a dessert raspberry pie and i realized pie was spelled like the greek letter and it turns out it's a embedded computer device that looks pretty cool
Starting point is 00:09:25 um a group of people got together and said you know that they want to make a embedded computer that's going to be $35 that runs Linux and see what people do with it similar to we talked about on the show before the Arduino and other such devices and uh I heard you had you had found this already independently right you had been been looking at these and you even have your name on the wait list. Yeah, yeah, definitely. I'm on the wait list to grab a Raspberry Pi. It's relatively small. It's embedded.
Starting point is 00:09:52 So for people who aren't too familiar with embedded device, basically what that means is it's an entire computer on a single wafer. So on a single like sheet. Yeah, single board. So I'm trying to pull up the specs on how big it is. I think it's like about twice the size of a credit card. So like two credit cards, you can imagine like squarish, like stacked square wise. And so it has many different things on it. So it has, you know, obviously a processor. It has an SD card. So you can pop an SD card, even a 32-gig SD card for storage.
Starting point is 00:10:27 There's a $35, which is $10 more than the base $25 model. That has an Ethernet port on it. But other than that, it still has USB, has HDMI out. I think it even has RCA out and stereo out. So you can imagine you're plugging one of these into your television. You could, it has a GPIO. For people who aren't familiar with that, that's basically a way to. General purpose input and output?
Starting point is 00:10:55 Yep, that's right. It's basically a way to talk to different things. If you have, excuse me, if you have little motors, so you want to make, say, a robot car or something like that, you could totally use a GPIO interface to talk to those stepper motors or talk to those brushless motors if you're making an airplane or whatever. So you can do all sorts of really fun stuff with it. Do you have any ideas of what you would do if you got one? There's so many cool things. Actually, with the baby, you start thinking of, you see stuff in the you see stuff in the store like i can make something that does the same thing or you
Starting point is 00:11:28 know real feeding the baby takes a long time you know so like if you give the baby a bottle or whatever and they drink but it takes a long time they're not good at holding it themselves i think i really should design something to hold this so that you know i can go do other stuff and uh basically try to be as lazy as possible um but yeah so constantly i'm thinking of things like that but uh i think that having hdmi is really useful that's something that is traditionally basically try to be as lazy as possible. But yeah, so constantly I'm thinking of things like that, but I think that having HDMI is really useful. That's something that is traditionally very and also RCA video, but just having
Starting point is 00:11:52 video output built in and so cheap has a lot of things because we've talked about before, it's very rewarding to program something and see it in video and pictures and that's why I think part of what game programming is such a thing that people get introduced to programming through. And this board being so cheap and having that video capability is very intriguing and what can you display onto a tv because everybody has tvs
Starting point is 00:12:15 and it's understandable and your friends you know if you show a little motor that spins around it's like okay or oh look i blinked this led in morse code okay like that nobody cares but if you like put something up on the TV, then, like, people are like, wow, this is awesome. Like, how did you do this? So that's really intriguing to me. Yeah, definitely. I mean, personally, the first thing I'm going to do on it is get MAME,
Starting point is 00:12:34 you know, Multiple Arcade Machine Emulator compiled on it. I have no idea why I want to do that. It already runs on my phone. So, like, can it run Doom? Everything else. It's not a proper computer until it runs Doom? Yeah, that's right. That's right. so i get a bunch of those stuff on it uh but i think long term what i'd really want to do with it is um either some kind of like social uh kind of like
Starting point is 00:12:55 communication thing so maybe a bunch of people at a party or something you could have this as like a centerpiece and talk to it from your phones or something like that that'd be cool yeah yeah there's definitely make a robot that can fit you drinks from the refrigerator or something like that so you and thousands of nerds before you have attempted such an endeavor will you be the first to completely succeed yeah it takes power i don't know if uh it doesn't have a battery per se but i'm sure people will add a module for that it also um it doesn't have any type of wi-fi like bluetooth or um you know or wireless but um it does have a usb port and already some people are mass producing like really tiny little wi-fi nubs that plug into the usb port and add a little
Starting point is 00:13:39 bit to the profile but in bluetooth ones as well similarly small that's right and i think they're looking at making a new version like a model c or something which will have wi-fi so look out for that in the future yeah it could be cool something to keep your eye on and uh the so the article that that brought this up for the news is not only is this cool but they've had issues again um we never really talked about it here but a lot of hardware manufacturers have this when you it's very difficult to actually build something, unlike software, which you just kind of release it, and it's still very hard to get rid of all the bugs.
Starting point is 00:14:10 But with hardware, not only do you have the issue with the bugs, but sourcing the parts, getting the parts installed correctly, making sure you have the right parts. Somebody could send you a batch. I was reading the other day about somebody who was trying to make a hardware kit, and they got wrong LEDs, and it happened they were counterfeit LEDs. Oh, man. And it causes all sorts of implications. So they were going through they were counterfeit leds oh and you know causes all
Starting point is 00:14:25 sorts of implications so they were going through some troubles with having wrong ethernet port parts so yeah i saw that they didn't have i guess proper shielding on the ethernet but supposedly it's been fixed now so so that's good news and i i honestly think that you know save yourself the ten dollars and buy the one that doesn't have ethernet and put a wi-fi yeah especially if you wait a little bit and see if which which wi-fi is the best supported one yeah that's right that wi-fi they're actually if you go to the faq there's a section on wi-fi and it has a list of like ones they recommend that that's a really important point um so i've done a lot of this kind of stuff before i've used gumsticks patrick's done a lot with arduino and you know a lot of this kind of stuff before I've used gum sticks Patrick's done a lot with Arduino and you know a lot of these embedded operating systems they don't support you know a wide range
Starting point is 00:15:10 of hardware so you might go to Best Buy let's say and buy USB Wi-Fi and it just won't work and it's because so much on the software level just hasn't been implemented for this OS. Well and often it's proprietary so whoever makes that particular stick D-Link or whatever won't release a Linux driver for it, or will release it in such a way that it's very hard to get that to work on other platforms or other devices. Yeah. So keep in mind that embedded devices run what's called ARM. Most of them run ARM. And long story short is ARM is just a different type of processor than what you have on your desktop. So the instructions are different. For example, like if you want to move data from one register to another, just a way to describe that action in ARM is different. And the set of instructions is different.
Starting point is 00:15:56 So because of that, even if you have some USB Wi-Fi adapter that works in Ubuntu, you know, on your desktop doesn't necessarily mean that it'll work on these embedded systems for that reason. And talk about confusing consumers. Yeah, so embedded systems require a little bit of, you know, thinking beforehand. But the nice thing, the whole goal of this Raspberry Pi is that up until now, even Arduino was close to $100, right? You can get ones that are fairly cheap, yeah. The thing is that they're not accomplishing the same kind of task, and they've been around for a lot longer. Gotcha, gotcha.
Starting point is 00:16:32 Yeah, because I know that Gumsticks, which has similar specs to this, was close to $600. So this being $35, it opens this technology up to a whole new audience. And so I think that people will be much more educated about embedded systems moving forward. Yeah, and it's definitely a useful skill. Talking about people interested in skills that transfer to the real world. I mean, there are many, many, many, many, many companies out there doing stuff with embedded computing platforms and systems. And learning how to program in a limited resource environment that the systems represent
Starting point is 00:17:06 is a very transferable skill yeah definitely so talking about making a robot yeah so um we're going to talk now about uh california being the second state to allow autonomous cars so what was the first one so the first state was nevada okay, they passed the bill a few months ago. It wasn't that long ago. Up until then, people had been sort of testing autonomous cars in very controlled environments. Then Nevada passed a law not too long ago saying that as long as somebody is in the car, you can have a machine or have a computer driving the car. But there had to be a person there to sort of supervise and take control. Yeah, so I thought a lot about this. In addition to censorship for kids, no.
Starting point is 00:17:52 So I think about autonomous cars because I really want one. Every day when I commute to work, I think, I want that autonomous car. Where is it? When is it coming? The other week we drove to L.A., which is, we both don't know, the drive from Northern California to L.A. is about, what, six hours, seven hours, something like that. So it's a long drive. And the whole time I was thinking, God, if I had an autonomous car, like all four of the seats could just face the middle,
Starting point is 00:18:16 and we could be playing Agricola or Power Grid right now. Board games. Yeah, we could totally be board gaming for seven hours. This is time that is so valuable time yeah so so i think about this i just it's going to be one of those things that i think is going to even once the technology enables it it's still not going to be here and it's just going to be one of those things it's kind of because it's going to be so hard who do you blame when an accident happens you know the officer shows up and who does he write the ticket
Starting point is 00:18:41 to you know who do the what do the insurance companies do you know how do they price that in to insure cars that are autonomous um you know all these situations or even uh the i know there was one case where an autonomous car was driving and got rear-ended well i don't think the autonomy was on at the time but even if it did like what happens if it's not even the fault of the autonomous car the first thing that's going to happen is despite how much does engineers it doesn't make sense the first time somebody rear ends a car that's autonomous and it was 100 their fault but they have a really good lawyer that lawyer is going to bring a lawsuit against the other person saying that they want all the source code for the autonomous car they want it reviewed they they think it's his fault that it applied the brakes too suddenly faster than what a human
Starting point is 00:19:22 could have or any of these things and basically in a fight to try to get overturned and then it's going to cause get caught up in a legal quagmire for the foreseeable future yeah the thing i'm worried about too is or just interested i guess more is the better word is are people going to be able to game the autonomous car so let's say half the cars on the road are autonomous and you need to get to work and you're really in a hurry like you're late for work if you turn off the autonomous mode can you like somehow game the ai that's driving the other cars if you flash your lights three times and you wibble your car it thinks you're drunk and so it gets out of the way yeah exactly you can just speed past it yeah so i think there's almost going to be an arms race between the people who have between the autonomous cars and the human drivers who want to get past them well i think early the you know like high occupancy
Starting point is 00:20:10 lanes and stuff like this will be enabled for autonomous cars because they can drive so much closer and so they'll be able to say like this is an autonomous car and they'll have special designated lanes for them or show them so that it's different because that is going to be the most difficult time if we switch completely to an infrastructure that supported autonomous cars and there were only autonomous cars on the road it would be very simple actually or when you get onto a freeway it's required that you have autonomy enabled you're not able to you're not allowed to disable it while you're on the freeway it would be very easy yeah but definitely between now and then
Starting point is 00:20:43 what do you do like you're gonna have in the beginning you know very few cars which autonomous then slowly more and more and more and through each of these phases autonomous cars have to behave differently yep yeah definitely i just i think that you know in some senses though i think that um i just wonder if people will be more or less stressed because the you know, they'll be stressed because they could go faster if they were driving it themselves. Part of the whole thing about the autonomous car is that it'll probably do close to the speed limit. I mean, I'm sure the autonomous. Well, but that speed limit in theory will go up because it doesn't even make sense anymore.
Starting point is 00:21:18 Yeah. Because the car will just know what the safest speed it can drive at based on everything. I wonder if you if you'll be able to customize it i wonder if there'll be autonomous car hackers yeah so i mean in the state of california for those of you don't know they actually have a thing so if you want to get your car basically you know registered to drive they inspect it and they look for you know modifications that aren't approved that make it emit too much pollution they test it to see how much pollution it emits all these kind of things there will be a check you know checksum on your you know autonomous software and if the checksum for your software doesn't check out they know you modified it and they're going to you know write you a ticket
Starting point is 00:21:51 yep so something like that so uh you know also i recommend you get yourself on the raspberry pi waiting list as i'm on so that you can write your autonomous car hacker when both of these things are made available and if you want to learn how to write an autonomous car, I have another news link for you. Stanford is just starting to roll out some new online courses. So last semester, quarter, I guess last year at some point, Stanford did the first of these, which was machine learning. And I think they had another one as well.
Starting point is 00:22:22 And it's by a really reputable, I'm going to mess the name Andrew Ning. Andrew Ng. Okay yeah there's like a I guess a hidden eye not a silent eye but the opposite there's a hidden eye. So it's Andrew Ng and he is a professor at Stanford and he taught this machine learning class to the internet for free and it's structured very much like a class um that you would take out of college, you know, with exams and everything. But it's all automated and tests and a schedule for you to go through and forums for you to talk on. And you get a certificate upon completion. Oh, okay. So I started in it and then I got busy and didn't end up finishing it.
Starting point is 00:22:57 And so I actually thought about having it. But this year they're rolling out a lot more of those courses. So I'm here on the list and some of them include the machine learning one again, software as a service. This is a buzzword starting to lose some of its shine, but still important. Natural language processing.
Starting point is 00:23:12 So getting computers to work with, you know, spoken and the written word. Cryptography, design and analysis of algorithms, computer vision. I mean, these are the kinds of things nerds really like. I mean, sorry, we really like. And then they have a few
Starting point is 00:23:25 more which are getting ready to come out that you know are going to be out this year probabilistic graphical models so this is how xbox's true skill works on a system some of this game theory human computer interaction computer science 101 maybe we should have all the parents who allow their kids on the internet to take computer science 101. No, okay, that's a bad idea. Information theory and anatomy. Really? Anatomy? Anatomy. I don't think it's anatomy of a computer.
Starting point is 00:23:53 I was going to say, is it like von Neumann anatomy? No, no, no. Computer security and making green buildings. Really? So they're starting to branch out, but most of these are still applicable to computer people. And so I would recommend if you are not a person who's enrolled in college or graduated with a computer science degree or not already a programmer and you want to start learning some of those things and getting involved, this is an excellent,
Starting point is 00:24:16 completely free resource for you to use. And I think, so we've had discussions about this at work about, you know, having a child and what is the university system going to be like when our children you know become college age will colleges as they stand today exist will it be completely online will it be a hybrid what will happen it's getting so expensive to go to college now yeah i don't think it's sustainable that something is going to change something will break and what's it going to be like and what does that mean for putting away money? So it's so big today, because college is so expensive for parents to put away money for their kids to go to college. And if college is going to be completely different in, you know, 18 years, what does that mean? How do you plan for that? What should you
Starting point is 00:24:57 teach your children now about learning online so that they can be prepared to be in classrooms where there's no physical teacher? Yeah, definitely. I mean, I know it took several of my courses on, I think UCF called it feeds, but I'm sure there's something similar at UF where you take the course online and there's essentially a camera set up in the classroom and things like that. But then you showed up for the exams. So that was starting to approach, you know, totally online. But now I know several courses at many universities are done completely online there's a different skill set though because there's no when you have class there's some even if you go depending on your college and what class and your major and your professor's uh niceness or not you know there's some amount of peer pressure and obligation to
Starting point is 00:25:40 show up to class and listen to them talk when they're talking and that keeps you on schedule if it's on video you can always just watch it tomorrow yeah but if you keep just i'm gonna watch it tomorrow you never watch it and then what happens when you have to show up and take the test and you know there's a level of self-motivation that you have to enforce on yourself there yeah definitely our online courses at university i remember even though they were online and the videos were available people still would go watch the recording of the video go watch the teacher be recorded doing it because that was the only way they could make sure that they would learn the material and do well on the test yeah definitely i can say with the from experience that the machine learning course is awesome i mean i took
Starting point is 00:26:17 it kind of as a refresher um with uh some of my co-workers and and it was extremely useful. And the cool thing especially about this particular course is that it covers a lot of, like, applied machine learning. So, you know, the guy doesn't go into a whole lot of theory. I mean, there's some of it, you know, what you'd expect from an academic course, but it's a lot of sort of hands-on, very specific examples. And they actually talk about how to do like image search for example is one of the things they cover in the course and so uh they do like i think they do google news so andrew ing actually works for google and so uh he brings up a lot of
Starting point is 00:26:56 examples from things that he's done in his career so if you ever wonder how some of those things work on you know behind the scenes you can can take this course and get it straight from the horse's mouth. That almost should have been our tool of the week, sort of. That's an awesome recommendation for people. Yeah, it's a killer tool. It's almost too good to be a tool of the week. One day we'll tell our kids, I remember when. Yeah, back in my day.
Starting point is 00:27:21 Back in my day, the first course came out. That'll be interesting. So speaking of tools, do you have, oh, wait, tools of the bi-week. Although it's not really been bi-week any longer. I can't really say that. It's a tool of the bi-month. Tool of the semi-halfway through the year. So what is your tool recommendation for this this recording? Yeah, so this is this is a problem that almost everybody has, you know, is a disk space.
Starting point is 00:27:50 Right. When I bought whenever I buy a computer, I always buy the lowest processor to let me buy in the lowest memory. And it's just it just doesn't seem to make sense ever to spend twice as much for a better processor when you know it's going to be out of date. But I always buy the most hard drive space I can, especially with a laptop. But even with desktops, I fill it full of hard disks, and I always invariably seem to run out of space. So that's interesting because I actually do the opposite. So I tend to be more willing to spend for a processor or RAM, things which are, in my opinion, more difficult to replace on a laptop or even on a desktop of some sort.
Starting point is 00:28:27 And then buy a smallest hard drive, knowing that I'll fill it up and replace it no matter what size I put in. And then as soon as I fill it up, I can just go buy it online much cheaper than their upgrade price. I can buy a new hard drive to plug it in and take the old hard drive and make it external. That works for desktops, right? No, it works for laptops as well.
Starting point is 00:28:43 Really? Yeah. Wait, how do you swap the hard drive on? Oh, I guess maybe, I don't think you can swap the hard drive on this, can you? Oh, on a MacBook? Oh, I don't know. You have to look online. I'm sure there's a way.
Starting point is 00:28:53 Yeah, there's probably some way. But most computers, it's fairly straightforward to swap the hard drive. Yeah, yeah. But continue, sorry. I still fill the hard drives up no matter what. Even more quickly because I buy the cheap one. Yeah, so basically these are a set of three tools, depending on which OS you use, Windows, Linux, or OS X, which will tell you in each directory what disks you're using. And more specifically what it does, it gives you these really cool visualizations.
Starting point is 00:29:23 So, for example, you could say, oh, your programming directory is like 70% of your hard drive. But then you can drill down and it'll sort everything for you. So you can say, like, what in my programming directory is so big? And then you see, oh, my programming slash art directory is huge. It has all these art assets. And then drill down there and say, oh,, you know half these art assets are for things I don't use anymore Let me put these like let me like zip these and put them on a DVD so I don't have to keep them on my
Starting point is 00:29:50 hard drive, right so um so for Windows it's called winder stat and If you take a look at that it gives you it's pretty cool when you run it it has like these little Pac-man's So it starts off with just one Pac-man, and it has like C colon, right? Or maybe it has a Pac-Man for every hard drive. But then it says, oh, C has these four directories in it. It has Windows, programming, whatever, you know, users, whatever it has. And it will create like four Pac-Mans that go and scan those directories. Next thing you know, there's like hundreds of these little Pac-Man symbols.
Starting point is 00:30:24 It's kind of cool. Recursively scanning your entire hard drive. So it does take a while to run initially, but then after that, the drilling down and exploration goes fairly quickly. Yeah, that's right. So the idea here is, you know, you kick this thing off, and this is true for all three of the programs. You kick it off, you come back like the next day or the morning, you know,
Starting point is 00:30:40 and then it gives you all these cool visualizations. Then you go through and start deleting stuff. And it's smart about, you know, if I delete a folder, it goes back and refigures out all the percents and redoes the graph without spending a lot of time there. So WinDirStat. Yeah, WinDirStat. Look on the show notes because it's a little bit complicated.
Starting point is 00:30:58 Yeah, yeah. It's all one word. It's kind of weird. But the show notes has a link. And that's Windows. Yeah, that's right. On Linux, it's Disk of weird but uh the show notes has a link so that's windows yeah that's right on linux it's a disk usage analyzer and there's no link for this because it comes built in with ubuntu but uh pretty sure if you run you know slackware or debian or any of these um you know
Starting point is 00:31:17 uh distributions that you'll have some type of disk usage analyzer variant on there. Then for OS X, I use Disk Inventory X. And so this one's a little bit different. It gives you this sort of weird quad tree kind of thing where everything's split into cells. But the visualization is not as good as Winderstat, but it does a similar thing. Awesome. Very useful. Very useful. So talking about how effective and productive I am at getting work done, my tool of this week is a game. Free game. Not open source, but free. Spelunky.
Starting point is 00:31:54 And Spelunky is interesting. And I've only played it a little bit, and Jason got so excited when he saw this that this was going to be my thing. I think he is more excited about this being a tool of the week than I am. This game is amazing. So he's actually playing this more.
Starting point is 00:32:07 So the idea is you are a... We're going to get in trouble for saying this. Indiana Jones-like character. Yeah. So a cave adventure Spelunky referencing
Starting point is 00:32:16 spelunking, the act of going down into caves, I assume. Such a clever play on words these nerds are. Yeah. Unless you're talking about urban spelunking,
Starting point is 00:32:23 which is going into places in Detroit and other urban abandoned areas. Okay. words these nerds are yeah unless you're talking about urban splunking which is going into like places in detroit and other like you know urban abandoned areas okay i didn't know about this phenomenon yeah that's pretty wild but but yeah regular splunking is what's going on here so your cave explorer explores randomly generated levels so the game randomly generates you a level and then you play through it trying to accomplish the goal of rescuing the princess i don't know the girl and some of them that's the goal the beginning ones i think so in the later ones i i maybe it can change but uh so even though there's the goal of getting through this randomly generated level you don't just play on forever they actually establish a meta game
Starting point is 00:32:59 outside of the individual level that you play and the goal there is that you can continue to accomplish things in each level, and then you can move on through this meta game. And it actually does have a conclusion, Jason informed me of, spoiler alert. Yeah, so Splunky's kind of fun. It's an evolution of NetHack and Rogue and all these games, and Diablo, in a sense,
Starting point is 00:33:20 which had randomly generated levels. But the cool thing that Splunky adds is this mechanic where you know it's really hard to go through the whole game without dying because you have one life and you only have what two or three hits i think it's two hits and then you die so imagine like mario but with one life right so it's very hard to make it all the way to like bowser's castle right in one shot so but what the game does to sort of keep you into it is it takes all the points that you've accumulated, you know, in your very short lifespan, and it puts it away. It puts it, like, in a vault.
Starting point is 00:33:56 And these points are accumulated, you know, every time you play. It's just cumulative. So eventually you get enough points where it says okay patrick you don't have to play level one anymore like we're gonna start you off at level two success yeah so it's like you have like the the the short-term game let's see how far i can get you know because if you're super amazing you could beat the game in one shot there's nothing stopping you from going right through all 16 levels but there's also this meta game of you know get as many points you can each time you play and then eventually you'll start off you know meeting the boss right away so definitely game check out free waste some time i think it's
Starting point is 00:34:34 only support on windows they're working on it looks like a game for xbox live yeah it looks like someone's made a mac port okay yeah i just googled splunky osx and uh there is a Mac port. I just googled Splunky OSX and there is a Mac port. I don't know if it works or not. Your mileage may vary. Disclaimer here. We have no idea. Maybe we could go to the standby of Run It in Wine on Linux.
Starting point is 00:34:58 Hopefully that'll work for you. Wine's gotten really, really much better. Definitely check out SpelunkyWorld.com, and that'll be in the show notes as well. Yep. So I think the time has come, Jason. We are at the discussion of the programming language of the week, Dart.
Starting point is 00:35:15 Yes, Dart. If you Google Dart, you will not find the programming language. Oh, no. You'll actually have to Google Dartlang to get even the programming language. It just gives you an idea of how new it is and also how hard it is to get Google cred for the word Dart and steal it away. People wouldn't think of this before they named their languages. Yeah, yeah.
Starting point is 00:35:37 Like the last Google language was Go, and you'd think they would have learned. Yeah. After Go, you'd think they would have learned, let's pick something that's not a common word. But they picked Dart. So I guess you left that kind of the bag. It's a Google language? That's right.
Starting point is 00:35:51 That's right. So it's being worked at by Google engineers. And it has a sort of interesting genesis. So Dart is a, let's talk a little bit about darts a client uh browser based um it's meant to be run in a browser right okay similar to javascript so uh basically dart tries to kind of get around a lot of the drawbacks a lot of the weaknesses of javascript from an enterprise or a big iron javascript has weakness i know shocking i think we covered we did cover javascript so yes so listen to that episode yeah
Starting point is 00:36:32 definitely go back and check that out and hopefully we'll be consistent but we're not we're not we're not checking ourselves so it's been a while it has been a while people have been born since we uh did the last show families have increased in size. It's like Agricola. This is like the next turn. I actually made that joke. My wife didn't find it funny. Oh, really? Yes, you have taken the family growth action. Nice.
Starting point is 00:36:59 But yeah, so one of the biggest things about JavaScript is that you can get errors at runtime. It's not statically typed. And it doesn't have a lot of the things that many other languages like Java and C++, languages which have been used in huge applications, it doesn't have a lot of those features, which make it easy for collaborative development and things like that. So Google actually made a product called Google Web Toolkit or GWT for short. And Google Web Toolkit, the idea was you would write code in Java and then this Google Web Toolkit would turn all of your Java code into
Starting point is 00:37:38 JavaScript. And this worked out pretty well but it it has some major issues, and we won't really get into that too much detail. But basically, it doesn't really serve the full use case, and it doesn't have a lot of traction. So Dart is an attempt to sort of create a brand new language that can give you kind of like the flexibility and the rapid prototyping that you need to make things quick and make web apps quick. Web developers are all about keeping up to date with the latest UI, making something sleek, making it look really nice, making it interact with the HTML and make it very interactive. And so they don't want to be constrained with all the statically typing. But then on the other hand, you want to write huge programs that run in the browser.
Starting point is 00:38:27 And so Dart is a way to sort of balance both of these. This is an interesting point that when you make a language, everybody thinks they have the right way to make a language, but it's very, very difficult to do everything well. And so oftentimes you make sacrifices by saying, this is what we're going to do well. And if you don't like that then find another tool write your own yeah and so i guess this is google stepping up to play and saying
Starting point is 00:38:49 there were some things they didn't like about javascript and so they're going to write their own yep yeah and so google web toolkit was um just too much of a departure from the things that made javascript great and uh so dart is attempt to sort of bring those closer together. So as we mentioned, it runs in the browser. Right now, there's only a – so let's talk a little bit about virtual machines, right? Okay. Yeah, we covered that before. But yeah, let's do a refresher. Yeah, yeah. So JavaScript runs on the V8 virtual machine, which runs inside of a browser. I thought that runs in a car.
Starting point is 00:39:22 Oh, sorry, different V8. Oh, I see. I knew that. It runs in an autonomous car. Ooh. So Dart can also run in the browser using its own virtual machine called Dartium, I think, or Dart VM, something like
Starting point is 00:39:36 that. But now, you know, right now Dart VM only exists in Chrome. Hasn't been ported over. Which is made by Google. Right. Surprise! Yeah. Dee-dee-dee-ding.
Starting point is 00:39:47 So it's not, you know, there's no Dart VM for Firefox or Internet Explorer or any of those. So you might think, oh, if I write my code in Dart, no one else who uses, you know, no one outside of Chrome can use it. That's not true. They wrote a compiler called Frog. And so what Frog does is it takes your dart code and turns
Starting point is 00:40:06 it into javascript so you could think of frog is to dart what the google web toolkit is to java so it's sort of a way to translate your code into javascript okay but at the same time if you don't want to use frog or you uh or if you're using dart you can actually detect the person's browser and say oh this guy's running chrome we can give him native dart code or this person's running internet explorer we'll use frog and give them javascript so so javascript we talked about this before has the name java in it but the similarities to java are so what about dart how is it similar to java then yeah yeah so dart and java are extremely similar so they're both uh class-based they both have classes interfaces this whole thing they have inheritance and i i believe we covered java right yeah yeah
Starting point is 00:40:58 we definitely covered java in a previous episode so uh definitely go back to that one but almost everything in Java as far as like the architecture the language and the semantics you'll also find in Dart. One nice thing about Dart is that it also sort of gives you some of the features of JavaScript if you want. So for example in Dart you can say int x equals three and now x has that 3 in it. If you later say x equals Patrick, it'll say an error. It'll say x is an int, and you tried to set it to Patrick, that's not going to fly. And so these are the kind of things that you want as a developer. You want it to give you an error up front.
Starting point is 00:41:39 You don't want to have to deploy this code, and then your customers run it, and then at runtime, they get some weird error because you tried to add Patrick and 10. You know, and at runtime, everything blows up after you've deployed it. Right. So Dart has that advantage of you can specify the type. You can say, look, this is a number and it'll always be a number. And if it's ever, you know, if ever something comes in that's a string and i set the number to a string just tell me right away that something don't let it bad it's happening yeah
Starting point is 00:42:09 don't let this compile so um but it also you can use var so if you say var x equals three then you're telling dart i want x to be anything so so you can turn it off you can turn off the static typing yep and so this lets you be very flexible. So if you really want to hack something up quickly and you want to get out the door, or if you want to be flexible, maybe there really is a variable that could be anything and you want to be able to support that. Maybe some kind of user generated content or something like that. So Dart will handle that as well. Very nice. Interesting. Okay. So another cool feature of Dart that JavaScript does not have is multi-threading. And Dart actually has two kinds
Starting point is 00:42:51 of multi-threading. Because one wasn't enough. Yeah, that's right. If you'll notice, the big thing about Dart, and maybe we'll talk about this later in the strengths, is that Dart seems to try to do everything. It has statically typed, but it can do dynamically typed and it has many different types of multi-threading and it has actually dart has all of the java containers in it which is something that's really useful so yeah in the case of javascript right everything is a map so everything is if you want to say like you know day equals three or if you want to do you know day equals monday if you want to have some kind of enum everything has to be structured in a map but in the case of dart you can have lists you can have sets you could have maps all the things that you're used to in java um someone's gone in and
Starting point is 00:43:36 written and those things in dart so it really comes batteries included as we talked about earlier so we like that phrase yeah yeah it's probably my favorite phrase of the show. Oh, just of the show. Okay. Yeah, or real life, yeah. Oh, you use that all the time. Yeah, pretty much. Nice.
Starting point is 00:43:51 Yeah, family growth option, batteries included. That's pretty much, that's my whole vocabulary. Oh, wow. Okay. I think we're just going to move on. So you were talking about multi-threading. Yeah, yeah. So Dart has coroutines, and it also has full multi-threading. Yeah, yeah. So Dart has coroutines and it also has full multi-threading.
Starting point is 00:44:07 So have we talked about this before? We might have at some level, but we can go over it again. Maybe, how about I'll go over coroutines and you go over like multi-processing. Okay. All right. So coroutines are having multiple threads in a single process. So you might say to yourself, like, why would I want to do this, right? And the answer is, let's say you're waiting for someone to type a key on the keyboard,
Starting point is 00:44:30 but at the same time, you were, you know, constantly updating your GUI. Maybe there's some like graphic animation going on in the background, but at the same time, you want someone to be able to type in or you want someone to click a button to stop the animation. So you need to be able to do both of these things at the same time. You don't want to have just one loop that says, you know, run a little bit of the animation and then check to see if Patrick pressed the key. And then run a little bit and go back and forth because this makes the code really confusing. What you really want is to have two different things running at the same time. One that's waiting for an input and the other that's running the animation. So you could do
Starting point is 00:45:11 this in multi-processing where you have, you know, two different threads on your operating system that are both doing different things. But this causes a lot of overhead. Anytime you create another process, you have to go to the operating system and say, hey operating system I need another space to run some code and it has to go and fetch that for you and that's a little time-consuming. Also as we mentioned Dart can be compiled to JavaScript and JavaScript doesn't support multiprocessing. So, you know, there's no way to do that in JavaScript. So Dart has this idea of what's called what Dart calls a light isolate. And this allows you to do coroutines where you have many different threads, but they're all
Starting point is 00:45:57 sharing a slice of the same process. So the process, basically, the process will do sort of what I was describing earlier, where it'll play a little bit of animation and then listen for a keystroke. But from a code perspective, you're writing code as if you have two things going at the same time. And the multi-threaded is simulated. So this is different than multi-processing, which... Yeah, so multi-processing, you know, Jason talked about threads sharing a process. And the process is kind of what the operating system deals in. And the operating system schedules processes for the processors to run. And there's overhead there such as, like, things that include, like, the stack.
Starting point is 00:46:36 And when you make a thread inside a process, you kind of have to emulate that or eliminate it. And there's all sorts of ways of handling that based on you know what you're trying to accomplish but multi-processing in theory allows you if you have a whole process and you have multiple processors the operating system can schedule one process to run on one and one process to run on the other and give yourself true multiple things running at the same time versus the cpu just slicing very finely alternating between two different threads so as a programmer if the things you're doing aren't particularly intensive, like, you know, draw some animation, you know, check the keyboard, draw some animation, check the keyboard.
Starting point is 00:47:11 If neither of those turn out to be, you know, intensive, or in this case, checking the keyboard, most of the time you're just doing nothing, then you can share one process on one processor and it's not a big deal. But if you want to, you know, render the graphics and also compute a path for some entity, if you're doing like, you know, game programming and you want to you know render the graphics and also compute a path for some entity if you're doing like you know game programming and you want to have ai those two things are very meaty uh intensive things and if you put them in a two threads inside of a single process makes it harder for the operating system to know what to do if you put them in two separate processes the operating system can say oh i'll put one on one processor and one on the other and then they
Starting point is 00:47:43 can run at the same time and in theory make your stuff go twice as fast. There's lots of issues with that simplification, but that's what it means at a low level. But sometimes you don't need that. And there's overhead that's incurred from the processor standpoint, switching the process, having all this extra information that the operating system stores about it, and moving those in and out of the processor, depending on what's running, is something that you want to avoid if you don't need it. But sometimes you need it, and it's worth it
Starting point is 00:48:12 if it means you can get scheduled on two different processors at the same time. Yeah, totally. So the only other thing I guess I can mention on that is that the heavy isolates, you don't share any data, which, as Patrick mentioned, because they're on two different they're two different processes so the so you have to basically pass messages from one isolate or from the main thread to the isolates versus the light isolates they can actually share data because they know that there have to be on the same process yeah exactly so and then oh
Starting point is 00:48:45 man we could do a whole whole episode about even that's not language focused but about the differences and all the different ways that cpus handle multi-threading and multi-processing and different languages and that's something that today is becoming more uh applicable than ever before because it's processors stop getting faster and start getting more cores this is something that we have to start worrying about how do we schedule efficiently 32 cores to do something on the on the computer and it's not always straightforward most of the time is yeah definitely we should do if we do go as a language we should do like a whole thing yeah yeah definitely so so what are the what are the strengths that dart we said it tries to do a lot of things so so what are those strengths that really shines in yeah so i think one of the um
Starting point is 00:49:30 you know biggest strengths of dart is that it gives it gives you the sort of um what's a good way of describing it it gives you the sort of structure that you're used to as a like that people have been developing with for years you know it's it's it's not very often that you see you know a 200,000 line JavaScript program and many JavaScript developers will say that's a good thing it's because we can get it done in 20 lines or something but the reality is you know if you have 30 people working on a project you really want things to be encapsulated maybe that's the best word I'm really looking for. So you want to be able to say, look this is my
Starting point is 00:50:10 graphics handler class for my part of this game and the way you interact with me is you can say like add sprite, remove sprite. So I'm going to give you an interface with some functions and you can code to this interface and then but internally you know I'm going to be doing all the handling of the drawing the pixels and things like that I'm just going to expose sort of an API that's sort of that's the way a lot of these big languages work like C++ you have the header file and you can give somebody the header file without the source file and they should be able to interact with your code even though they don't know what's happening under the hood. In the case of Java, you know, they typically use Java docs, right? So you can see a Java doc with
Starting point is 00:50:50 the API and you can code to this API, even if you don't know what the code is doing, because it's very structured. You know, in the case of JavaScript, this doesn't really exist, right? It's JavaScript, everything is an object. And it's very hard. You can define an API, but you're doing a lot of the heavy lifting yourself. Dart sort of takes a step back and says, let's give us more of a Java or C++ feel to browser-based, to client-side browser computing. And that's something that especially if you go to working with large teams of people, it's something that is really beneficial. It also seems nice that it has the option for the static typing or the dynamic typing. So if you really want dynamic typing and you're in Dart, great,
Starting point is 00:51:34 use it. But if you have that static typing to enable those compile time checks and make sure you didn't just try to put a string in an integer or vice versa, or try to add three to a string, which doesn't make a lot of sense or is ambiguous, that it's really nice to be able to have that because it enables, again, if Jason wrote one piece of line of code and I wrote another, and I thought he was using a string,
Starting point is 00:51:54 in reality, he was using an integer, then, you know, it could be a problem. And so it's nice to be able to kind of have those enforcements and checks there if you want them. Yeah, I mean, just to put an example, I mean, let's say, you know know I was writing this graphics engine and Patrick was using it as part of his game. You know in the case of JavaScript I just create a set of functions but I don't really say oh you have to pass in two
Starting point is 00:52:16 integers and a string or something like that. And in fact in JavaScript I believe you can pass the wrong number of arguments and it'll just put in none for the other ones So if I go in and change my API Patrick might not know He definitely won't know at compile time because there's no compiler JavaScript's completely interpreted, right? But even at runtime it could be just really like the code can just do really strange things that you're not sure of if someone You know changes an implementation of something but with dart it sort of allows you to you know
Starting point is 00:52:48 to to create these modules and so it allows two people to sort of work together in parallel without having to constantly stay in sync so we already talked about a little but some of the weaknesses is that the frog compiler isn't an efficient generator of javascript code doesn't you could do better by hand you know right now javascript now tends to be with any transition tends to be the first thing that happens is people go i could write this better myself and it's like well yeah but that's not the point yeah i think at some point someone was telling me i think when i was in like middle school or something like oh we could do this so much better in assembly you know
Starting point is 00:53:23 i mean it's always true but at the end it comes down to are you going to pay the price in your you know how much time you have to invest or in how fast it's going to run so we always try to give some uses of dart and i think that's especially difficult because it's pretty early on i mean darts darts relatively new what a year less than a year now yeah i don't even know and so um oh we failed to do a little bit of research that's okay and so it's still pretty experimental and you know nobody kind of really knows what google's intentions are per se with dart and where they're trying to go with it and so um people are playing around and then we'll see you know what kind of happens but you know maybe we do this this is a little bit earlier in the life cycle of a language than we've done before
Starting point is 00:54:02 but it's something interesting but uh jason you did find one kind of cool use, one app that was using Dart. Yeah, it looks like some guys got together and made this thing called Dartendo. Dartendo. Yeah, which we'll give a link on the show notes. But it's dartendo.appspot.com. And it looks like it's a complete Nintendo emulator written in Dart. Wait, so a Nintendo emulator in my browser? Yeah, it's a complete Nintendo emulator written in Dart. Wait, so a Nintendo emulator in my browser?
Starting point is 00:54:32 Yeah, it's kind of wild, and these guys made a drill TV graphic around it to make it look like it's, make it feel more homely. Retro. Yeah. But yeah, it completely runs the NES, and it looks like you can load drag-and-drop ROMs into it and stuff like that. Oh, so you have to upload your own that you've legally obtained by soldering memory readers onto your Nintendo cartridges. That's right. And getting the code from.
Starting point is 00:54:53 Yes, I have many such cartridges that I've done this to. Yeah, so for everybody out there who has desoldered their Nintendo cartridges that they purchased with their hard-earned money and put the ROMs on their on their computer they could do that otherwise it runs a little Nintendo test suite which that by itself is kind of interesting you can see how the Nintendo self test so this is a guy audio video control yeah yeah it seems to have the whole shebang interesting all right well people can check that out yeah it Yeah, it's actually open source, and it looks like it's a pretty hefty amount of Dart code. Okay. So it's always good to be able to look at an application written in a language and kind of get a feel for how people do things
Starting point is 00:55:36 or what's being done. So that's definitely useful. Yeah, yeah, for sure. For sure. All right, man. Well, you got anything else? It's been a long time, but it feels good to be back in the, not in the driver's seat, in the podcasting seat. Yeah, it does. Yeah, it feels good to be doing this again. We appreciate all the comments. You know, a lot of people were kind of saying, hey, you know, when's the next episode? We were missed. It's nice to be missed. doing this we're definitely going to keep it going now that uh christmas season has ended and we're both back in uh uh back in our hometown or not in our hometown but uh back to our place of residence yeah our landing pad i don't know what the right word is but now that we're not traveling all over the place so uh it's kind of nice to uh to to be back doing this awesome well until next time
Starting point is 00:56:21 yeah have fun hacking with your Raspberry Pi or Arduino or whatever. If you can manage to buy one. Yeah, yeah, if you can get on the waiting list quick enough. So, all right, see you next time. See you later. The intro music is Axo by Binar Pilot. Programming Throwdown is distributed under a Creative Commons Attribution Sharealike 2.0 license. You're free to share copy distribute transmit the work to
Starting point is 00:56:45 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.