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

« Return to show page

Transcript for Episode #255:
Closember eve, the cure for Hacktoberfest?

Recorded on Wednesday, Oct 20, 2021.

00:00 Hey there. Thanks for listening. Before we jump into this episode, I just want to remind you that this episode is brought to you by us over at talk Python training, and Brian through his pi test book. So if you want to get hands on and learn something with Python, be sure to consider our courses over at talk Python training, visit them via Python bytes FM slash courses. And if you're looking to do testing and get better with PI tests, check out Brian's book at Python slash pi test. Enjoy the episode. Hello, and welcome to Python bytes where we deliver Python news and headlines directly to your earbuds. It's Episode 255, recorded October 20 2021. I'm Bryan rockin. I'm Michael Kennedy. Now Welcome again. Welcome, again, to be here. I'm sure people know you're through, through all you do with with textual and rich is you do a quick intro. I'm sure yeah, I'm a software developer from Edinburgh, Scotland, last couple of years been working quite heavily in open source. I built the rich and started work on textual, which is application framework using rich and I'm currently working exclusively on that sort of taken a year off. Probably more than that to work on open source projects. I'm very excited about that. We're excited about it.

01:23 Yeah, it's, that's fantastic. Well, I think we've talked about this offline as well, the the success you're having with rich in textual, and you're this opportunity, you have to really just double down on this project you created and I know there must be 1000s of maintainers of projects out there. And like if I could just put all my energy into this, and you're currently lucky enough to be in that situation. Right? That's fantastic. Yeah, I'm very fortunate actually. I mean, I'm, I put some money aside about a planned for this year. But things are really looking up. And I've been blown away by the level of interest from it. I mean, I'm a graduate roundtop with rich people, people like that. I think there was a there was a missing niche, or something which which did that. But then the textual people were excited about it. I mean, I'm, I put a disclaimer on the readme that said there's not quite ready for primetime yet. It might break and it's like active development, but doesn't seem to discourage anyone.

02:22 Very busy building things with it. So I'm excited. I want to, like, take it to the next level. And to be honest, if I was doing it part time, like it was doing rich, it would just take too long.

02:36 It was evening and weekend, it would be two years before it was like 1.0 Yeah, and we're ready to use it now. So yeah, most people want to use it yesterday.

02:49 Congrats again on that. That's cool. It's a great stuff. You know, we talked about over on talk Python, if people want to dive in, we've certainly covered it many times over here as well. So or happy to spread the word I yeah, the mic kicked off the topics. I do want to kick it off. Alright, how about we start with some awesome Python topic like c++. I like both of them. You This is right in your wheelhouse. Brian has a lot of c++. So I want to talk about this tutorial articles series. Everyone think about it of wrapping c++ code with scythe on. So the interoperability story with C and Python being c Python as the runtime is pretty straightforward, right? But c++ is a little more interesting with classes and this pointers and all those kinds of things. So the basic ideas scythe on is this thing that allows us to write very nearly Python code and sometimes actually just Python code and sometimes like in a little extended language of Python, that then compiles down to C. And if that's the case, well, it's it's probably pretty easy to get that scythe on code to work with C code and then scythe on naturally is exposed as Python objects and variables and whatnot. So that should be a good bridge between c++ and Python, right? And it turns out it is so this person Anton is a Dan Pushkin wrote an article or is working on a series of articles on wrapping c++ with scythe on. And so there's this library called yark URL, yet another audio recognition library. It's kind of like Shazam, it'll you give it a small fragment of audio and it'll say, Oh, that's pro jam, black, you know, blocked by Pearl Jam or something like that. Right? Pretty cool. And if you look at it, it's got some neat c++ features, you know, Brian, feel free to jump in on this. But see that right there namespace so cool. I love how they're writing like well structured c++ code here. But basically, there's a couple of structures like a WAV file and an mp3 file and then classes which have like a fingerprint and public methods and storage and so on. And so the idea is how could we take this and potentially make this

05:00 A Python library, I basically create a Python wrapper with scythe on for it. So I'm gonna come down here and says, All right, well, what we're gonna do is we're going to write some scythe on code. And scythe on doesn't immediately know how to take c++ header file, which is where stuff is defined in c++ and turn that into things that Python understands. So you've got to write basically a little file a PSD file that declares what the interface looks like. So you write code like this. Have you done this stuff before? Brian? No, but this looks pretty straightforward. Yeah, it's pretty straightforward. How about you? Well, I've never robbed a library, but I've used cython. quite successfully. So it's really good system. Yeah, I agree. I've done it. But not to wrap c++ code No, to basically do things like C def extern, from this header, create a namespace. And then you have C def, keyword CPP class. And then you get what's interesting about this is you get to give it to names. As you get to say, here's the name, I want to talk about it in Python. So CPP WAV file. And then here's its name in C, which is your control colon, colon, WAV file. And the value of this is they want to have a thing called WAV file in Python, but not the c++ one, a friendly Python one, but it needs to use the WAV file from the C library. So if you directly import it, and then there's like this name clash, which I suppose you could fix with namespaces and all but I think it's cool that you can give it this name, this kind of this internal name. And off it goes, right. So then you def def out its methods basically, like, just here are the function, the functions of the class, same thing for the fingerprint and the storage, and oligos. And so all of this stuff is pretty neat. And yeah, this thing I'm talking about called aliasing, aliasing, which is pretty awesome. Like, it lets you reserve the name, WAV file, and storage and fingerprint and stuff like that for your Python library without even though that's what the C names are as well. So yeah, pretty straightforward. What was the next thing I really want to highlight, there's kind of this long article here. So um, the next thing they talked about is using this thing called extension types. So an extension is just a C structure or c++ library, and you create some some class that is kind of a proxy to it. So here we say C def Python class called storage. And then internal, it has in scythe on language, you have to say C deaf, it has a c++ class called this. And then from then on, you just go and write standard Python code. And anytime you need to talk to the C library, you just work with the like inner pointer thing that you've created, which is pretty awesome, you just new one up in the constructor and the c++ thing and then like it goes off to pythons memory management, so you don't have to worry about deleting it. Stuff like that. I guess you have to sort of deallocate here, but that's you know, once you write that code, then Python will just take it from there, right? So pretty neat a way to do this, and the library goes on to talk about how you use it, and so on. So there's a couple of interesting things about like dereferencing, the pointer, like basically modeling reference types in Python. But if you've got a c++ library that you want to integrate here, I think this is a pretty cool hands on way to do a scythe on. Yeah, I think this looks fun. I'd like to give it a try. Yeah, definitely. Another one is, um, I bind 11. That might also be another option to look at. So I saw Henry out into the live stream there. So here's another way to operate, operate between seamlessly between c++, 11, and Python. So another another option in this realm, maybe I'll throw that link in the show notes as well. But yeah, a lot of cool stuff for taking these libraries written in c++ and turning them into Python friendly feeling Python native libraries. Well, you know, that's, that's really how a lot of pythons taken off, right is because we've been able to take these super powerful c++ libraries and rapid Python interface into it and have them stay up to date. When you make updates to the to the C, C and c++ code, you can get updates to that as well. You sometimes hear Python described as a glue language, I think, many years ago. That's probably what it was. I think Python is growing. It's more than just a glue language. But it's very good at

09:18 connecting other languages together. Still good as a glue. Yeah. Still, yeah. It's not just ugly language. It's

09:24 a language of its own, I guess. Yeah, I was talking to somebody over on talk Python, and I'm super Sorry, I forgot which conversation this was. But they described Python as a glue language for web development. I thought, okay, that's kind of a weird way to think of it. But alright said, Well, no, no, look, here's what you do with your web framework. You glue things together, you glue your database over to your network response, you glue an API call into that, unlike you actually, that's kind of is what a web site is it talks to a database that talks to external API's. It talks to the network in terms of like HTML responses, and

10:00 That's the entire web framework. But yeah, you can kind of even think of those things and that those terms there. It's like a, like a party where no one's talking to each other, or need someone to like, start conversations. That's what Python does. Yeah. And I think also, that that's why Python is so fast for web frameworks, you know, even though computationally, it's not super fast. Like, it's, it's mostly spending a little time in its own code. But a lot of time, it's like, oh, I'm waiting on the database. I'm waiting on the network. I'm waiting on an API. And that's where web apps spend their time anyway, so it doesn't matter. Alright. Brian, you want to grab the next one? Yeah, sure. But on to topic to book, but on. So I've got, I just have a few packages that I support on pi pi, and then a whole bunch of internal packages I work on. And one of the things that is a checklist that I've got is what do I do when I bump the version. And I know that there have been some automated tools before, but they've kind of, I don't know, they make too many assumptions. I think about what, how you structure code. So I was really happy to see t bump come by this was suggestion, but suggested by Steffi Berry. But um, so t bump is an open source package that was developed, looks like it was developed in house by somebody, but then their employer said, hey, go for it open source. So that's cool. And the idea really is, you just you, you just bump versions, and that's it. But it does a whole bunch of cool stuff. It does. So let's say I've got it, we got to initialize it. So you initialize it as a little tomo file that stores the information in the configuration. But if you don't want yet another tamo file or another configuration that can also append that to the project, I thought that was a nice, nice addition, you can combine them or keep it separate up to you. And so for instance, I tried it on one of my projects, and I kept it separate, because I didn't want to muck up my project at amo file. But

11:58 once you initialize it, all you have to do when you want to bump a new version is just say, t bump, and then give it the new version, it doesn't automatically count up, I mean, you could probably write a wrapper that counts up. But looking at your own version, and deciding what the new one is, is reasonable, it's a reasonable way to do it. And then it goes out in it. It patches any versions you got. And then in your code in your code base where your files or config files or wherever. And then and then it create commits those changes, it adds a version tag pushes your code pushes the version tag. And then also you could have these optional run things places. Like before you commit, you can run some stuff, like for instance, check to make sure that you've added that version to your change log or your if you want to check your documentation. So that's and then

12:51 if you wanted to, I was thinking a post action would be cool, you can just automatically tweet out, hey, new version is here. That's something that up that'd be fun. Yeah, grab the first line. Now the release notes. Just tweet that. Yeah. And then there's, there's the hard part really is, how does, how does it know where to change the version. And that's where part of the configuration I think is really pretty cool. It just has this is this file configuration setting. If I can find it on here, that you list the source. And then you can also list like the configuration of it, grab one. So like,

13:30 the source, and then where, how to how to look for it. So like it's a search string or something of what lined to look for, and then we're replaced the version. And that's a pretty straight. I mean, you kind of have to do some hand tweaking to get this to work. But for instance, it's just a couple lines, makes it pretty nice. At first, I thought well, it's not that much work anyway, but it's way less work now. And then, frankly, I usually forget, I'll remember to push the version, but I'll forget to make sure that it the versions of the change log, I'll forget to push the tags to GitHub, because I don't really use the tags, the version tags and GitHub, but I know other people do. So yeah, it's nice. Yeah, well, what do you think as someone who ships libraries frequently that matter? I think it's useful thing for my libraries. I've got the version in two places two files.

14:21 So for me, it's like edit two files done.

14:27 Probably wouldn't be late, massive time saver, but I like the other things you can do with it that the actions you can attach to it like I'm creating a tagging in GitHub, because I do often quite often forget that especially for like minor releases. I sometimes sometimes forget that. So that's quite useful. Yes, the extra step is not just changing the files but like Brian described like push creating a branch creating a tag pushing all that stuff over and making sure they're in sync. That's pretty cool. Yeah, good find this does more than I expected when I saw the title we got next Well, yeah.

15:00 On your first one, this is close Ember which is

15:06 was was portmanteau is when you put two words together November and close ideas to help open source containers, close issues and close prs. So is this like to recover from the hangover of October? October? I think so. Um, I didn't do hack tober this year, I didn't either. No, no, last year, I mean, I got a lot of prs coming in, some of them are of dubious quality.

15:36 Some of them just some of them are very good Actually, I did actually benefit a lot, but it does actually generate extra work. If you manage it, it's really great.

15:48 But but this is it generates more work for you even though it's um, it's in your benefit because Ember is purely to take work away from your work or work away from maintainers. You know, if it's lots of issues, I mean, I'm, I've been very busy lately and not kept an eye on the rich issues. And they've just piled up. Some of them can be closed with a little bit of effort. And so I think that's what this project as more of a movement than a project designed to do is designed to take away some of that burden from maintainers. And it's a very nice website here, and there's a there's a leaderboard on different issues, and describes

16:30 what you should do to cause issues and prs. The author, his name is Matthias Busan near I've probably mispronounced that. He's, um, he started this I think he's, I think it's gonna turn into a movement, and possibly, it's too too soon to really get big this year. But I'm hoping that next year, it'll be a big thing. It will be after October you can relax a bit because someone will get lots of people coming in to like, fix your your issues and clear some prs and things like that. I mean, it's sometimes it is maintenance. It's it's just tidying up closing prs, which have been married and, and closing issues which have been fixed that kind of thing. So I think it's a great thing. I guess I don't quite get what it is. Is it a call out to people to help maintainers? Yeah, yeah, it's like a month long thing. It was like a almost like a competition that did. Yeah. Right. Yeah. Yeah. Yeah. Mateus is a core developer of Jupiter and ipython. So he's definitely working on some of the main projects there. Yeah, he probably understand that the burden of open source maintainer, even if you love something, it can be, it can be hard work. too much of a good thing, right? But no t shirt for this, at least not this year. I don't think they offer t shirts now. Maybe next year. I wonder if you can add your project to this. I think you can tag tag your project with close Ember. I think that's how it works. And then other people can search for it and decide which one they want to help us. Alright. So another Brian, Brian skin said over Thank you, Brian was sending a ton of stuff far away lately, and we really appreciate it.

18:21 So this one is the announcement is that psychic learn goes a one Dotto. And if you look at the version history, it's been zero for zero over for a long time. With being Yeah, zero dot 20, zero to 21, zero to 20 to 30. So this release is really a realization that the library has been super stable for a long time. But here's a signal to everyone consuming psychic learn that, in fact, we intended they intended to be stable, right? So there's certain groups and organizations that just perceive the reverse stuff as not finished, especially in the enterprise space, in the places that are not typically working in open source as much but are bringing these libraries and you can see managers like we can't use psych at Learn it's not even done 00 dot 24. Come on. Right? So this sort of closes that gap as well as signals that the API is pretty stable.

19:18 Will textual is not quite ready for this as it you know, it's just on Xerox, I'm kind of advertising that I might change a signature next version and, and break a could never do that lightly. But it's always a possibility. So if you use it, if you use a zero point, version of anything, you should probably pin that. And just make sure that if there's an update that you check your code by as a consumer of rich or a consumer of last or consumer, whatever. If you're using a server, you're recommending you pin that in your application or library that uses it, right. Yeah, exactly. I mean, you should, you might want to pin anyway, just to lots of bits of software.

20:00 are working together. There could be problems with one update here that breaks this by software here. But when you got 1.0 that's the that's the library developer is telling you. I'm not going to break anything backwards compatibility without bumping that major version number, if they're using soundbar. But because there's lots of other versioning schemes that have like pros and cons, yeah, like calendar, nice versioning and stuff like that, right? Yeah. Yeah. I think that makes more sense in a live in an application than it does in a library, calendar. versioning I think you're not sure how much it makes how much the calendar versioning makes sense for libraries? Maybe it does. I don't know. I think projects that some projects that have shifted to Calver have recognized that they really are are almost never changing backwards compatibility. So, so it doesn't they're never going to coach you and I are number Yeah, it's strange. There's no one perfect system. I quite like sound verb and by and large, it does what I need of it, but there is no perfect system really. Yeah, like it as well. Just the whole zero verb being for like something is on zero version, zero dot something for 15 years. Like that doesn't make sense. Yeah. Right. So this is we're talking about the one Dotto release cycle learn, let me give a quick shout out to some of the new features or some of the features that are highlighting. So it exposes many functions and methods which take lots of parameters like hist, gradient boosting regressor use that all the time Not really, but it takes I was at 15 parameters, like 20, zero to 55. None None false. What, what are these right? And so a lot of these are moving to require you to explicitly say, min sample leaf is 2002. regularization is zero max bands is 255, like keyword arguments to make it more readable and clear. I like to make virtually all my arguments keyword only, I might have one or two positional arguments, but the rest keyword only I think it makes code more descriptive. You can look at that code. And then, you know, at a glance what this argument does, yeah, absolutely. Yeah, it drives me nuts when there's like, I want all the defaults, except for like something special at the last one. And so I've got to like fill in all of them just to hit them. And also, I would love to throw out that this is way better than star star kW ARBs, way better, right? If you've got 10 optional parameters that have maybe defaults or don't need to have a specified value, make them keyword arguments means that the tooling like pi charm and VS code will show you autocomplete for for these. I mean, if it's truly open ended, and you don't know what could be bass stars are kW arcs. But if you do know what can we pass something like this is way better as well. Right now,

22:49 you have to type more. If you've got like a signature, which takes the same parameter something else. You just have to type it all over again, that can be a bit tedious. But it's it's very beneficial. I think for the tooling. Lee said, Indeed, also for typing right, you can say that this keyword argument thing is an integer and that one's a string, right? If it starts our kW org, or just any any great, okay, or a string any, okay, so we also have new spline transformers. So you can create spline Bezier curves, which is cool quintile regressor is updated feature name support. When you're doing an estimator pass to a panda's data frame during a fit, it will, estimator will set up feature names in attribute containing the feature names. Alright, so that's pretty cool examples of that, a more flexible plotting API, online one class SVM for all sorts of cool graphs, histogram based gradient boosting models are stable and new documentation. And of course, you can launch it in a binder and and play with it, which is pretty sweet. Congrats to the psychic learn, folks. That's very nice. And also kind of interesting to get your take on API changes and versioning and stuff. Well, oh, before we move on, Brian, I saw a quick question that maybe makes sense to throw over the will from

24:06 everybody, he's asking this, so I have ordered the windows. The question is, when will there be windows support for textual? Yeah, I've ordered the Windows laptop. I've been working on a VM, but it's a pain to work on a VM, I've ordered the Windows laptop, but that's going to arrive at the end of this month. And I don't know exactly when, but that will definitely. I'll definitely need that to get started. And in CD, and CD should only be a week or two work. So how about I'll say this year, this year, after the month of configuring your laptop, that's true. That's drive and use Windows and I don't know how long apart from a VM

24:46 I need. Good test it with a new windows terminal, which is actually really really good. Yeah, the windows turning off good. Yeah, I think it can be like, first class like textual platform

24:58 at the microscope

25:00 Linux works great Windows has always been like a bit of a black sheep. And but the new windows terminal is a godsend because the old terminal was, frankly terrible hadn't been updated in decades. Yeah. The article one is no good. But the new windows terminal is really good. Also, just a quick shout out for some support here. Nice comment to share. Windows support will be provided when you click the pink button on wheels GitHub profile, aka the sponsor button.

25:28 Sure, no ransom, I promise I do intend to do.

25:33 Alright, how about some server stuff? I we've talked, we talked, I can't remember, I think several times talked about how to use how to develop packages while you're offline. Like let's say you're on an airplane, or at the beach or something with no Wi Fi. I mean, maybe there's Wi Fi at the beach. But now that the beaches I go to. So that's because you live in Oregon, and some of the most rural parts. Are the Beach, California have 5g? Yeah, well, I mean, I could tether my phone to it or something. But anyway, so Jason Coombs, sent over an article

26:07 using dev AI as an offline ipi cash. And I, I had to tell you, to be honest, that, I don't know if it's just the documentation for Delphi or the other tutorials, they just like, threw out a few commands. And, and they're like, that's your good, that's, that'll work. And I just never got it. I've tried it, it just didn't work for me. But this did. So this, this tutorials, just a straightforward, okay, we're just going to walk you through exactly everything you do. It's really not that much. For instance, I suggest using PIP X to install device server, which is nice.

26:44 package as well suggested installing itself with PIP x, Pip x is gaining a lot of momentum, well, especially things like well, like, yeah, t bump, or well, or dev by itself, I do with T bump because I want other package maintainers to be able to use it too. But anyway, this is definitely something you're just using on your own machine. So why not? Let it sit there. And then so you install it, you knit it, and it creates some stuff. I don't know what it does when you need it.

27:13 But then you hidden in here is you run dev by server also then. So it really is just a few commands, and you get a server running, but there's nothing in it is there's there's no cash in it yet. So then you have to, you have to go somewhere else, and then prime it. So you've got a local host, and you that it reports. So you can export that as your PIP index, and then just create a virtual Mervyn's start installing stuff, that's all you got to do. And now now it's all primed. And then what you do is you turn off when next time, when you're when you don't have any Wi Fi,

27:50 you turn off, you can run the dev PI Server as where's it dev pi, offline mode. And then there you have it, you've got a cache of everything you need. So I tried this out, I'm just done like, like, you know, installing pi tests and my plugins, and then set it in offline mode, and then tried in all the installing the normal stuff. And it just did work fine into a new new virtual environment. But then when I tried to do something like, install requests that I didn't have yet or something else, it just said, Oh, that's not it's not, though I can't find it or something. It's a happy failure. So anyway, this, this instruction were great. I know dev pi can be do a whole bunch of other stuff. But I don't need it to do a whole bunch of stuff myself just needed to be API cash. Yeah, this is really neat. So it looks like it creates the database schema, as well as allows you to set up set up a user. Okay, I guess you could you set up with some authentication that no one can mess with it and stuff like that. Apparently, this works just fine for teams. So you can set up set up a server on like a, just like a computer that in your network that just runs as a cache and then you can point everybody can point to the same one. So I mean, that that that would work as a really quick and dirty and not too dirty, just a fairly quick way for a local team to have a caching server. I'd probably even think about doing this for testing even on one machine so that you can have multiple, like you know, completely clean out your environments and still run, run a test machine and not hit the network so much if you're pouring a lot, a lot of different stuff. Henry Shriner on the livestream says can we also mentioned that Jason, the article we're just talking about also maintains 148 libraries, including setup tools on pi pi. That's awesome.

29:44 So may know something about interacting with pi pi.

29:49 Phenomenal. I don't know how to find the time to be honest. 140 packages, you need to close Ember. You need a lot of close Ember.

29:57 Awesome. All right. Well, what's this last one

30:00 Then you got for us here. Sure. So I found this project on Reddit. It's called pi pi command line. And I noticed it in particular, because it used rich, but it is a pretty cool project

30:13 is notable because the, the author is 14 years old, like, blown me away.

30:20 Give me that young nice, he's done a very good job of it. So let's interface to pi pi from the command line, you can do things like get the top top 10 packages, you can search for packages. And you can see here some think that's a search.

30:39 Pipe by search. Rich, and that's given all the packages that have got rich in the name, it's got a description, everything and then the date. And here you can pipe it in for Django that gives you some nice information about the Django package which it pulls from my pie. GitHub stars, the download traffic, what it depends upon it meta information, like its license and who owns it. This is really cool. Yeah, it's really nice. And here, we have the description, and that's rendered, and that renders the markdown right in the terminal. And I wonder how does that

31:15 I couldn't hazard a guess. It's gotta use Right, right. Thank you my Yeah.

31:21 Yeah, so it makes good use of rich, that's how I haven't noticed it. But it's a very cool project in its own right, yours also uses um, questionary. That's like a terminal thing for selecting stuff from the menu.

31:37 So it does a bit dynamically and also has like a command line to do more from the air, or the terminal.

31:46 I think it's well worth checking out. I think I want to check it out just for this example of using using this sort of a workflow, not necessarily with pipe UI, but with the sort of copying the codes. Yeah, yeah, it's a really nice look in Terminal user interface type thing. I think it could be really interesting for you, to me, Brian, to just do like info on the various things we're talking about. Right? That'll that might be fun to pull up as well. Yeah, there's, there's actually tons of times where I don't really want to pull up a web browser just but I do want more information, just to help gives me I love the web. But sometimes, you have to do a context switch if you're in the terminal and you're like your brain commands and then you've got to like switch windows and find the tail the bar and type everything in.

32:29 This is just a little bit of effort, but it can kind of like interrupt your, your flow when you're working. Yeah, I mean, especially when you got like the whole Okay, like a big monitor, and I've got them all everything in place exactly where I want to, and there's no web browser. So if you want to look something up, I gotta like, you know, interrupt that. Yeah. Are you did the browser at once there, but it's behind a dozen other windows? Does another web browsers typically.

32:53 Exactly. Yeah, that's a good find. And well done. This. This guy who wrote it said at such a young age, very cool. I was just gonna ask you if you have an extra thing, so yep. Do I have any extras? Today? Here's my little banner. Actually, I do have some actually, Brian. quick shout out. Madison sent over notice to let us know that pi cascades 2022. Their call for proposals is out. So if you want to sign up for that, it closes October 24. So you know, make haste. You've got four days, but yeah, still, he closes in four days. So if you're thinking of something you got three days talks to 25 minutes long. It was a lot of fun. You know, we both attended this conference a few times it in the before times it was in Portland, Seattle and Vancouver. This I'm not sure what the story is with this one. person, but I think it's remote, right? Yeah, I think so. At least hope I'm not wrong. Yeah, I think you're right. Then. If you got your MacBook you're in one max. You ordered that yet? I want one but no. Three.

34:00 I would love one but I have no idea what I do with it. You know, I just walk into terminal most the time. Hey, you know it has that new pro? Was it pro rez something display where it has 120 adaptive display hertz display. So you know, maybe I think my monitor only does 60. So I don't know if I could use it. But I have actually got text on 120 frames per second. Which is pretty crazy. Yeah, that's pretty crazy. I did end up ordering one and my apple account. I have this really cool message. It says your order will be available soon. MacBook Pro available ship available to ship? No. So we'll see where that goes.

34:41 here that goes. I think your address, I should think how many people's orders I would be just like a stack of boxes outside. Did that Amazon or some? Yeah. And then I think also I want to give a quick shout out to this thing, this codeweavers crossover which allows you to run Windows apps natively

35:00 On Mac OS without a virtual machine, it's like an intermediate layer. So I think that that kind of stuff is gonna get real popular especially since the new m ones have like a super crappy story for Windows as a virtual machine because Windows has a crappy arm story. And you could only do arm VMs over there. So I think that things like this are gonna become really popular. There's a bunch of cool stuff if people haven't checked out this crossover stuff I haven't really done much in it but it looks super promising. I've like been on the verge of like I almost need this but I just read enough Yeah, that's that. Anyway, those are my extras. Okay, well, I got a couple we've we've brought up starship once I just I've burnt down and I'm using starship now looks working nice. And one of the things that installed when i when i brew installed starship, it also installed the PI in. I'm not sure why. So I started using pi m also, it was still in pi and works great. I like it on my Mac, but I still don't think it belongs in Python tutorials. Anyway, burning still out on me whether or not it's any better than just downloading off of org. You're gonna get tweets, Brian, you're gonna get tweets.

36:07 I agree with you, I suppose.

36:10 One of the things that was announced today is the vs. Code dev is a thing. So I thought it was already there. But apparently this is new. If you go to VS code Dev, it is just VS code in the browser. Oh, interesting. I think it was already executed. And we're like, Where's your file system and stuff like that? Well, I think it's the same as like the the GitHub dot. Yeah. Okay, got it. Um, so it can use the local file system, though, which I think is the difference. GitHub had this thing me, you hit dot, and it brought up VS code, which worked was the files in your repo. But I think with this, they can actually use your local file system. Wow. Which makes it more interesting is great. If you work on another computer and just pop it open. You've got all your savings there.

36:59 Ready to go? Yeah. That actually is quite a bit different than that's pretty cool. Yeah, two use cases for me that, that I think I would use this that seemed really nice. One is, I'm working like, say on my daughter's computer. She's like, Dad helped me with this. But you know, there's helped me with something. And I've got to open some file in a way that has some form of structure. And I you know, she doesn't have VS code set up on her computer. She's in middle school, she doesn't care. But I could just fire this up and you know, look at some file in a non terrible way. Right? That would be great. The others on my iPad? Oh, yeah. Right. Like there's not a good super good story for that. But this kind of like VS code in the browser, other things in the browser. They seem really nice. Or if I was on a Chromebook or something like that, right? If I was trying to help somebody with code on a Chromebook, that'd be good. How about you? Well, yes, first, here we go. Python, multi threading, without the Gil. Gil stands for global interpreter lock. And it's something which prevents Python threads from truly running in parallel, is people have been talking about this for years. And I've got a bit kind of, you know, dismissive because every time it comes up, it never seems to happen. Because there's quite a lot of trade offs generally. And if you get rid of the Gil, you hurt single threaded performance. And most things are single threaded. But this looks like the author, some Groasis has come up with a way of removing the Gil without hurting single threaded performance, I think they've got is to do with reference counting. They've got two references. Reference counts one for the thread, which one's the object and one for all the other threads. And apparently, it's worked quite well. And the great thing about this is that super creative to basically think of like, well, let's treat the ref count as a thread local storage. And probably when that hits zero, you're like, Okay, well, let's go look at the other threads and see if they're also zero, right? Yeah, yeah. And if this goes ahead, and it's got quite a lot of support, I think in the core dev community, I don't keep a really strong eye on that but from what I hear is got a lot of support. And if that land then we can get a fantastic performance out of multi threaded code, you know, if you've got 20 threads, you get almost 20 times performance so that that can be huge. And I've no doubt it'll be a lot of technical hurdles from C libraries and things. But I'm really excited about that. I think the performance improvements the single threaded they come in little fits and starts you know, we get 5% here 10% here and it's all very welcome. But if this lands, then you can get like 20 times for certain types of computing tasks. And so I'm I'm really excited. I hope this one that's one land I mean, you're talking about this, oh, here let's let's get this multi threaded stuff. You know, you were just saying what are we going to do with these new m one pros and one max mean 10 core machines, 3032 core GPUs, there's a lot of

40:00 A lot of stuff that's significantly difficult to take advantage of with Python unless something like this comes into existence. Right? Exactly. If you have 10 cores, chances are you just use one of them. And I'm wondering if this goes in whether it will change, we'll need some other ways of taking advantage of that. Because I think at the moment, for most tasks, you'd have to explicitly create and launch threads. I wonder if there'll be advances where Python could just launch threads and things which can be easily parallelized?

40:33 Maybe I'm hoping for or too much, but I have no doubt, it'll be some kind of like software solution to help you just launch threads and like use all those cores. In your shiny new max. There's a lot of interesting stuff that you can do with async and await. And there's also some cool thread scheduler type things. But I think the, you know, much like Python three, when type annotations came along, there was a whole bunch of stuff that blossomed that took advantage of it like pedantic and fast API and stuff, I feel like that that blossoming hasn't happened, because you're really limited by the Gil the CPU level, then you go multi processing, and you have like a data exchange and compatibility issues. But if this were to go through all the sudden people were like, Alright, now how do we create these libraries that we've wanted all along? Yeah. Yeah, I think that's, I think, once we got over that technical hurdle, all the all the library authors will be like, looking for, like creative ways of using this for speeding code up and for just doing more with your Python. Yeah, I mean, with it with every programming language, the jump from single threaded to multi process is a huge overhead. So you don't do it lightly. But you could do it lightly with multi threads, you don't have such a huge overhead burden with reds. It's very exciting. I was also super excited about this. So I'm glad you gave it a shout out, we'll probably come back and spend some more time on it at some point. Yeah. And

41:59 somebody said, One of the exciting things about it is we didn't say no, immediately.

42:06 That's a very good sign.

42:08 Yeah. Which is not been the case for some of these other ones because they were willing to sacrifice single threaded performance to get better multicores performance. Like, you know, this is not a common enough use case that we're willing to do that. I think actually, the solution the author came up with. It did reduce single threaded performance, but he also added some unrelated optimizations which speeded it back up again.

42:33 I'm sorry, I fix it. Yeah. Yeah. Interesting. Well, my thought on this really quick, David pushing out the live stream says, the elected me is like nuclear fusion. It's always 10 years away. Yeah. I hope hopeless. Hopefully, it's not. It's possible. But I think this is the biggest possibility since then, to do interesting things maybe already take into account that, you know, looked at and didn't say no, immediately to. This is a project from this is a project Sam's working on but it's supported by Facebook, where he works. So there's like a lot of time and energy, it's not just a side project. Third, Larry has stains hastiness, the guy who was doing the galacta me commented on this thread saying you've made way more progress than I did. Well, then Sam, so these are all good signs. That's fantastic. Yeah, yeah. All right. Well, Ryan, have a ready for a joke. Laugh definitely. This is optimistic because they're not always that funny.

43:28 But I'm gonna give it a try this one is for the web developers out there for those folks that work on API's and probably have been working for a long time on them. So the first one I got for us I just found another one I'm gonna throw in from inspired by the live stream, but this one is entitled The torture never stops. Right? Okay, so it's a every one of these it's four different pictures in this cartoon. there's a there's a different developers up at the board describing some new way to talk to web servers from your app. So way back in 2000. I says soap simple. Object Access Protocol soap makes programming easier. And the developer in the audience like WTF is soap. Oh, come on. What is this crazy namespaces in XML? skip ahead. 10 years now there's a developer of here saying rest representational state transfer rest is better than soap. The developer now as wtf was wrong with soap.

44:23 2015 graph qL graph qL is more versatile than rest. WTF. I was just getting the hang of rest 2018 g RPC. g RPC is faster than graph QL. WTF. I thought you knew by now that torture never stops. Like the guy next to the other developer that's been complaining for 20 years. I think that that hits a bit too close to home. But if you're a developer that gets compressed into like the last six months, I think that's right, you. You've lived out really hard, really intensely. Nick says let's just start over so yeah, pretty good. Pretty good. Alright. And then we were talking about

45:00 VS code dot Dev and how he just your browser and GitHub, or how you go to that URL, and so on How cool was and somebody said, Oh, it doesn't work in Safari. So I want to come back to this joke that used to be applied to IE.

45:17 But now I think should be applied to Safari like genuinely I think it should be is it's the browser wars as a cartoon. So there's Chrome and Firefox a little dated because Firefox is not as popular as it used to be sadly, but it's like Chrome and Firefox are fiercely fighting and like it is in the corner eating glue.

45:37 Just feel like that needs a little Safari icon and we'd be good. Yeah, we'd be all up to date. 2021. I didn't know what's IE.

45:45 It has going on and

45:49 he is of course is backwards because this shirt is probably on backwards or something also is eaten glue.

45:57 Yeah, true. Funny. So thanks. Well for joining us today. This is really cool show. Thanks, everybody in the chat for all the great comments. Thanks, Brian. Thanks. We'll see y'all next. Thanks, guys.

46:10 Thanks for listening to Python bytes. Follow the show on Twitter via at Python bytes. At Python bytes as in BYT s. Get the full show notes over at Python byte sarafem. If you have a news item we should cover just visit Python by sarafem and click Submit in the nav bar, we're always on the lookout for sharing something cool. If you want to join us for the live recording, just visit the website and click live stream to get notified of when our next episode goes live. That's usually happening at noon Pacific on Wednesdays over at YouTube. On behalf of myself and Brian rockin This is Michael Kennedy. Thank you for listening and sharing this podcast with your friends and colleagues.

Back to show page