No Python announcement of 2022 was met with more fanfare than PyScript.
This project, announced at PyCon, allows you to write Python files and run them in your browser
in place of JavaScript or even with interactions between Python and JavaScript.
There's just one catch. The runtime download was a 9 megabyte WebAssembly file.
That made its use quite limited.
On this episode, we dive into some news that might change that calculus.
The MicroPython and PyScript folks have been teaming up to get PyScript running in the browser on MicroPython.
Yes, that's the embedded chip Python that you may have heard of.
And here's the good news.
MicroPython's WebAssembly is just 300k to download and loads at under 100 milliseconds.
Now that could unlock some real possibilities.
We have Brett Cannon, Nicholas Toleve, and Fabio Plager on the show to discuss.
This is Talk Python to Me, episode 391, recorded November 21st, 2022.
Welcome to Talk Python to Me, a weekly podcast on Python.
This is your host, Michael Kennedy.
Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython,
both on fosstodon.org.
Be careful with impersonating accounts on other instances.
There are many.
Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
We've started streaming most of our episodes live on YouTube.
Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming
shows and be part of that episode.
This episode is brought to you by the Local Maximum Podcast over at LocalMaxRadio.com
and AWS Insiders Podcast.
AWS is changing fast.
Listen in to keep up over at talkpython.fm/AWS Insiders.
Transcripts for this episode are sponsored by Assembly AI, the API platform for state-of-the-art
AI models that automatically transcribe and understand audio data at a large scale.
To learn more, visit talkpython.fm/assemblyai.
Hey, guys.
Welcome back to Talk Python to Me.
Thanks, Michael.
Hey.
Thank you, Michael.
Yeah.
Fabio, Nicholas, Brett, it's really good to have you all here.
And I know you are all very excited about this topic.
Brett, I believe the last pre-COVID PyCon, we did a live on the Expo floor show about WebAssembly.
We did.
Yeah.
Fabio, we recently talked about PyScript.
And Nicholas, you're right in there as well, working on WebAssembly, PyDyde, PyScript stuff
as well.
So I know a lot of people know all of you, but maybe let's just kick it off with a quick
round of introductions and background.
Not too deep since we've all done it before.
Brett, let's go with you first.
Okay.
Keep it short.
I am the dev manager in charge of the Python experience in VS Code.
Been a core developer for 19 years.
Been on the Python steering council since Guido's retirement.
And I'll stop there.
Yeah.
Fabio.
So I'm creator of PyScript, current maintainer with Nicholas.
I've been working with Franaconda for eight years now.
Right now, I'm tech lead for PyScript and been doing a lot of community stuff around Python
for a long time as well.
Yeah.
Fantastic.
PyScript was the big news out of PyCon last year.
That, I think, cut a lot of people by surprise and people were very excited about that, including
myself.
Yeah.
I'm very excited.
And yeah, got a lot of attention for good and bad.
Right?
Yeah.
I was going to get some more attention today.
Yeah.
Hopefully.
Indeed.
Nicholas.
Welcome.
Hi.
So, yep.
I'm a colleague of Fabio's.
I'm a principal engineer on the PyScript team.
Prior to joining Anaconda in the summer, I'd been a Pythonista for far too many years and
I care to remember.
Before that, I was a teacher.
And before that, I was a classically trained musician.
And that probably explains my interest in Python in education and the activities that I still
do in that sphere.
So that's me.
That's fantastic.
You were involved with the BBC Microbit, right?
Yes.
I was involved with the BBC Microbit.
It's fun.
Yeah.
Absolutely.
Yeah.
That's awesome.
And we talked about that before.
Okay.
Yeah.
Well, let's talk about running Python in the browser.
There have been some attempts before and those attempts are still, you know, used in different
places.
I'm thinking of like Brython and Sculpt and those types of things.
Anyone who has seen the birth and death of JavaScript, that famous 15-minute talk, which
has got to be one of the most hilarious and yet insightful, like educational foundations
of the web and JavaScript and, you know, what became WebAssembly talks of all time is really
great.
And I think those kind of land in that realm.
But since then, as we started, like, you know, WebAssembly has allowed us to bring
real runtimes, mostly things based on C or REST, but older things based on C, into the browser
and run there.
So who wants to sort of introduce this whole idea of WebAssembly quickly for those who don't
necessarily know and sort of set the stage so people see where we're coming from?
All right.
I'll take it.
So you can kind of think of WebAssembly as almost portable CPU.
It's technically an instruction set that basically is almost like assembly designed to just run
anywhere.
It's all abstracted.
It's technically stack-based, much like CPython's interpreter, for those of you who want to know
insider baseball knowledge or insider football.
But that's basically it.
WebAssembly is really just portable target to compile stuff for that more or less you make
a runtime work for that target and it gets to run everywhere.
There's more details we can get into in terms of WASM versus WASE and platform-specific
stuff.
But at the core base low-level thing underpinning all of our discussion today is WebAssembly,
which is basically just a portable CPU target.
Yeah.
Okay.
Excellent.
And CPython, I guess as the name would very strongly indicate, although people might not
know, is largely C at its core.
It's not Python code.
Some of the standard library is, but not, you know, at the heart, there's an insane
switch statement while loop that is written in C.
And so that, if we can get that into WebAssembly, then we can get Python, the runtime, into the
browser.
Correct.
Technically, as long as you can compile whatever language you want to WebAssembly, that's how
we get it in.
And traditionally, the tool chains that have supported compiling data WebAssembly, either
statically compiled languages that use something like Clang as a build tool chain, or which
typically has fallen under C and C++, Rust, because once again, Rust is based off of Clang
for their compiler.
As long as your language could use a tool chain that already had the support to compile
down to WebAssembly as a CPU architecture or target, you were able to get some WebAssembly.
So in CPython's case, because it's implemented, the key parts are in C.
That was able to be compiled down such that I can run some WebAssembly.
Nicholas's work with MicroPython the same.
MicroPython's written mostly, I believe, in C as well.
And so basically, that allowed both projects to basically just use a specific compiler with
specific flags to just say, instead of writing out X64 assembly for my EMB or Intel chip or
your ARM chip on your Mac, write me out some WebAssembly instead.
People's first impression when they hear this is like, oh my gosh, binary code executing the
browser, run for your life, right?
But it's really no different than JavaScript.
It has the same permissions and liabilities and benefits of JavaScript.
It's just a different execution model.
Yeah.
The same sound bolts as I was.
That's the core.
There are a lot of nuances that comes with how it is.
It's taught, right?
One, it's still in a very young phase, despite all the usage and acceleration.
Everybody's excited about it.
But as Brett said, it's mainly a portable CPU.
And it doesn't really come with the rest of what you would expect from an operating system,
and especially file system and things like this.
So there's a lot of extra work that the larger community is trying to add now to figure things
out.
Now, and the other small detail that I wanted to add is, yes, it's basically just like JavaScript
on the browser, with the exception that some APIs are not available.
For instance, access to DOM and other things like this.
Yeah, I was going to say, it's worth pointing out that what Fabio is saying about, it's not
like having an operating system.
There are projects.
You know, Brett mentioned Waze.
There's also nscript as well, which gives you abstractions of a file system and so on and
so forth.
Such that you could, and it's always important to be aware when a developer uses the word
just, but one could just compile CPython to WASM and it will just work in the browser.
But of course, to get that to happen, it takes a rather a lot of work and browser-based expertise
to actually get you to, for instance, the Python prompt in a REPL, as it were.
Right.
Which is why, you know, wouldn't it be fun if there was some sort of project that got
you to Python in the browser without having to do all of that boilerplate stuff?
Yeah, I wonder if we could find one of those.
Yeah.
One of the things we spoke about before, Brett, was so much of what comes with Python, the
batteries included, the standard library, assumes a slightly larger execution environment
than front-end browser code, right?
Like it assumes a file system.
It assumes that you can probably open a network socket.
These types of things, right?
And so one of the challenges here is, well, if you can compile it down, that doesn't mean
it's going to be permitted to just take some code and jam it in a web page and run it, right?
Yeah.
I mean, taking the CPU analogy, the next step, right?
Like when you compile something down to a CPU for like X64, that's great.
But how are you going to read a file system?
That doesn't exist to the concept of a CPU.
How do you make things show up on the screen?
How do you do lots of other things, right?
Like that's all implemented by your operating system, right?
It's the next layer above your CPU in terms of abstraction.
And WebAssembly only has the start of this concept in one area, which is Wazzy.
And in another area, it kind of just leans hard into the browser space.
And that's kind of what we call MScripten, right?
So generally the way all this plugs together is if you look at it from a browser perspective,
there's a tool called MScripten, E-MScripten.
And it's basically a kind of compiler front end that uses client to compile stuff to WebAssembly
and then has a bunch of shims into the browser to implement stuff like file access, as Nicholas pointed out,
and all these other things you can get in a rich web environment.
But it's provided by this project called MScripten.
And it's not quite an OS, but it's not nothing either.
It's this interesting kind of middle ground.
And it's project specific.
But then on the other side of all this, there's a project called Wazzy.
And this is what when you think of WebAssembly, you start hearing people talking about this compared to containers or edge compute
and all this kind of server scenarios where Wazzy acts like POSIX, right?
So it's not actually an implementation of an OS almost, kind of like what MScripten does,
but instead it's an actual abstraction over what you might expect an OS to provide you.
So in Wazzy's case, for instance, it is an implement file access.
It implements the function to call from WebAssembly that gives you the file access.
So in that case, what you have is you have a runtime.
And that runtime is actually what provides that level of OS that you need.
So if you've ever heard of things like WasmTime or WasmEdge or Wasmr,
all of these are actually Wazzy runtimes that basically load up your WebAssembly,
inject into that code the functions that Wazzy specifies on how to read files
or how to print to standard out or read standard in,
and then allow them to run in an abstracted fashion.
So it's almost half between MScripten and kind of an OS, but above WebAssembly.
But as you can notice, it's a weird little split here because there's the web part and the server part,
and this is where this whole discussion gets really interesting, right?
Because it's now we're starting to have discussions about abstraction layers
and which abstraction layers are provided where.
And this is kind of where WebAssembly's youth, to put it one way, really shines through in terms of showing that it's all still very much actively being developed,
which I'm sure Fabio and Nicholas have some very fun stories to tell you about with PyScript and trying to get this all working today.
But this is where this whole OS concept kind of ties in, right?
Where Wazzy's POSIX, right?
Just kind of abstractions that someone has to provide.
And then you have tools like Inscripten that try to kind of, specifically in the browser,
just go ahead and just lean hard in the browser specs that the W3C has given us and the browsers hopefully implement,
and just use those to implement those things that you would expect from an OS.
So it is, as you said, an interesting problem where from CPython's perspective and most Python implementations, right?
Historically, we've had a full operating system.
MicroPython's going to be the exception, which Nicholas, I'm sure we'll talk about.
But from a CPython perspective, PyPy, whatever, we're used to running on Windows, Linux, Mac, right?
Like full operating systems.
Like it jammed down into a tiny Raspberry Pi.
That doesn't happen anymore because you can't buy them.
They're unobtainable.
But yeah, but I mean, the key point is like a full OS, right?
Where we didn't have to concern ourselves about what was or was not available.
But in a WebAssembly case, right?
Like in the browser, if you use Inscripten, you only have available what Inscripten gives you.
In the Wazzy case, you only have what's been standardized by Wazzy and that the runtime you choose to use has actually implemented.
So we're in this interesting new kind of world where what you might expect from the standard library, for instance, in Python,
that's always been there, like threads aren't necessarily there.
So it actually goes back to an interesting perspective of what's Python the language versus the runtime of Python that you're using and what is provided by that.
We're kind of going back in time in a way of kind of this clear separation of language versus implementation.
And kind of what does that mean to us as a community and what's possible in this new space that is WebAssembly.
This portion of Talk Python to me is brought to you by the AWS Insiders podcast.
When was the last time you ordered a physical server to host your functions as a service, your latest API, or your most recent web app?
I remember the last time I did.
That was around the year 2001.
And yes, it was quite the odyssey.
Of course, we don't do that anymore.
We run our code in the cloud with near instant provisioning and unparalleled data centers.
And the most popular cloud provider is AWS.
But for all the ways that AWS has made our lives easier, it has also opened a massive box of choices.
Should you choose platform as a service?
Or maybe it's still VMs with IaaS.
What about your database?
Maybe you should choose a managed service like RDS with Postgres.
Or is DynamoDB better?
Maybe Aurora?
No, wait.
I hear good things about Amazon DocumentDB too.
And that's where the AWS Insider podcast comes in.
This podcast helps technology leaders stay ahead of Amazon's constant pace of change and innovation.
Some relevant recent episodes include Storage Wars Database Edition.
Macro Services or Macro Disaster.
And exploring computer vision at the edge with AWS Panorama.
They bring on guests to debate the options and the episodes are vibrant and fun.
So if you want to have fun and make sense of AWS, head on over to talkpython.fm/AWS Insiders.
Yes, I know you probably already have a podcast player and you can just search for it there.
But please use the link so that they know you came from us.
Thank you to the AWS Insider podcast for keeping this podcast going strong.
It's very exciting and very fresh.
Meaning that in a good and bad way, right?
It reminds me a little bit of what happened with Node.js, right?
People are like, look, we're writing all this advanced code and the browsers are getting really fast at running JavaScript.
Like, no, no, they're not.
Similar to Apple Silicon.
You're like, yeah, you can't take a phone and make that your fastest computer.
No, no.
And then somebody does.
You're like, wait a minute.
Look at this thing go.
Wow, you could have a server-side JavaScript, which I don't necessarily want to go touch.
But it's a similar transition that we could have Python in multiple places, right?
And it theoretically could run the WebAssembly version on the server as well for parity.
Or I don't know if that makes any sense.
But it's a similar transition in ways.
Maybe in the reverse direction than JavaScript.
Yeah, it actually has.
It's hard to predict as you are living through things, right?
But thinking about how Python became popular as most popular language without actually having a solid story for the most popular hardware today, which is tablets or mobile, like basically mobile phones and stuff.
And also not having a great story for the most popular virtualization software, which is the browser.
You know, imagining how Python will change with the WASM stories.
I find it very interesting because it basically introduces a series of concepts that we are not used to.
It's not just like run your environment there.
There's a whole packaging part of the process that we need to think about.
And how do we distribute that code?
And that opens up for things that we haven't been used to around optimizing space and building effective bundles of your environment where we can tree shake stuff and all of those funny things.
So I think for Python, it can be a very revolutionary moment where in five years from now, we're looking at a different ecosystem, hopefully bigger and better.
It did something on us to sort of adapt and change and make the most of the opportunities to the WASM presenters.
But as Brett and Fabio have said, it's a strange world in that it's not like I've got a libc and I know I'm going to be able to get to the file system and things like that.
There are these kind of shims and slightly different abstractions that may make Python feel like it's, I was going to say, a duck out of water.
Snake out of water?
I don't know.
You know what I mean?
It's not in its natural habitat.
Water moccasin.
But I think I'm pretty confident and bullish about the Python community and our ability collectively to find a way forward with this.
You know, we've got a beautiful language.
Let's bring it to WASM.
We do.
And many people love it.
And, you know, when people say, I love Python, they might mean the language.
But usually I think that's only a part of it.
Right.
Often that's the ecosystem and this whole broad.
Right.
All the packages and all the people on the projects.
And in that sense, like Python is very much empowered to make some really cool transitions there.
We don't have to always kick it back to the core devs for all the work.
Although, Brett, congratulations, I guess, on 3.11.
Right.
I mean, you guys, that's a big deal.
I only, I did a small amount, but I thank you.
It seems to have been taken very well.
The community seems to have picked it up faster than usual, which has been really fantastic.
Dependencies seem to have been ready for this and got wheels out early, which was great.
Because it made transitioning a lot easier.
So kudos and thanks to the community for putting in that effort to get stuff ready to go as of October.
So that when things launched and we were able to do that .0 release, people were able to just install it, download packages, and have the wheels ready to go.
And it went pretty smoothly.
Yeah, that's awesome.
Either of you, other guys, have any contributions to 3.11?
Yeah.
No, we are happy consumers.
Yes.
Exactly.
All right.
One other concept, which I really want to quickly throw out there and just get your thoughts on.
Don't want to go deep on this.
But one of the things that seems to me like an interesting benefit for WebAssembly is the interoperability with other languages.
Like WebAssembly can call WebAssembly.
So if somebody could compile their Rust or their C# or their, you name it, over to WebAssembly, you might be able to consume libraries in a broader way than you can now in Python.
What do you think about this?
Yes, or is this just Dreamit?
I think the answer is you could.
But I also refer the honoured gentleman to my esteemed colleague, Brett, to the earlier answer about this being relatively immature space as well.
I mean, to be honest with you, I used to be a .NET developer before I came to Python.
And the fact that .NET has this notion of the CLR, the common language runtime, to which C#, C++, Visual Basic, F Sharp, I and Python, I don't know, whatever compiles to.
It feels like it's a very similar space as you're implying, Michael, as to what.
Yeah, though the Blazor actually is like incredibly near with what they're doing, which is I haven't done anything with it, but it looks quite impressive.
There's a piece of tech we can quickly touch here.
Is there something, and I think it's actually on the page you're looking at right now if you're watching the live stream, it's right below the fold.
The important note, Wazzy is in transition.
The transition part is there is work towards something called the component model, specifically in Wazzy, which is defined more or less what you're talking about, Michael, which honestly feels like Korba for the new millennia.
To date myself, or at least date my PhD supervisor who did his PhD relating to Korba.
You said Korba, right?
I've not thought about that since like the year 2000.
But the thing here is the component model is a spec being worked on that's meant to be able for you to specify at the WebAssembly level kind of the API that your WebAssembly code exports, right?
I mean, for the Python audience, you can think of it as almost the CPython API, right?
It's kind of like what does CPython export out, and then what can you use from your extension modules?
It's a similar thing, except it's done at the WebAssembly level.
So you can just say like, okay, this function will return a string.
And then there's a definition of what a string is for WebAssembly.
So that when you say, oh, internally, I might use UTF-16, but a string in the WebAssembly component model context is UTF-8.
So you have to encode out to UTF-8.
And the other side, you go, oh, hey, I'm going to call this function.
Oh, it gives me a string.
I know that's going to come as UTF-8.
If you can keep using it that way, great.
If you have to change it to UTF-32 or something, you can.
But it's defining the seam of your WebAssembly module and what it looks like in terms of what it exposes to other people.
So that's that big dream you mentioned of people writing stuff in other languages that we can just consume directly from WebAssembly.
But there's obviously, as Nicholas pointed out, immature stuff in this community where we have to figure out how do we even expose that from the Python side, right?
Like, I don't even know technologically what we would do to make that work in terms of pulling another WebAssembly module.
Because honestly, it's basically like linking.
But we don't have that concept of linking in Python.
You just run an import statement.
There's no header, no definition of what's on the other side.
Exactly, right?
And that's exactly what the component model does, right?
It's an interesting position.
Actually, credit to Peter Wang, who you can save the love slash hate toots to later on this analogy.
But up to this point, right, a lot of the WebAssembly world has been these languages that are compiled, right?
Like the C and C++ and the Rust stuff, like where you just pull in all your code, you compile it, and it all just kind of works.
And it's very much set up in these worlds where, oh, yeah, it's statically compiled, whatever.
As you said, header files, it kind of comes together.
But we come from this world where people have poured all this time and energy to wrap all of this esoteric C, C++, Fortran even code, and give us this nice API in Python.
But once again, Python doesn't operate like C and C++ and Rust and all these other statically compiled languages where we have these concept of these interfaces, and they just load it, plug it right in.
And it just works like, no, we're going to import some Python code, and it's going to execute as part of import, right?
Like, I don't know how many people know that, but literally the way import works is it calls exec on your code, right?
Extension modules use some really crazy chips from glibc to pull in that data off that module, which we don't have in WebAssembly and stuff.
So there's a potential disconnect here at the moment.
And hopefully, as Fabio said, in five years' time, we can kind of work together to kind of work with the WebAssembly community to make this solve the problem.
But as of right now, that component model is not designed for us, the Python community.
It's designed more for the C, C++, Rust world.
And we're probably going to have to work with them to try to figure out how to make that work with us.
Because to be frank, we're bleeding edge in terms of a dynamic programming language with an interpreter as we are coming into this and not being a compiled language.
And I think we're going to be, I don't want to say bringing the WebAssembly world kicking and screaming.
I think they're just, we haven't fully introduced ourselves yet.
And I think they're going to come to get to know us, and we're going to start bringing in some new stuff.
So I don't think we're quite ready for this whole magic bringing in other WebAssembly stuff.
But hopefully, we can work with them to make that happen.
Because as of right now, it's not in the cards.
Yeah.
I'd like to make a comment on this one.
Because it actually is a topic of, we have the running joke inside the PyScript team where Antonio Cooney and I always argue about everything.
Or argue, discuss.
And this is a big topic of discussion.
Because Antonio is more lower level.
And very smart.
And I look at things more on the higher level side.
And I often tell, I really want to see Python working alongside with R or other languages for data science.
Or just, I would love my kids to be using Python to drive a gaming library in JavaScript on the browser or something like this.
And it's like, it's never going to work the way you want to.
Because you don't know how types are going to be translated into WASM for different languages.
And yada, yada, yada, yada.
But one bridge that we have right now is JavaScript.
And having proxy objects in JavaScript that relates to Python on the browser or Rust or things can be a possibility, too.
But in general, I think what I always end up saying to Antonio is like, we're kind of in creative mode right now or experimentation mode where we can try stuff.
And maybe it's not the right way.
And maybe it's not the right way, but it may work 90% of the time, which gets a lot of work done for a lot of people.
So in the meantime, we'll figure out the correct way and how different languages will actually talk to each other or what it means for WASM.
Anyway, I think it's interesting.
This is such an interesting conversation on so many levels because, you know, Brett mentioned Corbett, which is like this thing from way back when, before I was ever a software engineer.
Okay.
And Fabio is talking about how, you know, he has a high level view.
Antonio, you know, from PyPy has a very different perspective on this.
And I would say that, and also Fabio's pragmatism as well about what we need to get something to work because then we can do cool stuff with Python in the browser.
And basically what I'm saying is that you need both of those attitudes, the Antonio and the Fabio and bring them together because that's when interesting things happen.
And I'm not saying it's interesting watching these two have an interesting discussion in our morning standups or whatever.
But what I'm talking about is that that's the intellectually stimulating thing because you have two different perspectives.
And if like Fabio and Antonio are, they're excellent engineers and they can see and empathize with what the other person is talking about and adjust their position.
And then eventually we kind of zone in on various potential solutions, which kind of goes back to the Corbett thing, which is why I brought it up, is that, you know,
I remember meeting an old gray beard programmer when I was a young whippersnapper and he was, I can't remember, something had been announced and I was like, oh, this is amazing.
It's going to change the world in that way.
Young programmers.
And he was like, oh yeah, we were doing this in the seventies with punch cards or something like that.
And so once again, that sort of, we have this cyclical nature in the history of programming where, you know, we're, we're coming back to these kinds of archetypal solutions implemented in different ways.
And you can actually see perhaps that the whole was and wassy thing as yet another iteration of this, because we're rethinking what a computing platform is.
It's this virtualized thing and it's taken us maybe 20 or 30 years to get to that new space after lots of different experiments.
Right.
We're still going to be flapping around like headless chickens, trying to figure out how to make the damn thing work because all of this stuff keeps moving on.
And that's called progress folks.
But you know, this is why it's so interesting.
This is why I'm a software engineer is because I get to work with clever people on interesting problems that if we get it right, a bunch of 11 year olds in the school down the road from me are going to be able to build Python applications on a little device like this using PyScript.
And you know, that is something to work for.
Yeah, that's fantastic.
And if you don't like the tools.
And just for the podcast, a little device was the phone.
Yes.
Sorry, Fred.
By the way, we're not we're not paying Nicholas for every pitch on PyScript.
It's out of his heart.
He does an amazing job.
Let's talk about a little bit about MicroPython.
You know, MicroPython is amazing.
I recently sitting around my desk stuck Velcro to one of the hosts of my desk is one of these ESP feather 32s.
32 feathers.
I don't know how other.
Yes.
Those words.
Thank you.
device running Python connected to my Wi-Fi, syncing a bunch of stuff on the cloud and just had a little thing.
It blinks every now and then to tell me everything's cool.
It's it's doing its job.
And it just these are amazing.
And yeah, I mean, I know circuit Python is not identical to MicroPython, but they're very near and they've been brought closer together as well, which is great.
So if we download the entire CPython runtime over WebAssembly, it's not totally small, right?
It's about 11 megs.
Yeah.
Which we have fast computers.
But on the other hand, you wouldn't put it on like a public site that's there to load quick and be fast for SEO and all these things.
Right.
This portion of Talk Python to Me is brought to you by the Local Maximum Podcast.
It's an interesting and technical podcast that dives into trends in technology, stats and more.
But rather than tell you about it, let's hear from Max and Aaron about their show.
We are now on with Talk Python to Me.
Let's say hi to all the Python fans.
Hi, Python fans.
I'm Max Sklar.
I have actually done a lot with Python myself, so I am a fan of Talk Python.
Do you know Python, Aaron?
I took a course years ago, but I am a little rusty.
We are here today to talk about our podcast, The Local Maximum.
We've been on a roll lately with a new episode every week,
and I wanted to share with you what we've been up to.
Here on The Local Maximum, we tackle subjects in software and technology,
topics as diverse as the philosophy of probability to Elon Musk's next move.
For Talk Python listeners, I want to highlight a couple of recent episodes of The Local Maximum.
In 248, for example, I found out about an open source library that maps the world into hexagons.
And some pentagons.
I had a discussion with an author about games and puzzles and another on a novel approach to doing the job search well.
We discussed the ramifications of AI-generated art.
Have we reached peak creativity, or is this just another Local Maximum?
So check out The Local Maximum podcast available on your podcast app.
But you do have this project called MicroPython.
Maybe tell us a bit about that.
That's smaller, right?
Okay.
So MicroPython is the wonderful creation of Damian George.
Damian is a physicist by training.
He once told me what his PhD thesis title was, and it's something like 11-dimensional.
And then he lost me.
But he was at Cambridge, and one of his hobbies or part of his background in his studies was working with robotics.
And he was part of the Australia team that entered the Robo World Cup for Americans.
That's soccer, as it were.
Which is rather appropriate, given the fact that the World Cup for Human Beings is happening right now.
But what he wants to do is write a scripting language so that they could very quickly update what was going on in these robots.
Okay.
And he learned a lot by doing that and then realized, well, actually, perhaps if I take the things that I've learned building this stuff to a proper scripting language, then that'd be a cool project.
And so he looked around thinking, well, what are cool scripting languages?
And arrived at Python.
Created an early version of MicroPython, put it on Kickstarter, thinking that he could sell a few boards, make a little bit of money, and, you know, MicroPython would be there.
Well, I think $100,000 plus later, and, you know, lots and lots of forders for boards later, MicroPython was, you know, has become this amazing success.
And the whole point of my...
Oh, no, I caught the car moment, right?
The dog that caught the car, like, here we go.
Yeah.
Well, it rather surprised Damien, to say the least.
But now MicroPython is designed to run in highly constrained environments.
So, for instance, I believe it can work with only 16K of RAM, for instance.
Clearly, when you're running it on your board, actual Python is running on the flash memory rather than the RAM, which is something different.
And Damien pulls an awful lot of tricks to actually make it work really efficiently.
But because he's a physicist, he knows how to do experiments.
And so that's what he does, literally.
He tries to work out, how can I get this big fat snake that's just eaten an elephant and squash it down into this small space so that we can still have a full re-implementation of Python 3 on something that maybe has 16K of RAM, like, I don't know, a microbit.
Unsurprising, I have a box of microbits on my.
Oh, yeah.
Beautiful.
And CircuitPython is a friendly fork of MicroPython by the wonderful folk at Adafruit.
So, you know, it's, I think it creates an interesting dynamic because MicroPython is perhaps the industry version, whereas CircuitPython provides a consistent API for all the Adafruit boards.
It's aimed at education.
They've got a whole bunch of sort of tutorials and support for that sort of stuff.
And they're forever bringing out incredible new devices, as I'm sure we've all picked up at PyCon, you know, the Circuit Playground Express.
Yeah, exactly.
Great conference band.
So that's MicroPython in a nutshell.
So what's it doing on Wazen?
Well, it's because 16 megabytes is rather a lot to try and download even today over a 4G network.
And these devices, subtitles here, this is a phone I'm holding up, are underpowered compared to the rather beefy MacBook sort of using to talk to you now.
And so the, one of the first things I did when I joined Anaconda was just see, well, what happened if you run it on a mobile phone?
And it took 16 seconds to get to Hello World, which is not an optimal kind of solution.
So what would work?
And very quickly, you know, I came to playing around with MicroPython and MicroPython is, you know, under 100 milliseconds to start up and get you to Hello World.
It's fast enough.
And you've got, so here's the interesting thing.
I'm interested to hear what Brett says here.
It's a full re-implementation of Python 3.
However, there are differences.
And so we get to Brett's rather interesting angle of, well, what is Python in the abstract and in the actual detail of implementation?
And we've kind of got this platonic Python, this ideal Python that doesn't actually exist.
And then you have all of these implementations of which, of course, the C, the CPython version is the, is the touchstone.
But MicroPython doesn't have all the APIs.
It doesn't have the full standard library.
And depending on the size of the device, it might not even support floating point numbers, for instance.
But it's Python.
It's the Python that we love.
You've still got indentation in the white space that annoys the C developers or whatever, you know, so it's good enough for me.
So we can compile this much, much, much smaller, more lightweight version to WebAssembly and do similar things.
But instead of downloading a whole huge thing, maybe it's a light little thing that still lets us write Python and do front end stuff in interesting ways.
Yeah.
All right.
When I talked about speaking back in 2019, I guess it was in Cleveland, we did touch on, well, if you're not going to be able to do all the Python things, how do you define like a standard Python?
There's, you know, and way back in Greek philosophy and the platonic Python, if you will.
Platonic idealist language.
The essence.
Yeah.
I mean, you're a philosopher, you know.
Oh, yeah.
The essence, like the core that, like, this is the little bit we circle and say, oh, Python does this.
Like, what is your thought on this micro invasion of Python in the front end?
Well, I have to be very clear on my bias here.
I'm somewhat notorious as having written the PEP that causes all accelerator modules written in C for CPython to have to have a Python equivalent specifically so that projects like MicroPython and PyPy weren't left behind from the standard library so that they could just work and not have to re-implement the C API for key things like the date time module.
So I have a massive bias in this statement, to be very clear.
So I am not representing necessarily the entire Python core development team or the steering council on this.
But for me, it has always been a separate concept of what the language is and what the reference implementation is, right?
Like, we may do development of the language using the CPython reference implementation.
And I am very specifically using the term reference implementation as a way to help make the language evolve.
But for me personally, they are two separate concepts.
These happen to be developed simultaneously and by the same group.
And it's mainly for convenience and just be able to work faster.
But I do view them as separate things.
And it does make sense, right?
Like, there are people on the Python core team who are way more into the esoteric bits of the language spec and how the language functions.
And some people just care about the eval loop that makes CPython run, right?
The big switch statement you mentioned earlier, Michael.
So for me, this is totally great.
Like, we have versions of the language specified in the language spec, which, to be fair, is not a spec from a, like, ECMA or ISO level standard.
But hopefully good enough for people to be able to follow to implement the language.
And to me, that is really what people are targeting.
I honestly, once again, major bias showing here.
I don't consider the Styron library part of the language.
The Styron library is a very key piece of functionality and a key convenience and potential differentiator for Python in some people's eyes.
But I do not consider it part of the language.
It is just something that we have developed over the years that has helped accelerate Python's growth.
Because back in the day, batteries had to be included because, guess what?
We didn't have PyPI.
Like, Vaults of Parnassus had little animated GIFs of a website where you downloaded zip files and you unzipped your stuff.
Everyone vendored everything because there was no installer.
There was no pip, right?
Like, showing my age in the Python community, right?
Like, we had to do the batteries included thing.
Did you un-UU encode it off of Usenet to get your package?
No, no.
I was not that far back into programming that, I mean, I used Usenet, don't get me wrong, but I was not coding at the time when Usenet was the way to Netfeed.
But, I mean, it was kind of just like, it's wherever it ends up.
You grab it and you put it in your project and you run with it, right?
There wasn't a central location for these things.
And so, to me, there's a very clear separation here.
And I personally view the Styron library as a thing that represents the time of when it was created.
But, to me, it has never been the language.
The language is what's in the language guide and more or less what's built in.
And that's kind of it.
The import statement brings all this wonderful stuff in for you, but that's not the import statement's part of the language.
But what you can import into it, unless it's like Dunder future, right, which is baked into the language definition, I don't consider that part of the language.
And I've said this controversially once on the former website that we all used to hang out on before Mastodon, where I actually said, like, the REPL, for instance, is not part of the language either, technically.
If you think about it, it's a wonderful tool.
And don't get me wrong, it definitely makes Python more useful.
But for me, personally, the REPL is not part of the language either.
It's just something we all ship because it's so useful to use and Python enables that kind of development process.
But so MicroPython saying it targets Python, I believe, technically 3.4 with extras means it is an implementation of Python for Python 3.4.
And that's great.
And whether it comes with everything that the standard library that CPython had for 3.4 is a positive, is a plus what it has.
But to me, that's not the language.
And to me, they're very clearly separate concepts.
It's just people get very spoiled when they just download CPython.
Well, my code doesn't work over here.
It's like, well, you can view CPython almost as a platform.
And this platform just doesn't have the same platform.
The same language, just different platform.
And to me, that's fine.
That just is what it is.
So it sounds like you're okay with the micro invasion.
Oh, yeah.
I care about the language, right?
If CPython is the way you get it, fantastic.
If you get some other way, that's also fantastic.
I personally care about the language.
And I mean, we all know the community that comes with the language more than the implementation.
And the fashion.
Don't forget the fashion.
And the fashion, yes.
No, go ahead.
I was going to say, before we pressed record, that was a running joke.
But bring us back to the serious conversation, Nicholas.
Brett Sandals.
So the more serious point I was going to make is that what Brett just said is actually easy to miss, but of vital importance.
Which is if you're coding with, say, for example, MicroPython, you can't expect your code to work with CPython and vice versa because of the differences in the platform, the wider platform ecosystem that you might have.
Mostly the behavior is the same, although there are some very subtle differences.
Yeah.
It's mostly the experiments I've been doing where I've been using Pyodide as the sort of the reference and MicroPython as the sort of the thing to compare.
I can just slot one in and slot the other out and PyScript sits on top of it.
And I can make things work as I want to.
When I'm testing Python things, there's a whole conversation, which I think I can see coming down the tube right now about how do you interact with the DOM and things like that.
We'll get to that when we get to it.
But it's mostly the same.
But folks should know that they are different.
And well, there you go.
I'm just flagging that.
I need to flag that.
Yeah, absolutely.
All right.
Quick question from the audience here.
Glenn says, do you think more stuff needs to be removed from CPython?
I mean, I know actually that was one of the things that the 3.11 release addressed was a bunch of modules were either removed or deprecated.
I think, Brett, we spoke about that a year ago or something, maybe, if I remember.
Yeah.
Christian and I came on maybe, yeah, almost a year ago.
Not to the day, but maybe to the month or October last year.
We came on here and talked about us removing modules from the standard library.
Yeah.
To directly talk about this, once again, personally, not speaking on behalf of any other group.
I think we, I've actually put myself back up for the Python steering council.
And one of the things I put in my self-nomination is I want to have a discussion about what the standard library is, which evolves around how do we want to evolve it, maintain it?
What would go in there today if we were to have guidelines?
Because we actually don't have guidelines on what should go in.
Historically, it's just been a core dev has gone, I want this in.
And people just kind of, in general consensus, go, okay.
Or honestly, I'm going to add this.
And they sometimes have added it because five or some odd core devs all agreed to it and just kind of goes in.
And they just didn't think to have a wider discussion.
Like, not going to go down details on that one.
Anyway, point is, it's not had any guidance to it.
And it's a discussion I want to have.
And I don't know if it's going to lead to a shrinkage of the standard library just because, once again, from a CPython perspective, there's compatibility to consider.
Right?
And we don't want to just rip stuff out.
But it is possible we might start deprecating more stuff, right, beyond what the dev batteries were.
Because the dev battery list was very conservative.
Basically, if almost anyone brought up any objection to something, we left it, whether we thought it was reasonable or not.
So I can very much see a future where we maybe have a list of like, yeah, this stuff's here, but don't really rely on it.
And obviously, MicroPython probably doesn't already ship that stuff now anyway.
But yeah, personally, I would love to see the standard library a bit smaller, if for any other reason that it just makes it easier to maintain.
Because there used to be, before the dev battery PEP, more modules than there are countries in the world.
So like, I think, 198.
So there's a lot of stuff in there.
And we can probably stand to shrink it.
And once again, it kind of makes it a little easier for other projects to not get pushback from people.
And like, well, where is this module?
It's in CPython.
It's like, well, we don't have it.
Well, why not?
It's like, if it's not there to begin with, it makes their lives a little easier to not have to try to support it and push back to people.
It's like, it just doesn't make sense for us as a platform.
Right.
And as we talked about before, some of these things being included came from a different time, for sure.
All right.
Well, I remember when I got one gopher lib.
So it's also worth noting.
But Archie, we're going to keep, we're sticking with Archie.
Sorry, go ahead.
No, no.
I was saying, those batteries have a cost.
And every time you have to run limited devices like MicroPython or the browser, like you realize that.
And then the question becomes, well, is that user base significant to the Python project to make a change on those?
Right.
Like, and that comes with conversation and evolution.
So I think probably.
It's always a trade-off.
You say, let's remove TKinter because it's a GUI from the mid-90s and nobody uses it.
And then everybody points out that the Turtle module mostly uses TKinter and teachers all over the world will scream, you know, and you've got a big problem.
So it's a Gordonian knot.
Sure is.
All right, let's bring in the third major project here, which we've touched on a few times.
But Fabio, tell us about PyScript.
What a cool project.
Cool.
Thank you.
Yes.
Where does it fit in this Pyodine, WebAssembly, MicroPython world?
What's the angle here?
I think it fits as a glue.
Well, pretty much like Python was glue for a lot of things.
Like the concept of PyScript was really, you know, realizing that a lot of, most of the technology for Python to run the browser is there.
And it's been there for years now.
And what we're missing is the easiness to just use it without being, you know, without having to spend hours or days looking for how to import things or, you know, the JavaScript side of it, what it means on the browser, as a web dev to start using Python.
So the idea was really like, like, can we call it?
Because it's one thing to have WebAssembly.
Sorry, it's one thing to have WebAssembly see Python.
It's another to build meaningful things in the browser with that as a piece.
Right.
And so PyScript kind of gives you a framework to write Python code in the browser based on this WebAssembly.
Right.
Correct.
It's not a framework.
It's a platform.
And we fully expect people to write Pythonic frameworks on the platform that is PyScript to do whatever funky stuff they want to do in the browser, their business.
And, you know, I know that I trust the Python community will come up with something that we can't even begin to imagine now.
But the thing to do is remember that PyScript is that sort of platform layer rather than a framework.
But in that platform, what we're looking at is perhaps pluggable runtimes and a bare minimum of APIs and heuristics and ways of working such that you can start to build your frameworks on top of this and make the funky stuff.
Michael, like you said, that's useful for folks.
Well, OK.
Well, so we might have Pyodide, which is a more full featured version.
Might we have MicroPython for a fast, speedy version?
Yeah.
And there are other projects as well that are coming up and or other languages, too.
Right.
So that's definitely in the.
But that'd be interesting.
Exactly.
There was a big announcement that got thrown in here.
We'll go this way.
We'll go with Simon Wilson, who was on the previous show about Mastodon, previous episode.
And he has a toot, which, by the way, I don't know, Brett, you said toot as well earlier, but they just the button on there used to say toot until like last week.
They just call it publish now.
I think they're downplaying the toot, but it's going to live on.
The toot said huge Python WebAssembly news tucked away in this post from Anaconda here.
When you apply MicroPython to WASM in its default configuration, something new and exciting emerges.
With a total size of 300 kilobytes, this new runtime builds instantly and starts executing MicroPython logic in less than 100 milliseconds.
That means the cost of running MicroPython on the web is now equivalent to serving up a large hero image.
This is awesome, you guys.
Where are we going with this?
Whenever you meet Damien, you buy him a beer is pretty much what I would suggest.
Although not too many.
Once in sober.
Yeah, this is fantastic.
Because if we do have a really small runtime, then all of a sudden you could.
So when people saw PyScribe and Fabio, they're like, oh my gosh, could we replace JavaScript with Python?
And the answer was sometimes, but not in general, right?
Yeah.
Not practically.
This is Paul Everett, who's been around the Python ecosystem for a lifetime and is really great.
And we were talking about that and Python for web during PyCon.
And he often comes up with this distinction between the app web versus the content web, where in terms of content web, you need things to load immediately.
And you're mostly wanting to show content rather than a full-blown application.
And I think he still thinks Python is not going to be a reality for the content web.
I think this brings it really, really, really close.
And you can have basically Python running for content, but also the amount of possibilities around education, around exploration in real time and stuff like this is tremendous.
And if we can actually, as a community, gather and understand how we want to build layers on top of other things, I think we can come up with really interesting solutions.
And let me explain.
MicroPython, for instance, doesn't have a JavaScript interface, right?
So if we could have a module, maybe it's the Pyodide one that we strip out or we develop a new one where we can explore that Python to JavaScript interface and make it available for all the interpreters.
And it's just like a package and you can install it.
We open up a new channel or the whole packaging story for Python on the browser.
And if we can figure that out in a way that, you know, we can just install packages and doesn't matter the interpreter because it all end up like being WASM, then I think we can build a very strong ecosystem where if you need more complicated things, you run with your full CPython and WASM interpreter.
Otherwise, you can just use MicroPython.
But I think right now is the time where we start doing those things.
Coming from the Anaconda world, there's one view of like, what does Python computation mean, right?
Often that means kind of notebooks and data science and like scientific computing.
And there's a big desire to sort of move that to the front end and just say, let people run that on their computers and they can do kind of like notebook things on the front end.
But there's a whole other side of the web that says, I want to build Gmail, but not in JavaScript on the front end.
But I want that interactivity or I want maps or I want, you know, most modern highlight dynamic single page app type of web apps.
But I want to write that in Python.
That to me feels like that's almost the dividing point of like, well, we want the Pyodide runtime where it's rich and we can just straight grab Matplotlib and run with it or Pandas versus I'm willing to give up a lot to not write JavaScript.
You know what I mean?
If I've got to only use a few packages and I could still write Python end to end, that makes me super happy.
As you said, like we can augment the things that Python can do.
Like if we all of a sudden have access to the browser APIs for geolocation or other things, then you can write very interesting applications that is just Python or, you know, even a mobile and stuff like this because WebAssembly can run on mobile as well.
So, yeah, the competition between all the arguments framing PyScript versus JavaScript, I think they really missed the point where it is augmenting both ecosystems.
Like right now, we now can use D3 in Python and vice versa.
JavaScript developers can use NumPy or Pandas.
It's a win-win, to be honest.
Yeah.
One of the things I think maybe people when they hear this don't necessarily know, and I forget which is maybe the best one to look at.
But not only can you run Python code in the browser with PyScript, but you can hook JavaScript events and then you can change DOM elements.
This was the JavaScript DOM interaction layer you were talking about before, right?
Yeah.
Yes.
And actually to what Nicholas was saying about the difference between that we want to really sell the point that PyScript is a platform.
We're currently working on plugins where we want developers to actually write Python code to add custom elements to the DOM as well, right?
And not use any JavaScript.
I hope we can get it in this next release, but for sure before the end of the year, we are allowing that.
And it's going to be a huge improvement in how what people can do with PyScript and actually how can people extend the platform creating new frameworks.
So are you envisioning or are you at least aiming for, if not fully envisioning, something like PyView or PyReact or like some of these traditional front end frameworks, but a Python equivalent?
Nicholas?
That's a loaded question.
I think.
A Pyangular?
No, just kidding.
Pangular.
I think that it makes a great story if you're a journalist that Python's going to come up and eat JavaScript's lunch in the browser.
That's a false dichotomy.
That's a great way of getting clickbait and things.
If you want to write, you know, app, web-based app stuff, and you're familiar with JavaScript and React, you know, just use the tools that empower you to write the stuff that you want.
But for the quartet of us in this conversation, we're all Pythonistas.
We all appreciate the aesthetic of that language and the way it works.
And so I would go back to the difference between a platform and a framework point from earlier on, which is it's going to be fun to trust the community, our remarkable community, and see what interesting things, what itches that they scratch.
So that they create fun stuff and feedback to us, ways in which we can improve the PyScript offering, because this is a story that's going to keep going.
You know, software is never finished.
But I think that one thing I hope, and if I'm honest with you, this is really why I joined Anaconda, was to help think about these things.
Exactly the question that you've just asked, Michael, you know, what about all of these kind of things of building apps with Python in the browser?
Well, what I found is that I need to dig a bit lower to do some more cool PyScript-y things, and then dig a bit lower to look at perhaps what the runtimes are doing and blah, blah.
And here I am messing around with, with MicroPython now, but hopefully I want to sort of surface, as it were, and get back to what I thought I was going to be doing, which is thinking about these sorts of things.
And what I really hope to do, or what I really hope to see from the Python community as well, is engagement in frameworks that will empower people.
And I'm thinking of the educational sphere as well here, because let's face it, I don't know if you've ever faced 30 teenagers on a Friday afternoon and somebody's introduced you as Nicholas, a coder who's going to teach you about Python.
There's nothing more intimidating than that.
And let me tell you, print hello world doesn't cut the mustard.
Okay.
This is not exciting for them.
But if we can make something.
I want to build this thing.
I saw an Unreal Engine 5 in Python.
Exactly.
But if we could make it so that they can do the equivalent of, you know, the MySpace.
Hi, hi, Nan.
I'm on the internet.
You know, within two minutes, you've got a website, you know, you've got a very quick way of getting onto a mobile phone or tablet, which let's face it, for today's teenagers, that's their primary computing device.
Yeah.
And I've been in classrooms where, you know, kids can't type.
It's not because they don't know what a keyboard is.
They use a keyboard every day, but they just use their thumbs like this with it.
And when you give them an actual mechanical keyboard.
We're really bad.
We are dinosaurs using these keyboards now, right?
Okay.
We're going to evolve massive thumbs or something, but it's that sort of a situation.
Okay.
We've got to be aware of what these platforms are that folks are using that may be outside of our kind of age group and usage and help them both do things with Python.
You're touching on a very important part of the PyScript vision.
And it's really not about the current Python community user base.
Like it actually is how can we democratize programming and Python and everything.
And so we really want to be thinking about who's not thinking about coding at all.
Like people that would love to use programming language as a tool for them to do things.
And they can't either because, you know, time or because it's too complicated to get Python working or all of that.
That's a pluggable.
And I'm going to quote Peter again, because we are talking and welcome back, Nicholas.
Peter at some point mentioned something like, you know, system design with plugins from the beginning is kind of indication of the developers not really knowing what they're doing or not really knowing what it should do, which, you know, sometimes is a negative connotation.
But for PyScript is definitely intentional because we want to we want the community to be able to create their own things.
And we don't it's really greenfield.
So I don't know what they're going to be doing.
I want to allow them to do crazy things and surprises.
You know, like two months last DjangoCon, Patrick came up with this experiment of running Django on either PyScript or Pyodide.
And I my first question was, why?
Right.
But then who cares?
Like it's the web is inside the web inside the web.
Exactly.
Like inception all the way down.
So that's the whole point.
I can we want to make it funny, accessible and a hacker, a hacker space, a safe hacker space.
Yeah, it's such awesome.
Congratulations to you guys on this.
When will we see something that we outside that don't want to grab onto an in-flight open source project,
but like a release equivalent of this?
Is there some some time frame, some thought about when that's out?
Because this is the right time to drop from the call.
OK, so I can tell I can certainly tell you what the state of play is right now.
And you can extrapolate when you may see sort of things like microprice.
Because PyScript, proper PyScript is undergoing active development.
I didn't want to try and plug in new runtimes, new interpreters, whilst the sand underneath me was shifting, as it were.
So I created a very small and simple test harness version of PyScript that I've called, surprisingly enough, micro PyScript.
That is going to be thrown away.
Its sole purpose was to allow me to just poke these things with a stick and see what happens.
And I'm still using that to, for instance, figure out how we can do MicroPython DOM connectivity and interactions as well.
That's literally what I've been doing all day today is reading articles I needed to do to make that happen.
So, yeah, that's going to unlock so much.
Once the DOM is in play, then all of a sudden it's on.
Yeah, everything else is.
Yes, exactly.
Exactly.
Once that's in place, what I imagine will happen is Nicholas is going to be spending a lot of time with the main code base and pairing with people who know it a lot better than I currently do, because it's been maybe a couple of months since I've last looked at it.
And it's changed a lot since then.
And we'll integrate that work.
So I expect, and this is a finger in the air, and remember, the right answer is when it's ready.
But I imagine it's going to be kind of springtime.
Springtime.
First, third of next.
Would you say maybe in April?
Like April 19th, 20, 21st?
I'm not going to mention any dates because you're just going to hold me to it, aren't you?
I'm not going to mention any dates.
I'm just teasing you.
I'm not holding you to that.
I hear that, you know, conference wear is very real.
So we can promise for PyCon.
No problem.
Yeah, I hear a good place to announce new JavaScript packages is Salt Lake City in April.
So Brett, I'm going to give you the final word here maybe to like put one more thought into this before we wrap up our show.
Nicholas talked about, and Fabio also talked about like how do we, you know, this could be an empowering thing for other people, right?
Like if for kids in education and whatnot, if you look at a lot of education is Chromebooks.
You know what runs great on Chromebooks?
The web.
Also VS Code in the browser.
Like there's, is there some thought of like interesting pure web development environments, runtime environments, like end-to-end things that could be done?
We actually announced that for VS Code in our last release.
If you go read our release notes, we actually have an extension that will load up into VS Code.dev, which is an actual website, not the name of a product.
You literally go to VS Code.dev.
It'll load up VS Code in the browser.
And there's a Python extension by my teammate Dirk that uses Wazzy and the CPython build where you have a REPL.
You can run code from your workspace wherever it's loaded, right?
It doesn't have to be on disk.
It can come from GitHub.
Anywhere VS Code can read files from.
It can load and be seen by Python interpreter itself.
So that's all working.
And just this past week, it's not out yet, to be very clear.
Dirk got debugging working using Wazzy and a very cool trick that everyone can see.
It's very Unix-y.
I don't want to spoil it.
It's going to be open source, so it's not a trade secret or anything.
But it's way easier to read about it than trying to explain it on a podcast.
But we got debugging working as well.
So we are trying to work towards a complete development story such that, once again, for beginners, for learners, for the education market,
to at least have a baseline Python experience where you can write code, read code, read files, debug.
Like, what you would want to have when you're facing down that classroom of 30 kids that Nicholas has shown is very scary to at least have something you can have them all just pull up.
I do want to add two other things to this, though, is actually kind of call to actions for the community around all this.
One is I don't think we've all started to think about the opportunities here beyond what we've talked about, right?
There's more to this than just what we have in the browser.
And it's one of these rising tides lifts all shifts.
So it's not that I want to take away from what Pryscript's done and all this wonderful stuff in the browser.
But I think if we can get more WebAssembly stuff kind of going, it helps cause everyone to try to look into this more, which will lead to more Pryscript engagement.
So I think there's some use cases we haven't really tackled yet in the community where if you just stop and look about where's things really oriented towards JavaScript as a platform and go like, oh, you know what?
We might build these Python here now.
For instance, you could probably, and I haven't had time to test this, but I see zero reason why this couldn't work.
You could probably start writing GitHub Actions in Python now.
Because guess what?
It runs on Node.
And Node can run WebAssembly.
So we could totally take either Nicholas's MicroPython build or we could take the CPython build and totally just have as part of a GitHub Action as the first step in the JavaScript, load Python.
And then suddenly just say, call this function.
And suddenly all your stuff's going through Python.
Because guess what?
At that point, GitHub Actions is all totally driven via standard out and some special formatting in it.
So you could totally just do that.
And I think Nicholas wants to interject with something.
Yeah.
It's worth pointing out that Damien, who has done a lot of work on getting MicroPython to work with WASN, clearly he knows the code base and things like that.
MicroPython, if you look very carefully at the WebAssembly port, you'll notice that there are conditionals that check whether it's running in Node or in a browser.
So go knock yourself out.
Try that.
I've not tried it.
I've clearly been busy doing other things.
But folks might want to have a go at using.
I mean, I feel like we should award a prize or something.
You win a thumbs up or something like that if you can get a GitHub Action running MicroPython.
Yeah.
I mean, that's fantastic, right?
Like, I think there's opportunities here we just haven't even touched yet that the community can totally just lean into that we haven't had opportunity to be able to do before.
The other thing I want to lean into here that we've talked about languages versus platforms and all this, the one key thing across all of this story is Python the language.
So this is going to sound a little weird, but I want to push people to write more Python code.
And the reason I phrase it this way is we've historically as a community done great about this, but we will reach for that Rust code or that C code or whatever to write that little bit a little faster.
But when you do that, well, right now, Fabio and Nicholas shed a tear because that makes it that much harder to make that run in PyScript, right?
And same for anyone else who wants to do this WebAssembly thing, right?
Anytime you write anything in something other than Python, it's harder to get running, right?
Somewhere else.
Now, you mentioned the 3.11 release, Michael.
My hope here is now that we've got that nice little performance boost there, that's going to motivate people who are primarily targeting CPython at the moment to write more code in Python and reach for the C code and the Rust code less.
Because, once again, that stuff can get brought over today.
There is nothing you have to do to make this work, right?
Like, you can load pure Python wheels in PyScript.
You can do that on WebAssembly, right?
It just runs.
So if we can kind of nudge the community back towards running more Python and leaning less on the accelerator code that we have historically written for these kind of platforms, or do both, right?
Like, if you can at least prototype in Python and keep that running, and then write the accelerator code behind the scenes, right?
Like, you can have multiple wheels, including a pure Python wheel, right?
Like, coverage.py, we all know, does this exact thing so that it works no matter where you are.
Same thing for this case, right?
Like, if you can get the pure Python wheel out there, then it's going to be usable everywhere.
And so that's kind of a baseline target I hope the community kind of leans into more than we have in the last few years, where, yeah, write your Python code even more than you may have before, because it's usable in more places.
That's really great advice.
And it's not done getting faster, right?
The faster CPython team is still making a bunch of steps.
So it's much faster now, but there's still, there's 3.11, 3.13, or 3.12, 3.13, the one that's going to be.
Yeah, exactly.
Like, it's going to keep going.
I don't know how much faster 3.12 may or may not be.
I think there's some plans for 3.12 that are really foundational.
So the bump might not be quite as big as 3.11, but 3.13, if the foundation lays in 3.12, we'll hopefully get the bump.
So, yeah, hopefully you'll keep getting those wins going forward, right?
And I know Damien's still working on MicroPython to make it faster and smaller and better and all that stuff.
So it's not just a CPython thing out of there.
Like, the whole, everyone's always trying to make Python run better on all these platforms.
So key thing, though, is the common bottom layer of all these platforms is actually Python itself.
So if we can target that more as a community, we'll actually be able to get more use out of the code and for what people have produced in more places.
And once again, help Nicholas when he faces down that class of 30.
Yes, you can.
You can create Call of Duty.
Okay.
Thank you, Brett.
That's great thoughts.
And it also points out I should pay more attention to those release notes when they come up in my VS Code.
I'm like, oh, new one, out of the way.
Maybe I'll read them.
All right.
You guys, thank you so much for all the work on this.
This is super exciting.
And yeah, I'm looking forward to hearing about it in spring or whenever it's ready.
Brett, Fabio, Nicholas, thanks for being here.
It's been great.
Thanks, Michael.
Thank you, Michael.
That was great.
Thank you, Michael.
This has been another episode of Talk Python to Me.
Thank you to our sponsors.
Be sure to check out what they're offering.
It really helps support the show.
AWS is the lead cloud for developers.
But with over 250 services, it's an overwhelming set of choices.
That's where the AWS Insiders podcast comes in.
Their job is to help you make sense of all those AWS options.
Listen to an episode at talkpython.fm/AWS Insiders.
Listen to the Local Maximum podcast.
Learn about topics as diverse as the philosophy of probability and Elon Musk's next move.
Just search for Local Maximum in your favorite podcast player.
Want to level up your Python?
We have one of the largest catalogs of Python video courses over at Talk Python.
Our content ranges from true beginners to deeply advanced topics like memory and async.
And best of all, there's not a subscription in sight.
Check it out for yourself at training.talkpython.fm.
Be sure to subscribe to the show.
Open your favorite podcast app and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, the Google Play feed at /play,
and the direct RSS feed at /rss on talkpython.fm.
We're live streaming most of our recordings these days.
If you want to be part of the show and have your comments featured on the air,
be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
Thank you.