Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #209: JITing Python with .NET, no irons in sight

Return to episode page view on github
Recorded on Thursday, Nov 19, 2020.

00:00 Hello and welcome to Python Bytes where we deliver Python news and headlines directly to your earbuds.

00:05 This is episode 209 recorded on November 18th, 2020.

00:09 I'm Michael Kennedy.

00:10 And I'm Brian Okken.

00:11 And this episode is brought to you by us and all the things we're offering to the Python community.

00:16 But I kind of want to take a step back in my whole career and start back where I spent a little bit of time in .NET.

00:24 Isn't that a weird thing for me to do on a Python podcast?

00:26 Yeah, but you're kind of a .NET kind of guy in your past.

00:30 I like C# alright.

00:31 Like if I wasn't doing Python, that's probably what I would be doing.

00:34 But look...

00:35 Well, thank God for Python.

00:37 Yes, I know.

00:38 Well, also, I just want to point out, this is not my fault.

00:41 This is Anthony Shaw's fault.

00:43 Okay.

00:44 Yeah.

00:44 So, Anthony Shaw wrote an article showing you how to use one of the more exciting inventions, evolutions, something like that with regard to Python and how it's actually executed.

00:58 And it has to do with .NET.

00:59 So he wrote an article called "Running Python on .NET 5".

01:03 So there's a couple of layers we got to unpack here to to finally put this together for everyone.

01:09 So way back on episode 49, like when I was living in Germany type way back, I talked about this thing called PYGION, P-Y-G-I-O-N, with Brett Cannon.

01:20 So what this was is a way to like shim into CPython something that would intercept when a frame, a function frame was being executed and you know hand over the Python bytecode when you run Python it gets compiled to those pyc files into bytecode but then unlike say .NET and Java which JIT compiles that to machine instruction, they just jams that through the big C eval.c loop, like the 3000 line switch statement that is Python's runtime, right?

01:55 So it gets mixed into that workflow and it can actually take that.

02:01 And there was talk about maybe compiling to the JavaScript Chromium engine, potentially, or to .NET, right?

02:09 Those are like, it could be, so the idea was you could plug in some alternative JIT compiler to be given segments of Python and said run this block of Python.

02:18 Cool, right? - Okay.

02:19 - So, you know, obviously compiled code has at least the potential to be a lot faster if it really understands what it's compiling than interpreted code.

02:28 Okay, so that's thing one.

02:31 Thing two is .NET traditionally used to be this thing that ran on Windows and it only ran on Windows.

02:37 And that was a problem for a lot of people.

02:39 So Microsoft came up with this thing called .NET Core, which was the open source version, a multi-platform open source version of .NET.

02:47 And just recently they said, it's really silly to have these two things, so let's just come up with a thing called .NET 5, that is the new cross-platform open source replacement that puts those things together, okay?

02:59 And I'm leaking to like some of the announcements, they just did a conference over there, people can check it out if they wanna go deep.

03:04 Number three, things that run in .NET often are faster than Python, like you can debate that, but like especially the numerical types of bits, because they work with integers and floats, not Py object long pointers and so on.

03:18 And so I just ran across a Stack Overflow post where someone was complaining that their Python implementation of something was 31 times slower than C#.

03:26 Like that's outside the margin of error probably.

03:30 It's not good.

03:31 I mean, we can debate about whether or not Python is fast or slow, and I think that's a really interesting conversation because developing it is faster.

03:39 If you bring in things like NumPy, all of a sudden you're down to C++, which is probably flat out faster.

03:43 And there's just all these variations, right?

03:45 So not to put too much of a point on it, but it is a place where code runs pretty quickly.

03:50 So if you could get some Python code to run on that place as well, that would be pretty sweet.

03:55 So what people have traditionally done to make their code faster, as many people know, is compile it, like write it in C and compile it as a C extension.

04:02 You know, things like NumPy might do that.

04:05 Or use something like Cython, which basically takes sort of write in C, you write it in Python, but then it just compiles it to C, which then is compiled to machine instructions.

04:14 So there's like this sort of escape hatch, right?

04:16 So .NET has this JIT compiler that comes with it.

04:20 Pigeon is this project that allows you to plug a JIT compiler into the Python execution.

04:25 So the people over at Microsoft, Brett Cannon and Dino Veland, hopefully I got that right, the people involved, have been actually working on this for the last four years, and they're now, you can now use this Pigeon project in Python 3.9.

04:41 And the reason is back in 3.7, there was a pep called pep 523, which was basically an API for swapping out frame execution with a replacement implementation.

04:51 And that's where you might take out interpreter and inject JIT compiler.

04:57 So basically they've just, you know, now that 3.7 came out with that, they've been building on that and he's got some really cool examples.

05:03 Like all you go over there is you pip install pigeon, you know, import pigeon, Pigeon.enable or like something like that to say start and that's it.

05:12 There's no other changes to your code and now it's running JIT compiled on .NET 5 cross-platform.

05:19 That's pretty cool.

05:20 It's got some real interesting possibilities there, right?

05:23 Yes.

05:23 And it uses the...

05:24 So there's been other things where you could like plug in Python into alternate run times and VMs like Jython and IronPython and so on.

05:32 This is not that.

05:33 This literally uses the same standard library.

05:37 your C extensions are supposed to still work.

05:39 Right? So what they did is they actually said, they actually went and they tested the entire CPython test suite on all platforms with this. And this is actually the first JIT implementation to ever pass the test suite.

05:52 - That's pretty cool. - Yeah, right?

05:54 So we've got things like PyPy, but it's like 94% or whatever, like some, you know, mostly Python, but it's not all Python, right?

06:02 So this is really cool that they've got this high-performance runtime cross-platform JIT compiler that they just seem to have successfully plugged into Python.

06:12 Yeah, so it's a running which version of Python?

06:16 3.9.

06:17 Oh, okay. That's awesome.

06:18 Yeah, so it doesn't like like a lot of these other things said, well, let's replace the Python runtime with X and then it'll be mostly the same.

06:25 And so what this does instead is it plugs in just at that pep523 frame execution layer and says you want to run this part of a function.

06:35 How do you do that? It's just that little bit that changes. So other than that, it's the same old Python three nine that you know, and love that I'm far as I can tell. Yeah, so that's pretty awesome. Yeah, I'm pretty awesome. And then a little like some extra news on this.

06:49 Unless you already mentioned it. This happened a couple days ago. Pigeon is unfortunately frozen in the Microsoft repo. But the Anthony's fork is now the official fork. What?

07:03 He's doing so much interesting low-level stuff, Anthony is.

07:07 He's got his like CPython source code book and yeah, so yeah, that's cool you're linking over to it.

07:13 So all this stuff is very exciting and it has the possibility for code to run much faster. So for example, given something that it can tell is here's a a pi long object pointer thing, could we convert that, and it's small, could we convert that to just a you know, four by integer and do integer math instead of like complex math, right? Like that would make a tremendous difference in speed.

07:36 That said, what they've done here so far is just let's make it run and not break.

07:42 And now they're going to start working on the optimization.

07:46 So this JIT compiler hasn't done any optimizations yet.

07:49 But they're going to start teaching Pidgin how to understand the Python code, say, could we restructure that to get the same outcome but in a much more native to the machine way.

07:59 So is it faster? A little bit, not a ton yet, but it opens the door for huge improvements by working specifically on the JIT compiler, understanding how to take code that it gets and turn it into something.

08:12 Yeah, and this sort of cross work and stuff is interesting, just interesting about working with languages, working with whether or not you're going to do interpreted versus JIT compiled, things like that. It's a very interesting story.

08:24 Yeah.

08:25 Yeah, and that Stack Overflow thing I linked to, They also talk about PyPy, P-Y-P-Y, and how it also made the example there go quite a bit faster.

08:32 So anyway, JITs seem to be an interesting option here.

08:36 So from PEP 523 to 621, let's keep rolling on the PEP, man.

08:41 >> The PEP 621 is, I guess, a standard, trying to standardize some of the metadata in pyproject.toml.

08:49 So we've talked about packaging and pyproject.toml a lot, I think.

08:54 the different projects like black and flip and others have been using.

09:00 Is loophole in the the original spec that said yeah you can put extra stuff in there but we don't recommend it to everybody's putting extra stuff in it but.

09:10 Are we forbidden no.

09:12 No yeah so they took out the recommendation to not do that but there's motivation to sort of standardize on the things that are building packages and building wheels it'd be really great if like we could kind of standardize on what is in there and what names the big players are set up tools and poetry and flit of course but there's others around that do this and this pep actually includes the authors of all of those in trying to get some of this together. Some of the motivation is to try to have some of the metadata statically defined so that other tools can read it quickly and we can build an ecosystem around just a standard set of things.

09:56 That makes a lot of sense. If you're going to put it there anyway, make it at least interchangeable and useful.

10:00 Yeah, and just kind of define what it means to have these things in there. And one of the nice I looked for because I kind of bugged me about the old packaging was whether or not email was required and it's nice to see that both name and I mean usually you should put like an author maintainer name and email is encouraged but I don't want to put my email in there and it's optional so that's cool.

10:26 Yeah exactly because then it gets published to PyPI and man anytime you put your email on the internet you just get the communication.

10:33 This is still in draft form officially, I think, but it's a, I think it'll go forward.

10:39 I mean, it doesn't change any of the existing core metadata and it doesn't attempt to standardize all things that you could put in there, but some of the common things like name, version, description, where the readme is, which Python version is required, what license you have, these are all sort of standard things that used to be other places, but having them in the pyproject.toml would be great.

11:02 Yeah.

11:03 It seems like they belong together in there.

11:05 So like, you know, what is the name of the project?

11:08 What version of Python does it require?

11:10 And so on that's, that's reasonable.

11:12 Yeah.

11:12 I would actually surprise them.

11:14 Like what we haven't already standardized this stuff.

11:16 Exactly.

11:16 You know, what else is reasonable is a learning pie test.

11:20 Yeah.

11:20 That's a pretty reasonable thing.

11:21 And often people do it with a book.

11:23 They do.

11:24 And I'm still getting some really great quotes from people, which would been, would have been good for me to be ready with that, but people contact me.

11:32 I get a message probably every other day saying, "Man, the Python testing with pytest book that you wrote has helped me so much to get up to speed really quickly." And I really love feedback like that.

11:43 So if it's helped you, please let me know.

11:45 It'd be great.

11:46 - Yeah, I'm about to release a FastAPI course.

11:49 It may actually be out by the time people hear this 'cause there's this time travel thing that we do with podcasting.

11:53 Not that much, but a little bit.

11:55 So people should definitely check that out over at Talk Python Training.

11:59 And I've already started writing the next course, so that'll be fun.

12:02 - Big secret there.

12:03 - You're cranking them out.

12:04 I'm really liking this stuff and I'm really looking forward to the FastAPI course.

12:07 - Yeah, thanks.

12:08 It's all done, recorded.

12:10 It just needs the final editing sent on the videos and it's gonna be really fun.

12:14 I think people will love that framework.

12:15 I had a lot of fun exploring it.

12:17 You know what's not a lot of fun?

12:18 When you get a DMCA complaint from the Record Industry Association of America to take down your GitHub project.

12:26 - What?

12:27 That happens?

12:28 - Apparently.

12:30 It happened to me all the time on a really funny story.

12:34 I did a webcast like years ago when I first moved to Oregon and there were some people who had dialed in and it was so frustrating.

12:43 Like there's all these, like hundreds of people, somebody put the call on hold 'cause they had someone come in their office.

12:50 It started playing like the hold music to the whole Oregon, everyone, like all hundred people were hearing this hold music and we're like, how do we get rid of this one person without getting rid of the rest, it was really bad.

13:02 But the reason I bring this up now is it was like a song, an actual copyrighted song.

13:08 When I published the webcast to YouTube, it got taken down because the old music that was interrupting the webcast got a DMCA complaint.

13:18 So anyway, these things are super frustrating.

13:20 You're like, why?

13:20 This makes no sense.

13:21 Anyway, so here's the story.

13:24 GitHub had taken down YouTube-DL.

13:28 YouTube-DL, I believe it's a Python project, that basically gives you a CLI for downloading content off of YouTube.

13:37 So if you're like, "Oh, that video's really awesome, "I wish I had it offline," YouTube-DL space URL-format or whatever, you just run that and it downloads it.

13:48 However, because the record industry puts a lot of songs and music videos and stuff up on YouTube, they said this theoretically could be used to download a song, therefore we hate it, and so we asked GitHub to take it down.

14:04 And GitHub did.

14:05 - Interesting.

14:06 - Yeah, but here's the news.

14:07 They revamped their copyright takedown policy, put a bunch of other policies in place, set up a legal defense fund, and restored YouTube download.

14:16 And gave the middle finger to RIAA, basically.

14:20 - Yeah, because this tool, I mean, maybe this tool helps you do something you shouldn't but it's not itself.

14:25 - Yeah, yeah, so also, you know, big shout out to the EFF, Electronic Frontier Foundation, in that they helped critique and go through the actual legal bits of this and show GitHub, like, you know what, actually, their main complaint is actually not even what's happening.

14:43 So the RIA argued that the tool ran afoul of section 1201 of US copyright law by giving people the means to circumvent YouTube's DRM, digital right management.

14:57 So that's the important part, right?

14:59 Like it's breaking this encryption prevention of copying that YouTube has.

15:04 But then the EFF looked at the claims and said, you know, what it actually does is it just grabs the video stream and saves it to a file.

15:12 It doesn't decrypt it or re-encode it or anything.

15:15 So for things like Netflix or Widevine or things like that that use DRM, this actually has no effect on it.

15:22 Only if the video is in an unprotected, like MP4 format will it even work.

15:28 So their main complaint that, oh, it breaks this DRM, it doesn't break DRM.

15:35 So they said, we're putting it back.

15:36 - Okay. - Yeah.

15:37 And as part of this, there's like a pretty big uproar, I believe.

15:40 So GitHub is implementing new policies to avoid the repeat of such a situation moving forward.

15:46 First, says the team of technical and legal experts will manually evaluate every single section 1201 claim.

15:55 That's cool.

15:56 And instead of just going, whoop, it goes down, they said, if the company's team, technical legal teams, ultimately find issues with the project, GitHub will give its owners a chance to address those problems before taking down their work.

16:08 - That's nice.

16:09 - Yeah, that's cool.

16:09 And GitHub is establishing a $1 million legal defense fund for developers if somebody sues them about their GitHub project.

16:17 - That's actually awesome.

16:18 Yeah, this is a feel-good story, right? I think.

16:20 Well, yeah, because the individual developers sometimes are just like, you know, a handful of people or even just one person making some cool tool that they think is neat.

16:28 You're giving this stuff away, you know?

16:30 You can't get a lawyer or whatever to defend yourself.

16:33 And a lot of times it's published to GitHub under your personal name, right?

16:38 So like, Talk Python has an organization and we pay GitHub like 50, 60 bucks a month to have our organization maintain repos on there.

16:48 Right?

16:48 But a lot of people, it's just, you know, github.com/brianocken or /mikeckennedy or whatever.

16:56 There's no like legal guards there, right?

16:59 So it's really cool that they're doing this.

17:00 Yeah.

17:01 I like it.

17:02 And as I was researching this, into my inbox dropped a newsletter from the EFF.

17:08 Apparently, I'm a subscriber to their newsletter.

17:10 And they said they just launched a podcast miniseries called "How to Fix the Internet" that examines potential solutions to six ills facing the modern digital landscape. And this sounds like one of them. So people are like really interested in this, they can actually listen to the EFF series there. Yeah, nice. Anyway, that's a wild story, right? It is very wild. Yeah.

17:29 All right, what you got next here? Another one of my favorite topics?

17:31 Yeah, so you like MongoDB, right? I do, I love it.

17:35 So I was curious, I was actually thinking the other day, how small of a machine could I put MongoDB on? And then Mark Smith comes out with a article that says that's how to install and configure MongoDB on a Raspberry Pi.

17:48 Wow, that's awesome.

17:48 Which is totally cool. So it's a fairly comprehensive little guide, but I didn't know you could put Ubuntu server on a Raspberry Pi either.

17:56 So that's how he does it. He installs Ubuntu server, 64-bit on a Raspberry Pi, configures the Wi-Fi, installs MongoDB.

18:05 And but there's like a kind of a quirk on how you're supposed to install MongoDB on it.

18:11 and then set up an account so that you can safely have a MongoDB server running in your house.

18:18 He recommends this is like a local network thing, not even a company-wide thing.

18:23 Just if you're using it yourself, go for it.

18:26 If you already have a Raspberry Pi and that's like your thing that is running, that is your sort of file server or whatever reason that you have it running for, and you want a database, it's cool that you can set this up here, right?

18:39 I mean, you probably wouldn't host like a professional website on it, but who knows, maybe you would.

18:44 I've got stories.

18:45 One of the things I love about MongoDB is just the ease of setting up storage areas for it and stuff.

18:51 And you can just, it's easy.

18:53 You just talk to it like you expect it to be and it just becomes that way, right?

18:56 You don't have to run migration scripts and all that.

18:58 Yeah, so this would be, I mean, things like a home network to collect, like, I don't know, temperature data from different places and some of that stuff.

19:07 or whatever, things like that might be kind of a neat use for that.

19:11 Definitely, if you've got like an IoT thing, smart home thing going on and you want to store it somewhere.

19:16 Yeah, very cool. I love it. Nice. Good find there.

19:19 So this next one is like this new little section I've just invented just for this one time.

19:24 Called "Extra, Extra, Extra, Hear All About It." So normally we have our extras at the end, but I had so many extras this time, I'm like, this show's going to be super long if we just keep going.

19:32 So this is like all the other little tiny things grouped into one.

19:35 So four, at least four more little things, but all combined.

19:38 Okay.

19:38 Okay.

19:39 Let's start with some listener feedback.

19:41 So remember, I went on a rant, I'm known to do that sometimes, about the Stack Overflow Survey and how they were comparing things that were like, simply not comparable.

19:50 Yes.

19:51 And one of the things I picked on was SQL.

19:54 And I said, it doesn't make any sense to have SQL compared to the, popularity of SQL compared to the popularity of Python or the popularity of C#.

20:01 because people who do C#, they gotta use SQL.

20:05 People who do Python, they gotta use SQL, but not the other way around, right?

20:09 It's like, I don't know, it just didn't seem like they were right.

20:12 The numbers for SQL were inflated because all the other people were also happening to use SQL.

20:17 But if you ask them, like, "What kind of developer are you?" They wouldn't say, "I'm a SQL developer." They would say, "I'm a Python developer," or "I'm a Java developer," or .NET, or whatever is not SQL, right?

20:27 So John Nickerson said, "Hey, I feel like you're saying that people just use SQL "or not real developers." I just want to point out that, no, no, no, that's not at all how I felt about it.

20:36 I think if your job mainly is to use SQL, then you should check that box.

20:39 You should say SQL.

20:40 I'm just criticizing that we've got these two things side by side in these surveys where one of them is standalone and then one of them also adds to the other, but they're put together as if they're separate and being compared, and that just didn't feel right to me.

20:59 Yeah, I mean, yeah, there's definitely people that specialize in SQL queries.

21:04 That's a cool thing, and there are people that do that as professionally, and I think that's super cool. But like you said, having SQL being used by your Python is not the same as being a SQL developer.

21:19 Right, JavaScript has exactly the same problem.

21:22 All the web developers that use any technology whatsoever, they also use JavaScript.

21:25 but that doesn't mean Node.js is massively more popular than everything else.

21:29 Also, I just wanted to quickly follow up.

21:31 When people fill out those surveys, they check anything that they've ever done.

21:35 Yes.

21:37 So...

21:38 Exactly.

21:39 Have I touched CSS this year?

21:40 Yes, I'm a CSS developer.

21:42 All right.

21:43 Next of the extras, this is extra number two.

21:46 So remember we talked a little while ago about Kira Van Raasen, creator of Python, retiring.

21:52 We talked about him stepping down from the steering council and saying I'm just gonna chill for a while.

21:57 - Yeah.

21:58 - Yeah, he's done chilling.

21:59 (laughing)

22:01 So actually the big news, I think this is pretty big news, is that he joined, maybe as a technical fellow, I'm not sure exactly what his official role is, but he joined Microsoft now.

22:11 As a pretty high up. - That's awesome.

22:12 - Yeah.

22:13 - I think he should do call support, that'd be great.

22:15 - Yeah, so he said he decided to join, he said, "I decided that retirement was boring "and have joined developer division at Microsoft.

22:22 "To do what?

22:23 Too many things to say, but it'll make using Python better for sure, and not just on Windows.

22:28 There's lots of open source here.

22:29 Watch this space.

22:30 And there are 5,000, no, 2,100 quoted tweets, and I'm not sure how it'll tell me how many conversations, but there's like an insane number of replies to it as well.

22:43 And a bunch of familiar faces and listeners actually right there all replying to Guido.

22:48 One in particular I'd like to point out is, I linked to this in the show notes as well, is somebody said, "I'm wondering, at this point in your career, do they still ask you to submit a resume?" Yes, they did.

23:02 And I got interviewed by Kevin Scott and Andrew Tilesburg and others.

23:05 How cool is that?

23:06 They also asked for my diploma from university, exclamation marks.

23:09 So, squeed up.

23:11 - Oh my gosh.

23:12 - Yeah, I would think you just could walk up and say, "Hey, I created one of these languages.

23:18 I'm here, I'm ready.

23:19 But nope, it went into support.

23:21 - I don't even know if I can find my diploma.

23:23 - I'd have to dig.

23:24 I think I know where it is, but I know generally what part of the house it's in, but it's in boxes under boxes.

23:30 Anyway, that's really interesting.

23:33 Okay, that's two.

23:34 So extra, extra, extra.

23:36 If you think about popular editors in the Python space, really these days it feels like it's narrowing down into VS Code and PyCharm.

23:43 Like it used to be just completely all over the map when I asked that question on Talk Python, And these days it's VS Code, PyCharm, VS Code, or I was on one and switched to the other.

23:51 So, yeah, and Vim.

23:53 They don't say something like that.

23:55 It's either Vim or Emacs.

23:56 Yeah.

23:56 It's like one of the, those types, but right here in Portland, Oregon, roaming the streets, we now have a new editor called Nova.

24:04 From Panic.

24:05 Yeah.

24:06 So yeah, Panic is a developer oriented company that makes native Mac apps and they are right downtown by, by Pal's Books.

24:17 You can see their office from the coffee shop, I think.

24:20 - Cool. - Yeah.

24:21 So anyway, they built this thing called Nova, which is like a reinterpretation of their interpretation of what a code developer editor should be.

24:30 And it's got cool things like GitHub integration where it shows you, say, the issues around the code that you're working on and stuff like that like as you're going through it.

24:39 So I'm sticking with PyCharm.

24:41 I looked through this, it looks neat and all, but I'm not using it.

24:44 That said, I think it's worth pointing out that there's a new developer editor out there from a pretty reputable company that's putting a lot of energy into it.

24:51 So that's kind of cool.

24:52 - Yeah, it's got a Vim mode, I'll try it.

24:53 - I think it does, I'm pretty sure I remember it.

24:55 All right, last thing, extra, extra, extra, extra.

24:59 I installed Big Sur on my Mac and it didn't die and all the Python things seem to be working.

25:04 All the websites run, the MongoDB stuff's working.

25:07 So that's really pretty neat.

25:09 Homebrew stopped working, which is very frustrating 'cause that's how I manage things like Python.

25:15 But I just had to upgrade Xcode to the latest edition, and then it was good again.

25:18 - I don't think I put Homebrew on my computer.

25:20 - I love Homebrew. - I probably do.

25:21 - Yeah, I like it.

25:23 Installed Python, installed MongoDB, installed a lot of things like that.

25:25 OpenSSL seems to always get in there somewhere.

25:28 And also I said that I ordered a new MacBook Pro instead of the Apple Silicon thing.

25:37 I actually canceled that, and I'm getting a Mac Mini Apple one.

25:40 Very exciting, I'll let you know how it goes.

25:42 - Oh, I can't wait.

25:42 Actually, I didn't know they were still making minis.

25:45 They revamped it.

25:46 It is now faster than any mobile Mac.

25:50 And the only thing that will beat the Mac mini is the $5,000 Mac Pro.

25:56 But sometimes the $600, $700 Mac mini will still beat the $5,000 Mac Pro.

26:00 It's like ridiculous.

26:01 I might get one of these.

26:03 I already got a really beefy monitor.

26:06 Yeah, exactly.

26:07 It'll do one 6K and one 4K monitor.

26:09 So dual monitors, six and 4K.

26:12 I'm telling you, man, this thing looks incredible.

26:15 You look at the Geekbench scores, you look at the reviews, it's really awesome.

26:19 And the price is like, so I got like $1,500 back by canceling my MacBook order and a faster computer.

26:25 - Nice.

26:26 - So anyway, we'll follow up on that.

26:27 Let's see how it goes.

26:28 Anyway, that was extra, extra, extra, extra.

26:30 Hear all about it.

26:31 - Nice.

26:32 Well, so normally my spot would be number six, but that'd be like, we're at like nine now or something.

26:38 - Yeah, we're at nine now.

26:39 - Okay.

26:39 Actually, this is a cool article. I love this story. Dale Markowitz wrote an article called, I'm masquering it right now, but it's a Python-driven AI stylist inspired by social media.

26:54 >> No way. So it looks at like Instagram and like influencers and stuff and says, "This is how we think you should dress and look." >> Yeah. So one of the cool ideas, and it's so cool. So she works for Google. So she's using a whole bunch of Google tools that are available to everybody else to do things like Google Storage, Firebase, Cloud Vision API, Product Search API and stuff, which actually I've never played with any of these, but it's kind of neat that they're available to really anybody that they want.

27:22 And so the idea is she took pictures of all of her, every item in her closet and then has like folders for containing the pictures for related.

27:34 like let's say if you got a shirt or jacket, a few angles of the shirt and then threw those in a directory and then did that for everything in her closet and then took uh influencers that she likes like a couple social media accounts that that do fashion shots that she likes how they dress And then throws ai at it and scripts the whole thing with python. So this thing will tell her for this particular person that this look for this from this photo, you can kind of do this look if you use this shirt and those pants and shoes.

28:09 And so you've already like what you've already got, you can remix it this way.

28:13 Yeah. And I think that's, it's probably more of an ad for Google AI products. But I think it's a cool like you could do this, you know, with some free time and stuff and with some Python code to push it together.

28:28 I love this idea.

28:29 It's pretty cool.

28:30 Yeah, it's pretty.

28:31 All right, two thoughts.

28:32 So one, I remember my statistics class, they talked about, well, if you have like three shirts and two pants and five socks and two pairs of shoes, how many, you know, here's the combinatorics of how many like combinations you might have, right?

28:47 So those numbers get enormous, like super quick.

28:50 So this just says like there's these, these outfits that you didn't even know you could to create out of like the 100 million possible things from your closet, which is accommodations from your closet.

29:00 That's pretty cool.

29:01 - Yeah, and also, like she had to put it in place.

29:03 One of the things she had to do is put in place like a score.

29:06 So if you, like for instance, if you got like multiple gray shirts, they all might fit picture with the gray shirt, but they, she made it so that there was scoring so that you'd get the, like the, you can pick the highest score outfit or something.

29:20 - Yes.

29:21 All right, that's cool.

29:22 My other one is somebody should do this, but just for hairstyles and like beard styles, if you're a man, have it pick a style and then that person has to get that cut.

29:31 Right?

29:33 You're like, all right, this month I'm gonna look like this.

29:37 Oh my gosh, all right, here we go.

29:40 Why not?

29:41 - Okay, you'd have to like sort of make it like long to short or something because you can't go backwards.

29:48 - Yeah, yeah, I guess you'd have to like sort by order 'cause you gotta wait longer to get it to grow back out.

29:54 - Sort of by hand.

29:55 - Yeah, there you go, awesome.

29:57 - But there's some facial hairstyles that if we could get a tool that would tell people to not try certain facial hairstyles based on what their face shape is, that would be good.

30:09 - That would be very, I did see a guy who had like a super big beard and decided to cut it off, but instead of just shaving it off, they were very careful and they came up with like 10 or 11 different styles.

30:19 They shave it to one, take a picture, shave it to the next, take a picture.

30:22 It was actually pretty interesting.

30:24 - Yeah.

30:24 - But yeah, there's some that shouldn't be done.

30:26 (laughing)

30:27 All right, well I already went off the deep end on the extras, how about you?

30:31 - Yeah, let's skip to the joke, man.

30:33 - Oh man, sounds good to me.

30:36 All right, so this is a little bit of Back to the Future, Marty McFly and Doc, all that stuff.

30:41 So you know, he's got that cool DeLorean, that stainless steel DeLorean, and it's got the flux capacitor.

30:48 So this is a little graphic from DevHumor, from comicstrip.com and it's set in January 2006.

30:57 All right, I'll be Marty and you can be Doc, okay?

31:00 - Okay. - All right.

31:01 So sitting in the Delorean about to take off this.

31:04 So what's it like in the future, Doc?

31:06 Is everyone using CSS3?

31:08 - Wait, wait, you'll see.

31:10 We're heading to 2020.

31:12 Knowing all the problems you have with IE6, I'll give you something to look forward to.

31:16 - And then in May 2020, there's a big billboard that says Microsoft Edge, the IE successor based on Google Chromium engine is coming to Linux.

31:24 Incredible.

31:25 - Why?

31:27 Okay.

31:28 - Yeah, because it can.

31:30 Just because it can.

31:33 - I have, so I've got a work computer that's Windows and I still don't use Edge.

31:39 - And you're so far behind the times.

31:40 I've got Edge installed on my Mac.

31:41 - You do?

31:42 - Apparently it installs on a Mac, yeah.

31:44 - But do you, did you install it?

31:46 - I did.

31:47 Now the question is, do I use it?

31:49 I've got like several browsers that I just don't really use.

31:52 I've got Edge, I've got Brave, and I've got Opera.

31:57 And I don't really use any of those.

31:58 I just basically use Firefox.

32:00 Unless Firefox doesn't work, then I use Chrome.

32:01 - Yeah, okay.

32:02 - No, yeah, but I technically have it installed.

32:05 I get this big pop-up that has to update it about every three weeks.

32:09 Like, there's an update for your computer, click here to upgrade Edge.

32:11 I'm like, I don't even run this thing, why do I keep getting this?

32:14 I know I get it, but like, why do I have to keep getting it, I guess?

32:16 - You know, there's still lots of people that don't know what browser they use.

32:20 They just, they don't even know what to, if you ask them what browser they use, they don't know what you're saying.

32:25 - Yeah.

32:26 - It's just the internet.

32:28 Well, what do you look on the websites for?

32:29 I open the internet.

32:31 You know, the internet is not an application.

32:33 (laughing)

32:34 - What? It's not?

32:36 Awesome, yeah, so that's a pretty good little shoot to the future one.

32:41 - Yeah.

32:42 - So, link to that in the show notes.

32:43 People wanna check out the graphics.

32:44 - Cool.

32:45 Well, thanks a lot.

32:45 - Yeah, you bet.

32:46 Thanks for being here, and thanks to everyone for listening.

32:47 See y'all.

32:48 Thank you for listening to Python Bytes.

32:50 Follow the show on Twitter via @PythonBytes.

32:52 That's Python Bytes as in B-Y-T-E-S.

32:56 And get the full show notes at pythonbytes.fm.

32:59 If you have a news item you want featured, just visit pythonbytes.fm and send it our way.

33:03 We're always on the lookout for sharing something cool.

33:06 On behalf of myself and Brian Auchin, this is Michael Kennedy.

33:09 Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page