This episode, you'll learn about a project that has the potential to unlock massive innovation
around how CPython understands and executes code.
And it's coming from what many of you may consider an unlikely source,
Microsoft and the recently open-sourced cross-platform .NET Core Runtime.
You'll meet Brett Cannon, who works on Microsoft's Azure Data Group.
Along with Dino Villan, he is working on a new initiative called PYJION, P-Y-J-I-O-N,
a JIT framework that can become part of CPython itself,
paving the way for many new just-in-time compilation initiatives in the future.
This is episode number 49 of Talk Python to Me, recorded February 4th, 2016.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
This is your host, Michael Kennedy. Follow me on Twitter, where I'm @mkennedy.
Keep up with the show and listen to past episodes at talkpython.fm,
and follow the show on Twitter via at Talk Python.
This episode is brought to you by Hired and SnapCI.
Thank them for supporting the show on Twitter via at Hired underscore HQ and at Snap underscore CI.
Hey, everyone. I think you're going to love this episode.
Brett is doing some amazing work, and we talk about that in depth, but he's also a Python core developer,
and we spend a decent amount of time on Python 3 and moving from Python 2 to Python 3 and that whole story there.
I do have just one piece of news for you before we get to the interview.
It's just T minus 10 days until my Kickstarter for Python jumpstart by building 10 apps closes.
The initial feedback from the early access students has been universally positive.
If you have backed the Kickstarter with early access, be sure to create an account at training.talkpython.fm
and send me a message via Kickstarter so I can get you the first six chapters, about three hours, of the course.
If you're not sure what I'm talking about here, check out my online course at talkpython.fm/course.
Now, let's hear about JIT innovation in CPython and more with Brett Cannon.
Brett, welcome to the show.
Thanks for having me, Michael.
I'm super excited to talk to you about this new project that you guys have going on with Python and Microsoft.
And yeah, we're going to dig into it. It'll be fun.
Yeah, I'm looking forward to it.
Absolutely.
So before we get into that topic, though, what's your story?
How do you get going in Python and programming and all that?
They're slightly long stories.
So getting into programming, probably my earliest experience with anything you could potentially call programming was Turtle back in third grade.
I was lucky enough to be in a school that had a computer lab full of Apple IIEs.
And they'd bring us in and say, oh, look, you can do this little forward command and make this little turtle graphic draw a line and all this stuff.
Was that on the monitor that was just like monochrome green?
Yep. And that's why I think I used one of those, too.
Yeah. I sometimes run my terminal with that old green and black style because it's just what I started with back in the day.
Oh, that's awesome.
So I did that, but I didn't realize what the heck programming was.
But I always found computers kind of this fascinating black box that somehow you stick in these five and a fourth inch floppies, which dates me.
And somehow we're in the world in Carmen San Diego plays.
I was like, wow, this is amazing.
And then in junior high, I ended up taking a summer class on computers and it involved a little bit of Apple basic.
And I really took to it.
I actually lucked out and got so far ahead of the class.
The teacher just said, yeah, you can stop coming to class if you want for the rest of the summer.
So that was like halfway through.
So I got bit kind of early, but I didn't really have any guidance or anything back then.
I mean, this is pre-access to the Internet, so I didn't really have any way to really know how to carry on.
And then when I went to junior college, my mom made me promise her that I would take a class in philosophy and a class in computer science.
And I did both and I loved them both.
But in terms of the computer science, I read through my C book within two weeks.
And then one night, spent six hours in front of my computer writing tic-tac-toe from scratch.
Using really basic terminal output.
And I was basically hooked for life.
In terms of Python.
That's really cool.
I think we all have that moment where you sit down at a computer and you haven't, maybe you've really enjoyed working with them or whatever.
But then you kind of get into programming and you realize, wow, eight hours have passed.
And it feels like I just sat down.
And then you're in the world.
That's it.
Brought me my dinner at my desk.
And you said, okay, I get it.
You're just into this.
Just go with it.
Here's your food.
Make sure you eat at some point tonight.
Awesome.
Yeah.
And in terms of Python, I actually ended up going to Berkeley and getting a degree in philosophy because there were some issues trying to double major like I originally planned to do.
But I did try to still take all the CS courses there.
And there was a test to basically get into the intro of CS course at Berkeley at the time.
And I thought they might have something about object-oriented programming.
And having learned C, I knew procedural, but I didn't know object-oriented programming.
So in fall of 2000, before I took the class in spring, I decided to try to find an object-oriented programming language to learn OO from.
And I was reading and all this stuff.
And Perl and Python caught my eye.
But when I kept reading, Perl should be like the fifth or sixth language you learned.
While people kept saying, oh, Python's great for teaching.
I mean, all right, I'll learn Python.
And I did.
And I loved it.
And then I just continued to use it for anything I could and all my personal projects.
And just kept going and going with it.
And I haven't looked back since.
Yeah, that's really cool.
What language was your CS 101 course actually in?
Scheme, actually.
Interesting.
My CS 101 class was Scheme as well.
And I thought that was a very interesting choice for an introduction.
Yeah, it was really interesting.
I mean, it does kind of do away with the syntax.
But obviously, now being a Python user, I really understand what it means to kind of really minimize the syntax in a nice way instead of a slightly painful way with all those parentheses.
And it was interesting.
I mean, it is a nice way to try to get in procedural programming and object-oriented and functional.
So it was really nice to do multi-paradigm, teach you the basics kind of introduction.
They did actually, interestingly enough, for the last project to have us write a really basic logo interpreter, which, funny enough, was such a bad experience for me,
partially because of the way it worked out in terms of having to work with another team.
And I had some issues with my teammates.
I actually kind of got turned off on language design, of all things, for a little while.
And then I just, over time, kept realizing I loved programming languages, learning how they worked.
So I just re-evaluated my view and just realized, okay, it was just a bad taste from a bad experience and realized that I actually do have this weird little fascination with programming languages.
And luckily got over that little issue of mine.
Yeah, no kidding.
And now you're a Python core developer, among other things, right?
Yeah.
So back to the language design, at least on the internals.
Yeah, yeah.
Awesome.
So we're going to talk about Pigeon, this cool new JIT extension.
You're going to have to tell me a little more about how you'd most correctly characterize it for CPython.
But before we do, I thought maybe you could give us like a high-level view of two things.
How CPython works, what's sort of going on when we run our code as is, right, with the interpreter.
And then maybe a survey of the different implementations or runtimes.
Because a lot of people think there's just one Python from an implementation or runtime perspective.
And there's actually quite a variety already, right?
Yeah, actually, we're kind of lucky in the Python community of having a lot of really top-quality implementations.
But to target your first question of how CPython works, which is, for those who don't know,
CPython is the version of Python you get from python.org.
And the reason it's called CPython is because it's implemented in C and has a C API,
which makes it easy to embed in stuff like Blender.
Anyway, basically, the way Python works is more or less like a traditional interpreted programming language
where you write your source code.
Python acts as a VM, reads the source code, parses it into individual tokens like
if and def and, oh, that's a plus sign and whatever.
And then that gets turned into what's called a concrete syntax tree,
which is kind of just like the way the grammar is written kind of nests things.
And this is how you get your priorities in terms of precedence,
like multiplication happens before plus, which happens before whatever.
And that all works out in the concrete syntax tree in terms of how it nests itself.
And then that gets passed into a compiler within Python that turns that into what's called an abstract syntax tree,
which is much more high level.
Like this is addition instead of plus and two things.
And this is loading a value.
And this is an actual number.
And this is a function call.
And then that gets passed farther down into the bytecode compiler, which will then take that AST and spit out Python bytecode.
And that's actually what's stored basically in your PYC files.
Actually, technically, they're marshaled code objects.
And then when Python wants to execute that, it just loads up those bytecodes and just has a really big for loop that basically reads through those individual bytecodes.
It goes, OK, what do you want me to do?
All right, you want me to load a const.
Const is zero.
And that happens to correlate to none in every code object.
So I'm going to put none onto what's called the execution stack because Python is stack-based instead of register-based.
So CPUs are register-based.
Stack-based VMs such as Python.
Java is another one.
It's fairly common because it's easier to implement.
Anyway, you can do stuff like load const none or load a number, load another number on the stack.
So the stack now has two numbers.
And then the loop might, the C eval loop for evaluation loop.
Yeah.
So it's worth pointing out to the listeners, I think, who maybe haven't gone and looked at the source code there.
When you say it's a big loop, it's like 3,000 lines of C code or something, right?
It's a big for loop.
Yeah, it literally is a massive for loop.
If you actually go to Python source code and you look in the Python directory, there's a file in there called ceval.c.
You can open that up and you will literally find nested in that file somewhere just a for loop with a huge switch statement that does nothing more than just execute these little byte codes.
So like if it hits add, what it'll do is just pop two values off of what's basically a chunk of memory where we know what's pointers are on the stack and just go, I'm going to take that Python object.
I'm going to take that Python object and execute the dunder add in the right way or the dunder r add and then make that all happen.
Get back a Python object and stick that back on the stack and then just go back to the top of the for loop and just keep going and going and going until you're done and your program exists.
Yeah, and you can actually see that byte code by taking loading up some Python module or function or class or whatever and importing the disassembly module and you can actually have it spit out the byte codes for like say a function, right?
Yep.
And I do this all the time on Pigeon, actually.
Basically, you can import the dis module, D-I-S.
And in there, there's a dis function.
So if you go dis.dis and then pass in any callable, basically, so function, method, whatever, and it'll just print out to standard out in your REPL all the byte code.
And it'll give you information like what line does this correlate to?
What is the byte code?
What's the argument to that byte code?
The actual byte offset and a whole bunch of other interesting things.
And the dis module documentation actually lists most of the byte code.
I actually found a couple of opcodes that weren't actually documented.
Now there's a bug for that.
But the majority of the byte code is actually documented there.
So if you're really interested, you can have a look to see actually how we kind of break down the operations for Python for performance reasons and such.
Yeah, that's really interesting.
And for the listeners who are wanting to dig deeper into this, on show 22, I talked with Philip Guau about his sort of CPython internals graduate course he did in the University of New York.
Have you seen his work?
No, I haven't yet.
He basically recorded 10 hours of a graduate computer science course studying the internals of CPython and spent a lot of time in cval.c.
And it's on YouTube.
You can go check it out.
So it's really cool.
So that's interesting.
Oh, I should probably actually answer your second question, too, about all the other interpreters.
Yeah, so let's talk about the interpreters.
As I said earlier, CPython is kind of, it's the one you get from python.org and kind of the one most people are aware of.
But there's actually a bunch of other ones.
So one of the more commonly known alternative interpreters or VMs or implementations of Python is Jython, which is Python implemented in Java.
So a lot of people love that whenever they have to write a Java app and want some easy scripting to plug in.
Or have some requirement that they have to run on the JVM.
Apparently, it's really popular in the defense industry for some reason.
Interesting.
Once you get a VM approved, you just don't mess with it, I'd say.
Yeah.
Well, and one really cool perk of this is PyCon, every so often there's a really cool talk about flying fighter jets with Python using Jython and stuff like that.
So it does at least lead to some really cool talks.
Nice.
And here's the afterburner function.
You just call this.
Exactly.
There's Iron Python, which is Python implemented in C#.
So that's usable from .NET.
So once again, it's often used for embedding in .NET applications that need scripting or anyone who needs to run on top of the CLR.
Those are the two big ones.
Obviously, in terms of direct alternatives, there's obviously PyPy, which I think a lot of people know about, which is two things.
There's PyPy, the implementation of Python written in Python, although technically it's a subset of Python called RPython, which is specifically restricted such that they can infer a lot of information about it.
So that can be compiled down straight to basically assembly.
And then there's PyPy, the tool chain, which they developed for PyPy, the Python implementation, which is basically this tool chain to create custom jets for programming languages.
So you can take the PyPy tool chain and not just implement Python in Python, but they've done it for like PHP, for instance.
And so you can actually write alternative implementations of languages in RPython and have it spit out a custom just designed for your language.
Those are the key ones that have actually finished in terms of compatibility with some specific version of Python.
All of them currently target 2.7.
PyPy has support for Python 3.2, but obviously that's kind of an old support in terms of Python 3.
And then there's the new up-and-comer, which is Piston, which is being sponsored by Dropbox.
And they're also targeting 2.7.
And they're trying to version a Python that is as compatible with CPython as possible, including the C extension API.
But what they're doing is they've added a JIT or using a JIT from LLVM.
So they're trying to make 2.7 fast using LLVM JIT and pulling as much of the C code and API as they can from CPython to try to be compatible with extension modules, which is a common problem that PyPy, IronPython, and Drython have.
Right. That one actually seems to be really interesting and have a lot of potential.
Because if you think of companies that are sort of Python powerhouses, Dropbox is definitely among them.
Yeah, it definitely does not hurt when Guido went to go work there as well.
And they have Justin McKellar there and several other people.
Benjamin Peterson works for them.
So they already have a couple of core devs and high up people in the Python community working there.
And their whole server stack in the back, I believe, is at least mostly Python.
Their desktop clients are Python.
They're definitely Python heavy there.
Yeah, absolutely.
So how does Pigeon relate to the thing that came to mind for me when I saw it announced was, you know, a friend of mine, Craig Bernstein, sent me a message on Twitter and said, hey, you have to check this out.
And I'm like, oh, that is awesome.
And it was just, you know, a Twitter message.
You know, check out this JIT version of Python coming from Microsoft.
Well, I don't know anything about it, but maybe it's like PyPy.
So what are you guys actually building over there?
What is this?
Pigeon was actually started by Dino Velen, one of my coworkers.
And I believe that I don't know if he's necessarily the sole creator, but definitely one of the original creators of Iron Python back at PyCon US 2015, which was in Montreal.
During the language summit, Larry Hastings, the release manager for Python 3.4 and 3.5,
got up in front of the core developers and said, what can we do to get more people to switch to Python 3 faster?
Because obviously we all think Python 3 is awesome and legacy Python 2 is fine, but everyone should get off that at some point.
Yeah, I hear you.
I agree.
So what do you do, right?
Yeah, that could be a whole other question on that one, Michael.
So he said, what can we do?
What can we do?
And he said, performance is always a good thing.
People always seem to want more performance, no matter how well Python does.
People are always hungry for more.
And Dino went, yeah, that's a good idea.
I know, I'll see.
.NET just got open sourced back in April 2015.
And he said, you know what?
I will see if I can write a JIP for CPython using Core CLR.
Because Dino also happened to used to be on the CLR team.
So he knows the opcodes like the back of his hand.
And so he started to hack on it at the conference and actually managed to get somewhere.
And he premiered it at PyData Seattle back in July when we hosted it at Microsoft.
And I got brought on to basically help him flesh out the goals.
There's basically three goals.
One is to develop a C API for CPython to basically make it pluggable for a JIT.
Like one of the tough things that people have always done, like Unladen Swallow started with and Pistons also doing, is they're directly tying into a fork of CPython, more or less, a JIT, which really tightly couples it.
But it also means that, for instance, if LLVM does not work for your workload for whatever reason, you're kind of just stuck and it's just not an option.
Well, we would rather basically make it so that there's just an API to plug in a JIT.
And then that way CPython doesn't have to ship with a JIT, but it's totally usable by a JIT.
And then that way, if LLVM or CoreCLR, which is the .NET JIT or Chakra or V8 or whatever JIT you want, as long as someone basically writes the code to plug from CPython into that JIT, you can use whatever works best for you.
That's really cool.
I think it's a super noble goal to say, let's stop everybody starting from scratch, rebuilding the CPython sort of implementation and weaving in their version of a JIT and saying, let's just find a way so that you don't have to write that ever again.
And you just plug in the pieces.
Yeah, exactly.
And actually, one of the other goals we have with this is not only developing the API, but goal number two is to write JIT for CPython using the CoreCLR and using that to drive the API design that we need that we want to push back up to CPython eventually.
But the third goal is actually to design kind of a JIT framework for CPython such that we write the framework that drives the coding mission for the JIT.
And then all the JIT people have to do is basically just write to the interface of this framework and don't have to worry about specific semantics necessarily.
So, for instance, you would be able to, as a JIT author, go, OK, I need to know how to emit an integer onto a stack and I need to know how to do add or add int.
But then the framework would actually handle going, OK, well, here's the Python bytecode that implements add.
Let's actually do an add call or, hey, I know this thing is actually an integer.
Let's do an add inc call and not just a generic Python add and be able to handle that level of difference so that there's a lot less busy work that's common to all the JITs like type inference and such and be able to extract that out so that it's even easier to add a JIT to CPython.
So is that like two levels?
Like on one hand, you have a straight C API at the CPython level and then optionally you could choose to use the C++ framework that makes it so you do less work and you plug in your sort of events or steps?
Yeah, exactly.
It's getting the bare minimum into CPython so that CPython at least has this option without everyone having to do a fork and as well as pushing down a level to a separate project where the common stuff is extrapolated out and everyone can just build off the same baseline.
And then only thing that has to really differ is what's unique to the JITs.
And then that way, everyone's work is as simple as possible to try to make this work.
OK, that makes a lot of sense.
This episode is brought to you by Hired.
Hired is a two-sided, curated marketplace that connects the world's knowledge workers to the best opportunities.
Each offer you receive has salary and equity presented right up front and you can view the offers to accept or reject them before you even talk to the company.
Typically, candidates receive five or more offers within the first week and there are no obligations ever.
Sounds awesome, doesn't it?
Well, did I mention the signing bonus?
Everyone who accepts a job from Hired gets a $1,000 signing bonus.
And as Talk Python listeners, it gets way sweeter.
Use the link Hired.com slash Talk Python to me and Hired will double the signing bonus to $2,000.
Opportunity's knocking.
Visit Hired.com slash Talk Python to me and answer the call.
Would you still be able to support things like method inlining and things like that with the C++ framework?
We don't know yet, but there's technically no reason why not.
What's actually really interesting is we started all this work and we actually weren't ready to premiere any of this yet.
We've been doing this out in the open on GitHub.
But as you mentioned, Michael, people started to tweet it and then it made it to Reddit and then it made it to Hacker News.
And suddenly everyone's asking questions and stuff.
But in the middle of all this, there's been a lot of work literally the past, I don't know, maybe two months of various core developers putting in a lot of time and effort trying to speed up CPython itself.
And part of this is actually trying to cache method objects so that they can get cached in the code object and actually not have to, every time you try to execute like a call by code,
not have to go to like the object, pull out the method object and then call that, but actually just cache the method object.
I already have it.
I don't need to re-access that attribute on the object.
And so it's already starting to bubble its way up into CPython.
And there shouldn't technically be any reason why we can't just piggyback off of that and just go, oh, well, they've already cached this or use a similar technique of basically,
if the object hasn't changed, I really don't need to worry about previous versions of this being different.
So I can just cache it and reuse it and just save myself the hassle of having to get a method back.
Or same thing with built-ins, right?
Like if you ever want to call len, some people cache it locally for performance.
But the work that's going on is actually going to make that a moot point because it's going to start to notice when the built-ins and the globals for your code have not changed.
And just go, well, I've already cached len locally because I already know I've used it previously.
So I might as well just pull that object immediately out of my cache instead of trying it in the local namespace, not having it there, going to the global namespace, not having it there, then going to the built-in namespace and having to pull out len again for every time through a loop, for instance, and call that.
Yeah, that's really great.
And I suspect you could just say, here's the JIT compiled machine instructions.
Just cache that or something like this.
Yeah, exactly.
So a lot of this work that's happening directly in CPython bubbles down both directions into helping JITs in various ways, right?
Like this whole detecting what state a namespace is from the last time you looked at it.
Has it changed at all or not?
That's probably going to end up in CPython itself as an implementation detail.
But it also means all the JITs will be able to go, oh, look, the built-in namespace hasn't changed.
So that means if I've cached len, I don't need to worry about it being changed.
I don't have to pay for a dictionary lookup.
I can just pull it right out of my array of cached objects and just go with it.
Okay.
Yeah, that sounds like it'll be great regardless of whether you're talking about a JIT or just running your code, right?
Yeah, no, it's going to be fantastic.
Everyone's going to win on that one.
Yeah, that's cool.
One of the things that I think is surprisingly slow in Python is calling methods, right?
Yeah.
It's more expensive maybe than it should be.
What other stuff kind of falls into that class that you can think of?
So the reason, just to give an explanation of why that's so slow, is if you look at what you can do with a method or function call,
Python's got a really rich set of semantics, right?
We have positional arguments.
We have keyword arguments.
We have star args and we have star star kwrgs.
We have keyword only arguments in Python 3.
I mean, they're default values and not.
There's a lot of different ways to try to build this stuff up into something that we can use to call a function with.
And some of them are really, really safe.
Right.
And maybe even closures as well, right?
On top of that.
Yeah.
Actually, luckily, that's not actually too costly for the actual call.
It's just when it comes time to look up the value, you've got to work your way up.
But that kind of ties into it, right?
So that's the other kind of expensive thing you have to do in Python is there's the cost of making a call itself because it just takes so much effort to build up what all the arguments should be.
And then there's the cost of just looking up the method or the function, right?
Because as you mentioned, there's closures.
So you have kind of this, you have local scope.
You have this potential closure scope, which are like sole variables or free variables.
If you're the guy calling out, you've got your global namespace.
You've got your built-in namespace.
And then that's on top of whether or not you've defined like a thunder get adder at method on your object.
This is going to have its own set of code to call to try to figure out what the heck you want, whether it can get it for you.
And that's the other real expense is trying to basically access attributes, which methods happen to be.
So that's one of the reasons that the calls can be so expensive.
It's not just the cost of getting the object, but it's also the call itself and just basically preparing for it.
Okay, interesting.
And this caching in CPython, you know, putting Pidget aside for a moment, that would make a big difference?
Yeah.
Yuri, I'm going to butcher his last name, so I honestly don't want to try.
Initial.
Yuri, you're center of law, I think.
Yeah.
Yuri, I believe it's Y.
I believe he lives in Toronto, actually.
He has actually developed some new opcodes.
For instance, load method and call method, which directly by themselves.
have a slight performance perk because they kind of skip some steps.
You typically have to make a method ready.
But Yuri's also been the one working on this caching stuff, building off of Victor Sinner's dictionary versioning.
And what he's doing is with his call methods and load methods, he's basically grabbing the unbound methods and sticking them on stack and just calling them directly without doing some extra work.
But with the caching, that thing he sticks on the stack, he can actually squirrel away and say, hey, next time I come to this call method or load method, I can just pull it right out of this cache as long as stuff hasn't changed in the namespaces above me.
And that's how he's trying to make method calls cheaper.
It's basically storing away the method object and fetching it right back if he can make sure for a fact that nothing has changed since last time he tried to get that object out.
Okay, that's awesome.
What's the time frame?
Any ideas?
Is it still just experimental or?
That's a good question.
So there's a pep.
So Victor Sinner has started what he's called Fat Python, F-A-T.
You can Google for that.
I'm sure you'll find it.
He currently has three peps, actually.
Pep 509 handles dictionary versioning, which is important for namespaces and caching.
Because you need to know if something like in your global namespace or your built-in namespace or even your local namespace has changed because all namespaces in Python or dictionaries, which is why you can introspect so much.
5.10 is adding guards to bytecode so that he can do stuff like add a guard saying, hey, if globals hasn't changed and built-ins hasn't changed, use this cast version of len.
This is before Yuri's stuff had started.
And then he's implemented PEP 5.11.
He's trying to add, actually, API for doing AST transformations so that you can basically plug in custom AST transformations to go like, well, if you're doing a number plus a number, we can just make it a number and skip the plus.
As of right now, PEP 5.10 and 5.11, I don't know where they're headed quite yet.
But 5.09 seems to be fairly well accepted.
And it's just a question of Victor finalizing the PEP and the design exactly and getting accepted.
So I really don't see any reason at all why that won't make it into Python 3.6.
And Yuri's stuff, he's already got patches and has benchmarked it and showed it working.
And there's some discussion about whether or not his current approach is the best or not.
But I personally don't see any reason why any of this won't make it in 3.6 either.
3.6.
Okay.
That's pretty excellent.
That's not too far out.
Yeah, no.
I think what we're due to hit beta in September.
So as long as you can get it, all this can wrap up by then.
It'll all land in Python 3.6.
And I should mention all this stuff is looking like Yuri's stuff, I think, is adding up to
between 5% and 10% across the board speed up improvements.
And depending on how your code looks, I think you're seeing up to 20% faster.
So definitely wins.
Yeah, that's a really big deal.
Okay.
Awesome.
I want to talk about the core CLR a little bit.
But before we do, you said something that I didn't expect you to say when we were talking
about jitters and plugging in jitters.
And that was V8 or Chakra.
That is awesome.
So somehow we could plug in the JavaScript engine from Chrome V8 or the one from IE and
Edge.
What would that look like?
We haven't really explored it yet, but it's definitely an idea we had.
Actually, before Chakra went open source, the Chakra team reached out to Dino and said,
hey, we think this might be useful to your project.
The thinking is, because JavaScript is as dynamic as it is, and all these jets have to be designed
to jit quickly, because obviously, if you're in your browser, no one wants to wait for their
favorite web-based email client to start running.
So they're really fast at the start.
But they also have to handle dynamicism really well, because JavaScript, just like Python,
can easily have attributes added and removed and changed at any time.
And so they have to be really flexible in terms of how they handle that kind of workload.
While Core CLR obviously does its best to be a really good all-around jit, obviously, it's
heavy uses like F-sharp and C-sharp and more static-based languages.
The thinking is that if we try to use a jit that worries about a language that's as dynamic
as JavaScript, we should be able to actually piggyback on all that work and actually have
a jit that works really well for Python, because it's already designed to deal with all the
dynamicism a programming language like Python and JavaScript have.
That's super interesting.
And I think if you have two distinct examples working against your API as different as the
CLR and JavaScript, you'll have a pretty robust API, right?
Yeah.
And that's the other thinking, too, is we want to get the Core CLR version done and passing
all of the Python test suite as much as reasonably possible so that we can go, OK, our jit framework
that we've designed to help drive these jits covers all the possible edge cases and basically
is good enough that if you implement these things in a reasonable fashion, you will get Python
compatibility.
And then that way we can just plug in and make sure that all this stuff just works both in
two completely different jits targeted to different types of languages and have it just all fall
through.
And honestly, it's a nice way to do performance comparisons for what kind of jit would probably
work best for Python.
Awesome.
That sounds like a really good idea.
I've done a fair amount of work with C# and the CLR.
And I know what the Core CLR is, but I suspect most listeners, when they hear .NET, they think,
oh, it's a Windows thing.
But you guys actually are doing quite a bit of different stuff now that Satya's in charge.
There's kind of a new mandate, right?
So tell people about the Core CLR.
I believe it was last year.
It was before I joined Microsoft this past July.
Basically, all of .NET was open sourced.
So previously, it was all this closed source thing that was very Windows only, except for
Mono, which kind of initially reverse engineered a bunch of things.
And then Microsoft said, oh, you know, well, we can at least open source, like I believe,
like the test suite and some other things for you to test your compatibility.
But Satya Nadella, as CEO of Microsoft, is really pushed for open source of Microsoft,
both its use, but also contributing and doing things in the open, both as in starting projects
from scratch that Microsoft has done in open sourcing those and also giving back to pre-existing
open source projects.
And one of the things they did was they completely open sourced .NET.
So .NET actually, I don't know if they've done the official release yet, but if you look at
least their digital integration tests, they're passing on Linux and OS X on top of Windows.
For instance, Pigeon right now is Windows only purely because of momentum and laziness on
Dnomi part.
And it has nothing to do with using Core CLR because Core CLR uses like CMake for its builds.
So it's already got a cross-platform build scripts set up and all that.
It's just basically Dnomi for Pigeon.
Haven't bothered to write the Visual Studio solution file in CMake to be able to run it on
Linux or OS X.
I think that's going to breathe a lot of new interest into sort of the whole CLR and
the C# side of things from people that are just saying, look, Windows is not an option
for whatever reason for us.
Yeah.
And I really hope it does, too, because I did Java development at Google.
And honestly, I like C# a lot more.
Microsoft has done a really good job of shepherding that language forward and continuously evolving
it.
Well, I don't think Oracle has done such a great job with Java.
And C# has just done a better job of going forward continuously.
I mean, C# has local type difference.
This is not new technology to this day and age.
And C# has it.
And yet Java still doesn't have it.
It always drove me nuts.
I mean, bloody C++ has local type difference and C++ has been using auto.
And yet Java still doesn't have that kind of stuff.
And it's always kind of buckled my mind that unless you use generics in Java, you can't
like leave out a type.
So I really do hope the open sourcing of Core CLR and it being available on Linux and OS X on top of Windows is really going to get more people to really take serious look at C# and F Sharp.
Absolutely.
And it definitely makes it your project absolutely broadly applicable to all the Python guys.
Right.
Because if for some reason you said it's kind of like Iron Python, it's this really cool implementation of Python on .NET, but it's just tied to Windows, right?
That would really stifle it.
But the fact that it's starting out with a base that could be on any of the major platforms is cool.
This episode is brought to you by SnapCI, the only hosted cloud-based continuous integration and delivery solution that offers multi-stage pipelines as a built-in feature.
SnapCI is built to follow best practices like automated builds, testing before integration, and provides high visibility into who's doing what.
Just connect Snap to your GitHub repo and it automatically builds the first pipeline for you.
It's simple enough for those who are new to continuous integration, yet powerful enough to run dozens of parallel pipelines.
More reliable and frequent releases.
That's Snap.
For a free, no obligation, 30-day trial, just go to snap.ci slash talkpython.
Technically, I'm on the data science tools team in data and analytics in cloud and enterprise at Microsoft.
And Azure supports Linux, right, on top of Windows.
So it'd be really silly of us to develop something that only part of our client base could use, right?
We want to get Pigeon such that you can use this on your Azure apps or, as I said, in data analytics, and that includes Azure machine learning.
So we have this thing called Azure ML Studio where it's this whole drag-and-drop machine learning system in the browser.
It's really cool.
And you can actually use Python code to, like, transform data and actually run analysis on it and do all this cool stuff.
And because it's machine learning, it doesn't happen necessarily in one second.
It can take 30 seconds or five minutes or half an hour or whatever.
These workloads take enough time that a JIT would be really, really beneficial.
So it makes total sense both from Azure ML but also just Azure in general to support multiple languages.
So it just would honestly be stupid of us not to try to support more than just Windows because we'd be leaving out part of our client base.
And that's just not how you win users.
It's definitely not.
So I have a couple of questions about maybe, like, the future, what the future might hold in a Pigeon type of world.
I've been thinking about kind of what you guys were talking about in what does it take to dramatically move people into Python 3.
Performance is good.
20% increase in performance is really good, like we were talking before, and those types of things.
But what would really sort of hit people in the face and go, yeah, this is different?
And I think better threading is possibly number one, like removing the global interpreter lock in some way.
Does this at all touch this concept?
No, because Pigeon and the JIT API were trying to design.
One of the key things is we're trying to be compatible with extension modules, C extension modules.
Because that's always been a big limitation of PyPy, right?
Like if you write C code and interface using CFFI, that will get you a C extension module for Python that works in both PyPy and in CPython itself.
But unfortunately, that requires getting people to use CFFI, which is a great project, by the way.
And I do encourage people to consider that next time they need to wrap some C code.
But there is also a lot of pre-existing C extension code.
I mean, this is why PyPy, for instance, before they created CFFI, started to write NumPy from scratch in our Python.
That's their NumPyPy project.
You guys definitely don't want to get down that path.
Yeah, exactly, right?
We're trying to avoid that completely.
The problem is extension modules are designed around the concept of the GIL, right?
The way garbage collection works in Python is reference counting.
And all the C code works with the assumption that that's how it works and stuff won't magically disappear.
If you don't decref Python object at the C level, it will stick around.
So if you get it and then increment that reference count and just leave it incremented until you're finally done with it at the very end, that will guarantee that the object isn't garbage collected.
And there's just a ton of assumptions in the C code.
This is not just Python itself, but any third-party C code.
And so getting rid of the GIL without breaking, basically, the world of C extension modules would be very difficult.
So I get where it all comes from, people's desire to get rid of the GIL.
I do think some people get a little huffy about it when they really don't need to.
I mean, if you do any I.O., it really doesn't matter.
It's only when you're CPU-bound does this ever even come up.
Yeah, absolutely.
But I do get why people do want faster.
And if you're doing like – I know this comes a lot from the scientific Python community.
If you're doing a lot of CPU-bound stuff, you really want to not have to have the GIL, right?
And we get it.
It's just one of these rock-in-a-hard place where the rock is CPU performance, but then the hard place is all the backwards compatibility with all the pre-existing C extension code.
Right.
Like, hey, we have this really fast thing.
Oh, but you can't use all the stuff that you want to use.
So you can start from scratch there, right?
Yeah, exactly.
Like, it's like going to the scientific Python community and going, okay, you can't use NumPy and possibly scikit-learn, although that's written in Scithon, so they at least have a chance.
But like, NumPy would not work.
You okay with that?
I don't really see that going down very well.
Yeah, we tried that with Python 2 and Python 3, kind of.
Yeah, exactly.
It hasn't gone down so well.
Exactly.
Or look at NumPy, right?
Where they just –
Yeah.
NumPyPy isn't fully compatible.
So it's like, hey, scientific community, you want to run on PyPy?
It's like, do you have NumPy?
No.
I'm not so excited anymore.
Maybe sometimes for some things.
So it's a really tough position to be in where people ask for this without realizing that the ramifications of the community, right?
And as you pointed out, Michael, we've done this once with Python 2 and 3, right, where we said, okay, for the benefit of the community, we are going to break backwards compatibility.
And there's totally a way to write code that works in Python 2 and 3.
It takes some effort.
It's not like going from Python 2.6 to 2.7.
There's actually some effort that has to be put in.
And we've paid a price for it.
Now, I don't regret the decision, but it does bring up to the point that does the community really want to put up with this again at the C level?
And I don't know if they do, even if it does get them a gill-free life.
Now, I'm sure some people are going to say, God, yes, I will totally rewrite all my C extension code to completely ignore whatever it has to and change however it has to to get around the GIL.
But the question is, what solutions we have that would help migrate existing code and would it be reasonable?
And I simply just don't have an answer to that.
Okay.
Well, that's, I think, a really interesting sort of both sides of the debate to think about for the listeners to think about when they talk about that topic.
So, with Pigeon, is it too soon to ask about performance or anything like this and how that's looking?
Or?
You can always ask the question, Michael.
I just can't always give a good answer.
Any news there?
Or you're just not fully baked yet?
The current update on that is, I'll give two updates.
I'll give one on compatibility and one on performance.
I'll start with the performance.
It's not bad, but it's not better.
But this is out of date information, although I don't see it having changed much.
So, back in November, I was lucky enough to be invited to give the opening keynote of Pigeon Canada.
And the video is up on YouTube.
And so, you can find that if you want.
But basically, I did a survey of all of the – an unscientific survey of Python interpreters.
And I basically listed the history of all the different implementations of Python over the decades because Python is 25 years old.
I benchmarked everything because it had been a little while since someone had benchmarked all the interpreters.
And I included Pigeon in it because I was curious because we hadn't really done any benchmarking.
In general, some things were faster.
Some things were slower.
The median across all the entire Python benchmark suite was slightly slower than Python 2.7.
But if you looked at the geometric mean, it was actually faster.
But it was all within not a huge jump between the two.
And I think we were still faster than, for instance, Jython or IronPython.
The performance isn't bad.
It's kind of maybe on par or a little slower.
But this is with, like, zero optimizations.
Yeah.
So, my follow-up question was, if you're already sort of tied and you've not done a ton of optimization, that's actually a really good place to be.
Yeah, exactly.
That was one of the key metrics we wanted to hit initially was, okay, can we get to compatibility and not have performance suck, more or less?
And use that as kind of a showing that, okay, this is not a waste of my time and Dino's time to pursue.
That it's actually going to be worth all of this effort.
And that there's actually a chance that this is going to pay off and actually be useful.
And I will say that as of yesterday, we are more or less compatible with CPython minus supporting tracing, profiling, and anyone who touches sys.undergetframe.
So, we basically are – we're actually fairly compatible now.
Yeah, that's really good, actually.
Yeah.
There were some hairy bugs in there.
But Dino deserves a lot of the credit in figuring out how to fix most of the bugs.
We actually have a text file in our tests directory that lists the nearly 400 tests that Python 3.5 has.
You can look at it to see what's left to do.
But most of them are actually profiling-related or tracing-related.
There's one or two that are dealing with actually an odd semantic compatibility that we think probably needs to get changed actually upstream in CPython itself.
But otherwise, everything seems to be tracing-based, profiling-based, or using sys.getframe.
Basically, stuff that would slow everything down anyway if you use.
So, if you're using UGIT, you're probably not going to want to touch that stuff anyway.
So, yeah, we're actually pretty happy.
And we think we're more or less compatible at this point, or at least enough to be willing to go to PyCon and say, we're basically compatible.
You should give us a shot.
If performance ends up being good by then.
Okay.
That's a really good start, I think.
Yeah, we're really happy that we've managed to hit this compatibility spot now because we proposed a talk at PyCon.
Obviously, we don't know if it's been accepted yet.
But our hope is to, now that we've hit compatibility, to try to spend the next two, three months trying to ramp up performance somewhat and seeing how far we can get.
And whether we can more consistently either match or actually start beating Python 3.5 somehow.
Right.
Interesting.
Do you feel that CPython itself is getting better because of the pressure that you're putting on it from this slightly different use case?
I don't think it's really coming from us.
I think it's coming from all the core devs who are honestly a little tired of people dragging their feet, switching to Python 3.
We realize that we can give so many carrots in terms of features and stuff, but you kind of have to be inspired to come up with a new feature.
And actually, there's a really cool one I can talk about if you want coming in Python 3.6 that I think a lot of people are going to love.
Yeah, tell us.
Eric Smith has implemented something we're calling format strings or f strings.
So if you take a string constant and prefix it with f, you can use the formatting that you use with str.format, except you don't have to make the format call.
And you can specify the name of a variable and it will directly do string substitution.
So if you did spam equals 42 and had a string constant starting with f and then said, my cost is, and then curly brace, spam, close curly brace, and that was it.
No format call or no percent, no whatever.
And you execute that in Python 3.6, it'll actually turn that string into my value is 42.
Okay, that's pretty awesome.
That sounds a little bit like the Swift string interpolation or what C# 6 adopted after that as well.
Yep.
Same basic idea?
Yeah, exactly.
What's even cooler about it is beyond the fact that it keeps almost full compatibility, there's an edge case that I don't remember off the top of my head of the substitution.
But basically, it works exactly the same way as str.format.
But what's really cool is Eric implemented a new bytecode for it.
So it's actually faster than str.format and faster than using modulo, the percent sign for string interpolation.
So it's actually going to be the fastest way to do string interpolation in Python.
All right, so I asked about the gill, you know, and that was really an interesting answer.
Thanks.
Are there other advantages that this type of JIT API might bring that I'm not thinking of or that are not entirely obvious?
Beyond just raw performance increases with compatibility with C extension modules, not specifically.
Basically, as I was not so eloquently saying earlier, we realize to get people to Python 3, we have to add.
We can add new features, which is one form of a carrot, but it requires inspiration to come up with those new features.
The other way to do it that doesn't require any inspiration because everyone always wants more is to improve performance.
And hence, this is why Dino decided to give this a try at PyCon last year, and it's looking like it's going to pay off.
But this is also why, for instance, Victor Stinner is putting all this effort into it for Red Hat and why Yuri, for his own consulting company, is putting all this time.
It's basically just people really like fast.
And if we can give them fast, we hope that it gives people more ammunition to go to their managers and say, look, Python 3 is faster than Python 2.
We should put in the effort.
We're going to get a performance when it's worth it.
Because I did a blog post on this where I compared the five stages of grief to the five stages of the Python 3 transition for the community.
Everyone seems to at least be at the depression stage, which is stage four.
And then some people have been lucky enough to get away to stage five and have moved on to Python 3 and are realizing how much nicer it is and all that.
But those who are stuck in the depression stage are usually people who work at corporations where they've just been told, eh, we don't see enough of a win.
And I don't want to put any time and effort into our resources into getting our code to move to Python 3.
Right. It might be better.
But the manager who makes that decision doesn't want to possibly bear the burden of saying, yeah, we decided to switch.
But now we can't release our app for six months because we're actually not as quick at converting or something.
Right. It's just it's easier to just do nothing.
Right.
Yeah, exactly.
And for me, it's a little frustrating because I put a lot of personal time and effort in back in the summer, fall of 2014 to make porting a lot easier.
And it can be done file by file.
Right. I think one of the big problems is people feel like they have to port their entire code base at once and they really don't have to.
Like there's still people out there who think two to three is the cutting edge of porting Python to code to Python 3.
And it's not at all. I don't even recommend it.
If you go to docs.python.org, there's a how to section and there's a doc in there that I wrote that explains the current best practices for porting your code from two to three.
But basically, you can write your Python two to three code that's compatible in both versions and you can do it file by file.
You don't have to do this huge, massive, let's change everything.
But the deal and that's great for the engineers who understand like, oh, hey, you know, like having tracebacks put in exceptions and having chained tracebacks in your code so that when you trigger an exception, you can actually see that, oh, this exception was caused by this exception, which was caused by this exception is really useful.
But you might not be able to sell that to your manager.
But if you can tell your manager, hey, you know what?
If we switch Python 3.6 is looking to be 10, 20 percent, whatever, faster than Python 2.7, that's a real performance one that allow us to handle X number more requests per second with no new hardware.
If we just put the time in to move our code over, wouldn't that be fantastic?
That's hopefully an easier sell for some of these companies.
I feel a little bit like boiling the frog, you know, the analogy of you guys keep adding awesome new stuff every time and it's just getting cooler and cooler.
But there's not that jolt that goes, oh, yeah, we have to go now.
Right.
It's just been so, so sort of smooth.
Yeah, exactly.
Then to give the job adding new features slowly over time instead of like hiding them in our back pocket and then suddenly springing them on communities like, hey, look, all this new stuff.
That darn open source.
People keep figuring out what you're up to.
That's when the stick of 2020 comes in, right?
Of like, all right, legacy Python 2 being supported by the core developers for free is going to go away.
So either port your code if you want free support or go pay someone like Red Hat or Canonical to support your install of Python 2 because it ain't going to be free anymore.
Yeah.
So do you want to pay, basically, do you want to pay Red Hat in 2020 to support your Python 2 code or do you want to pay your own engineers now to move to Python 3?
And then it becomes a cost analysis.
Yeah, and get all the benefits now.
2020 sounds so far away, but it is actually 2016.
I mean, that's only four years.
That's not really that far for a large code basis.
Well, and the other thing I'm afraid people aren't thinking of is like, oh, 2020 is not that far.
I'll start in 2020.
It's like, no, no, you need to finish your transition by 2020.
It's not start in 2020.
It's done by 2020.
Exactly.
So it'd be better to start sooner rather than later.
And I mean, there's still stuff being done to make the porting user.
For instance, the type hints that Guido's added in Python 3 and is backported to Python 2 using mypy at Dropbox.
He's hoping to make it so that if you add this typing information, they'll be able to develop a tool to help warn you statically offline that, hey, this code, while it's fine in 2, is kind of questionable and iffy in 3.
And you might want to tweak it so that there's no question of compatibility so that when you run this code under 3 in the future, it'll be okay and you won't have any issues.
So there's even still tool work being done to make it easier.
Yeah, that's really interesting.
Yeah, the real problem is that people are still running new code that's 2 only instead of going like all new code should at least be 2 and 3 compatible.
Because if you do that, then at least your problem is like set and it's not getting any worse.
But it's still writing all your code in 2.
You're just making your problem worse and worse as time goes on.
So this is why I always, whenever I give talks on Python 3, I always go, okay, I want you to go home and I want you to do two things.
Don't write any more new Python 2 code.
Only write Python 2 code that will work in 2 and 3 and then slowly start pointing your code over to 3.
File by file.
I'm not expecting everyone to do their whole code base, but at least start.
And at least getting the practices in place, like adding the future statements or running pilot with the --py3k flag to get some of the warnings.
If you run Python 2, make sure you run it with the dash 3 flag so you get py3k warnings out of the interpreter.
I mean, there's a bunch of stuff you can do that you can just integrate as part of your serious integration or day-to-day practices and just will make your life easier when you finally do get to flip the switch.
It doesn't have to be all shut down the app in six for six months while you do the port.
It's like, no, just spend a little time anytime you tweak some code to make it more compatible and just you'll slowly work your way forward.
Because otherwise, you just make it that much more of a burden in the future.
That's really good advice.
I think, you know, if you find yourself in a hole, the first step to get out of it is stop digging, right?
Exactly.
And I suspect it's a little easier sell if you don't necessarily tell management that we're going to support Python 2 and 3 with new code and slowly fix things as we fix bugs.
You just institute practices of, oh, okay, we are going to now run Python 2 with the dash 3 flag in our continuous integration tests.
We're going to use PyLint to actually check for errors.
And we're just going to start fixing up where we're really kind of ambiguous, whether we're working with binary data or textual data, so that we know exactly what needs to support Unicode and what needs to support bytes.
And you can just do it slowly over time and just make it slowly easier until you go, okay, Madge, but look, we already support it.
Or can we just have like a week or a month or however much time you think you need to get over that last hump and get done?
Right.
Well, you know, maybe as we get closer to 2020, the 20% time concept maybe could be applied as well.
Like, look, we're not going to stop and just do the switch, but, you know, just dedicate some of our time.
Like Friday afternoons is like whatever, you know, as a team.
And eventually you'll get there, right?
Yeah, no, exactly.
Cool.
So we're kind of getting closer to the end of the show.
Let me ask you just a few more questions.
There's an interesting story how the name Pidgin came to be.
Can you tell me like what that's sort of derived from?
As I said earlier, Dino started this project just on kind of basically a whim after being inspired.
Like, oh, what can I do to make Python 3 faster to get people to switch?
And he wanted a name that somehow involved Python and Jet.
He came up with Pidgin, which is spelled P-Y-J-I-O-N.
It throws everyone for a loop until Dino or I tell them it's pronounced Pidgin.
At least that's how we expect people to pronounce it.
But then again, I'm kind of used to it.
For instance, people always mispronounce PyPI.
The Python package index, the abbreviation is P-Y-P-I.
And it's pronounced PyPI.
But I've heard so many people call it PyPy, Hippie, PyPy, PP.
I've heard every different way of saying it.
And I'm just going to tell your audience, it's PyPI.
Or call it the cheese shop, which was its original name until some people were too worried that pointy-haired managers would not take Python seriously back in like 2005.
And we renamed it the Python package index.
No, that's awesome.
And by the way, cheese shop.python.org does work.
And it will redirect you to PyPI.python.org.
Yeah, yeah.
Very cool.
Two other questions.
If you can go write some Python code, what editor do you open?
I'm actually currently opening Visual Studio Code or VS Code.
I have very little allegiance to code editors.
I totally jump around constantly.
I learned Vim way back in my undergrad days.
And I used that for a long time.
But I've tried Eclipse.
I've never really went anywhere.
But I did try it.
I was a TextMate user for quite a while until updates kind of dried up.
And then I ended up switching to Sublime, especially when Sublime 3 beta came out using Python 3.
And it's like, all right, I can throw a couple bucks this way to support someone going out on a limb and going with Python 3.
But then their updates kind of slowed up a lot.
And then I used Atom for a while from GitHub.
I was using that.
And I actually still do whenever I do Dart development.
I joined Microsoft.
And Microsoft released VS Code.
And we actually announced.
Which is not the same thing as Visual Studio, right?
No, not at all.
So Visual Studio is an integrated development environment, right?
It's a full-fledged IDE.
It does everything.
And if you like IDEs, it's actually really great.
It is Windows only, though.
And it is an IDE.
And I'm personally a code editor kind of guy.
Like, I like separate tools.
Like, I will have a command.
Like, I will have Git Bash open to do my own Git work.
I don't need an IDE to give me a fancy tree view of all my branches, for instance.
I like having a separate code editor.
And VS Code is more like Atom than it is like Visual Studio.
But it is from the same team of Visual Studio.
So it's from a team that's been doing code editing and IDE development for basically decades.
So there's a lot of wealth of knowledge there for the design of it.
And we've actually announced that my team, which is in charge of Python tools for Visual Studio, which is actually a really cool plugin, which lets you do crazy stuff like debug across Python and C code and other stuff.
We're actually in charge of adding Python support to VS Code.
Oh, that's cool to hear.
Yeah.
We don't have a timeline or anything like that.
But my manager announced it on Hacker News.
So I can talk about publicly that we've been put in charge of doing that once we get around to it.
And we're actually hiring for that kind of stuff.
Python jobs at Microsoft.com.
Very cool.
If you want to work in Ruby.
Yeah, there's a lot of stuff going on with Python around there.
More than people might think these days.
Yeah, exactly.
So I'm actually using VS Code because I want to make sure I fully understand it for when we do development with it and know where we need to add stuff in and be familiar with it.
So that I can either contribute to the project or at least be an internal tester of all the stuff we have.
Right.
An advisor.
Very cool.
So the other question is on PyPI, there are many thousands of packages.
Everybody has their own sort of favorite that a lot of people don't have experience with.
What's yours?
I'm going to cheat.
And I'm going to say PyPI.
I think it kind of goes a little unnoticed that you hear people complain about the state of packaging in Python and all that on occasion.
But I don't know if people truly realize how organically grown it is, which is partially why it's taken so long to get stuff straightened out in it.
But also how difficult of a problem it is and how useful it is to have PyPI.
I remember back starting with Python when people would ask, what's Python or is that the language with the white space?
And so this is back in the day when CPAN was a big deal.
And I had to longingly look at Perl and like, oh, my God, they have the central repository for all their projects.
This is amazing.
And then Richard Jones and Martin Lewis at PyCon 2005, I think, maybe earlier, did PyPI.
And suddenly we had this central place where people could upload their own packages and it wasn't manually maintained.
And so we had this index.
And I think it was a real boon for the community because suddenly there was a single place to find your code and fetch your code and just keep track of stuff.
And so I would say PyPI and actually specifically the sequel of PyPI that's actually being developed right now called Warehouse, being led by Donald Stuffed of pip fame.
That would probably be my project of choice because that's going to be a big deal.
And he actually is working with someone to actually do user experience design on it.
And it looks really sharp.
And actually, if you want to help contribute, they're taking contributions.
So I believe if you search for PyPI warehouse or maybe if you go to GitHub.com slash PyPA, which stands for the Python Package Authority, there should be a warehouse repo.
And you should be able to take a look at what the next version of PyPI is going to look like.
Oh, that's a very meta, but a very good answer.
Thanks for that.
All right, Brett.
It's been super interesting.
I've really learned a lot talking about all the internals.
And I wish you guys a lot of luck with this project.
It seems really promising.
Yeah.
Well, thanks a lot, Michael.
I really hope it works out.
And thanks for having me.
I'm actually a listener.
So I feel really honored to be on the podcast.
You're absolutely welcome.
It's been great.
Thanks so much.
Talk to you later.
This has been another episode of Talk Python to Me.
Today's guest was Brett Cannon, and this episode has been sponsored by Hired and SnapCI.
Thank you guys for supporting the show.
Hired wants to help you find your next big thing.
Visit Hired.com slash Talk Python to me to get five or more offers with salary and equity
right up front and a special listener signing bonus of $2,000.
SnapCI is modern continuous integration and delivery.
Build, test, and deploy your code right from GitHub, all in your browser with debugging,
Docker, and parallelism included.
Try them for free at Snap.CI slash Talk Python.
And do check out my video course I'm building.
The Kickstarter is open until March 18th, and you'll find all the details at talkpython.fm
slash course.
You can find the links from this show at talkpython.fm/episodes slash show slash 49.
And be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes and direct RSS feeds in the footer of the website.
Our theme music is Developers, Developers, Developers by Corey Smith, who goes by Smix.
And you can hear an entire song on talkpython.fm and find links to all of his music on SoundCloud.
This is your host, Michael Kennedy.
As always, thank you so much for listening.
I really appreciate it and hope you enjoyed it.
Smix, take us out of here.
Outro Music.
you