Despite Python being overwhelmingly popular and reactions to it positive, there are major areas of computing where Python is not present, most notably on mobile and on the front-end side of the web.
PyScript, a new project launched by Fabio Pliger from Anaconda, just might change that.
It was made public and announced at PyCon just two weeks ago by Peter Wang and now has over 10,000 GitHub stars.
But what is hype versus reality versus projected hopes and dreams?
We're going to find out on this episode.
Fabio is here to tell us all about his new project.
This is Talk Python To Me, episode 367, recorded May 12, 2022.
Welcome to Talk Python To Me, a weekly podcast on Python.
This is your host, Michael Kennedy.
Follow me on Twitter where I'm @mkennedy and keep up with the show and listen to past episodes at talkpython.fm.
And follow the show on Twitter via at Talk Python.
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 sponsored by Microsoft for Startups Founders Hub.
Check them out at talkpython.fm/foundershub to get early support for your startup.
And it's brought to you by us over at Talk Python Training.
Did you know we have one of the largest course libraries for Python courses?
They're all available without a subscription.
So check it out over at talkpython.fm.
Just click on courses.
Transcripts for this and all of our episodes are brought to you by Assembly AI.
Do you need a great automatic speech-to-text API?
Get human-level accuracy in just a few lines of code.
Visit talkpython.fm/assemblyai.
Hey, before we jump into the interview with Fabio, creator of PyScript,
I want to just tell you really quickly about this new YouTube video I made.
After chatting with Fabio, but before this episode is released,
I decided to play around with PyScript some more.
It's really, really cool.
Turns out that one of the things there's not a great example for is how do I take and build a regular web application,
something you might do with Vue.js or something like that,
with PyScript using Python on the front end.
And is it possible to actually avoid downloading the CPython runtime as a WebAssembly that comes out of Pyodide and all those things
and make your code sort of installed locally and run really fast and have actually a pretty great user experience?
Well, it turns out the answer is yes.
So I put together a 30-minute demo tutorial of that over on YouTube.
If you want to dive in a little bit and see that in action, after you listen to this episode, be sure to jump over to YouTube.
The link is at the bottom of the show notes in your podcast player on the episode page.
Head on over to my personal YouTube channel and check out that video.
I think you'll be pretty impressed.
And it'll just make you want to do more stuff with PyScript, I'm sure.
All right, let's chat with Fabio about PyScript.
Fabio, welcome to Talk Python to Me.
Thank you.
I'm really happy to be here.
Yeah, you're welcome.
And I'm excited to have you here because I am quite excited about the PyScript announcement that you have put so much work into.
I'm very excited about the possibility of finding Python in other places than where it has really great strongholds, right?
For as much as Python is, the incredible growth of Python that Stack Overflow blogged about in 2017 and all the growth in different metrics.
But by some metrics, first, most popular language or second, depending.
But for all of that, there's still very notable places where Python is not.
And what you're working on has the possibility to unlock one or more of those places or a whole different set of contingency.
The people of data scientists, web developers, UI developers, maybe just for desktop even.
So exciting.
Yeah, I think it captured a lot of the things behind the project.
Really happy to talk about all of those because, yeah, that's the reason we started it.
So excited.
Yeah, and it's super exciting.
There's been some attempts at this and we're going to get into, I want to sort of start our conversation about the history of what has come before and so on.
Before we do, though, let's just hear a bit about you.
How did you get into programming in Python?
So programming, I was being curious about a lot of things and probably doing too many things still today.
Early on, I got into programming through friends who had computers and Commodore or things like that.
We would pop on.
I had a, in my dad at some point bought a, I don't even know the version.
It was like similar to Commodore, but it was in Brazil, a gradient MSX or something.
It was a local, like a national branded computer, but it allowed you to jump in and do basic stuff and programming.
So I remember trying to play with my friends and try to code games.
Of course, we never get anything done.
But I always been passionate about computers and games and stuff like that.
So into college, I took a computer science degree, dreaming to become a game developer also never happened because I got...
I think it's really interesting that so many people want to get into game development and then they kind of see the sort of grinding mode of that industry, right?
It's like both fascinating and has this great pull.
Then you're like, but it's really hard on humans as well.
Yes, it's a very hard industry and very competitive.
My brother is an indie game developer and a lot of sleepless nights and working hard trying to get his thing out there.
And so, yeah, I think...
And through life, I also...
Just life happened.
I met my now wife and started to be a little more serious about, you know, gaming is great, but I also need to make plans for the future.
So I ended up graduating and started to work for a company that's automation, like machines automation and big industries, many on pharmaceuticals.
And I worked there for a while and I was in the team that would develop high level applications for analytics.
And we would usually do for big pharmaceutical production lines.
So providing all the charts and everything they need to say this production batch is valid for whatever FDA or whatever entity is approving them.
A lot of paperwork, a lot of things.
Eventually, at some point, my unit became a big part of the company.
So my, at the time, the CEO of the company asked, hey, do you want a startup spinoff of our company?
Just focus on software.
So I did that.
That sounds like a pretty fun challenge.
Yes.
Like do a startup without quite the risk of actually being a startup.
Yeah.
Yes.
Like you're going to get paid.
You know what I mean?
Yes.
You're going to get paid.
It also, I think the startup reality in Italy, I was still in Italy at the time, is very different from here.
It's really hard to have investors or, you know, to have, to collect money.
And basically you need to, it boils down to you investing on yourself, in your own company, and then trying to get profit within a number of years.
Okay.
It's got to be way more bootstrapped, self-funded, you know, sort of thing, huh?
Okay.
Yeah.
Do you think that's changed or is that still the same?
I think it's changing.
Yeah.
The last 10 years, I think a lot changed just from like the industry in general became way stronger in Europe as well.
There's a different mindset.
And I think culturally, South Europe has this culture of a different way to see money and investments compared to the US, for instance.
Sure.
But eventually, like this experience led me to the Python community early on.
I actually got into Python not by myself.
I heard about the language.
I was curious.
But someone within the company said, oh, we, you know, the son of this customer is really big in the Python community.
He could help us see if it's a good fit for our use case.
And it was around early 2000s.
And it was around early 2000s, maybe 2002, one.
Pretty early days of Python, really.
Yes.
And early days of, you know, scientific Python as well.
You know, the whole separation between Numerae and NumPy, numeric, all of that.
So I started.
I loved the language.
I started to use it in our tools.
It was a funny time where it was definitely unknown as a language.
And to get into big companies, it was a little tricky on the QA point of view.
And then, but it was interesting.
Eventually, I started to get more engaged with community, started to go to meetups in Italy and everything.
And then I think it was around 2004 or 2005, I started to go to my first conferences in Europe, love the community, started to, how can I get involved?
So at that point, later, late 2000s, I started the, with a bunch of friends in the Italian community, we started the Python Italia Association, which is basically nonprofit trying to push the language.
And the main focus was organizing the Python Italy conference.
We started in 2007.
Also that great, great community, a lot of work, but also paid back.
I remember the first year we were like, let's do this thing.
We were very passionate.
And we ended up in negative.
And all the members of the society.
Yes.
So just to say that big props to everyone in the community doing a lot of the community work, because it's a lot of work and it often is not paid or can even be out of each one.
You might have to pay to do the work.
Yes.
With the opposite of getting paid.
Yeah.
Long story short, I started to be also more engaged with the European community.
And we organized the European Python in 2011.
So for three years in a row.
And that got me into the European society.
Eventually became chairman of that, which basically means your Python society is this European nonprofit that pretty much in line with the PSF, tried in different ways, but tries to engage with community, organize conferences, raise some money to invest back in the community through grants and things like this.
And then I did that for a number of years.
So eventually, well, back in the day when I was starting to learn Python, I also started to use a lot of the scientific libraries.
And one of them was Chaco, which was a graphic plotting library for Python that Peter Wang developed with Brian VandenVen.
I think he was in the show.
Peter Wang being the CEO of Anaconda.
Yes, today, CEO of Anaconda.
And we met for the first time in person at Europython in Florence.
And he was like, okay, we know each other from the internet for a while.
Let's get more involved.
That year, I was still trying to make my company be successful.
It wasn't the right time.
The following year, I met with Travis Oliphant, the other founder of Anaconda in Berlin.
We just figured out, you know, like we're doing a lot of things that are similar.
We're passionate about the same thing.
So I eventually joined Anaconda in 2014.
And then eventually that following year, I moved to the U.S.
I joined the company full time.
Fantastic.
Well, it's quite the journey.
Yes.
This is interesting language.
Let me just start participating in some of the meetups.
Meetups become conferences.
Conference become continent-wide conferences.
And I think it's a pretty good takeaway for people who want to get more involved in the community.
And like every one of those steps probably didn't feel massive other than maybe moving to the U.S.
and joining Anaconda.
But, you know, they all probably seem like really iterative and sort of incremental.
But at the same time, it builds up to this really cool place where you're maybe building amazing Python things in the browser at Anaconda.
Right.
Yeah.
My experience has very much been what, you know, a lot of people say.
You come from the language, you stay for the community.
That is really my experience.
Yeah.
And then, yeah.
Anaconda allowed me to work on a lot of interesting things.
Like, as you said, Python in the browser is the ultimate project.
But when I joined, I started with being a core developer for Bokeh, which had some of that.
Bokeh is a visualization library for Python on the browser.
And with your project you have now, you can still put Bokeh in the browser.
Exactly.
It can stay in the browser.
Exactly.
Yes, exactly.
Even more in the browser than before, I guess.
Yeah.
All right.
Let's dive in.
Now, before we dive in real quick, since you talked about gaming, want to be in game development and your brother and so on.
Have you watched the documentary Power On, the story of Xbox?
I haven't.
No.
This is a documentary that came out.
It's a four-hour show.
You can watch it on YouTube.
Cool.
And it's like the history of Xbox.
Nice.
And if you're just into, like, tech history documentaries, this thing is pretty interesting.
But let's not talk about games.
Let's talk about the birth and death of JavaScript.
Have you seen this presentation?
Yes.
Great.
It is so good, isn't it?
Yes.
One of my favorite funny talks, you know.
The reason I bring this up is there's a lot of interesting building blocks that I suspect many people in the Python community are fully unaware of.
There's been all these developments over in the JavaScript world.
And Gary Bernhardt did this talk at PyCon 2014, the birth and death of JavaScript.
And no, I'm not mispronouncing it.
That's how it's done in the talk.
It tells this hilarious story of the future of, like, weird human evolution and programming and JavaScript and how we don't do JavaScript, but everything's JavaScript.
But what is the underlying theme is, like, an actual interesting technical history, how people started doing crazy stuff with JavaScript pre-WebAssembly.
So there were compilers, like in Scriptum, that will compile C code to JavaScript.
And then the JavaScript JITs have become so fast.
So one of the examples was, like, Chrome running Firefox, running something else, like maybe like an embedded Windows.
I can't remember what it was.
But just there were, like, layers and layers of JavaScript doing wild stuff that we wouldn't imagine otherwise, right?
Yeah.
And I think that's part of also one of the reasons with Peter we said, OK, this is the right time to try this out because the browsers became so powerful.
And so they are basically, if you see from a different perspective, they are mini virtual machines.
They have their own file system.
They have their own isolation networking.
A lot of the things, you can really see that as a VM.
Like the JVM, like the .NET CLR, and to some degree, like Python, right?
Right.
The CPython on a regular machine.
Yeah.
You can run full operating systems on top of, in the browser.
And honestly, the explosion of interesting things in the last few years have been crazy and doesn't seem to decelerate at all.
So the level of maturity is kind of encouraging.
It is.
And the performance, while not native performance, is not that far off.
At least some of the examples that Gary gave, it was like 50%.
You could run Doom at 50% speed when you compile it to the browser or something insane like that.
Right.
Yeah.
It's good enough.
It's more than good enough.
Yeah.
I mean, because the alternative so often is, well, we're going to send a request over to the server, and that might be native and fast, but it's also network latency, and it's also a shared compute resource.
With a thousand other people.
And here you are sitting on your MacBook Pro Max with 16 cores, and you're just waiting.
Yeah.
That's actually one aspect that a lot of people don't consider.
There is the performance in terms of how fast it goes.
But there are a few aspects that you also need to consider overall in the overall experience.
How long for the developer side of a point of view, how long before they can actually get in front of something usable or spinning up their environments and things like this.
Then there's loading time versus execution time.
Also very different.
But from the eyes of the user, it kind of sums up.
There are so many small niches or small verticals that we can work on in the whole JavaScript or browser ecosystem that I think we can make a lot of improvements the next few years.
Yeah.
You think of grid computing and distributed computing, part of the power of the cloud is that I could just go say, I need more.
We have four servers, but a bunch of people showed up.
So give me 20 servers and scale my Kubernetes cluster across that for now.
And four to 20 is amazing.
But four to 100 million is really different.
If we can push a lot of that compute to everybody's personal computers, even our iPhones are like unimaginably fast little devices.
Right.
Like the whole M1 crazy transition is basically an iPhone chip with more voltage, you know, and better cooling.
Right.
There's not much more to it than that.
So finding ways to execute more of our code on the clients is pretty interesting.
Yeah.
Totally agree.
We already see that even on the server side, projects like BASC, where very popular pushing computing on nodes and, you know, the distributed architecture is very powerful and it is needed.
We can have the possibility to make the same thing on the client side on the browser as well.
Yeah.
DESC, for those out there who don't know, is a Pandas-like, NumPy-like API that you can just say, but run it distributed across these machines on the cluster automatically.
You know, Matthew Rocklin started Coiled and, you know, former Anaconda alumni.
A lot of tie-ins there.
Yeah.
Cool.
It's not the same thing in any way, but it is a way that really takes Python and gives it way more compute resources potentially.
So are there any particular sort of set the stage with this compile-to-see and stuff, but is there any other sort of building blocks in the history of how we got to what you all built in the JavaScript stack that you want to call out?
Yes, definitely.
I think one major thing that, you know, I want to give props as much as we can, the Pyodide project, which is, you know, a runtime for Python on the browser.
And they've been extremely, like, one of the reasons we could work on PyScript was because it has a level of maturity and performance right now that is really stable, right?
And actually also been, they're a great community, very supportive.
So a big shout out to them, Hood and Roman specifically, the two main core developers.
And the whole work underneath that project as well, you know, like the progress of the MScript and WASM and WebAssembly, there is a huge community behind that.
So actually, that's one of the principles that we try to, at the core of PyScript, is we don't want to reinvent anything that we don't need.
We want to be really additive to the ecosystem, glue things together, provide nice and easy APIs and high-level APIs so that we can lower the barrier, basically give more accessibility to the tools, to the users, rather than reinventing something that's not needed.
Yeah, so PyIodide.
This project is a cool project.
I interviewed Michael from the project about this way, way back, a couple years ago.
But yeah, it uses this MScript and WebAssembly story to basically compile a port of CPython to run in WebAssembly in the browser, which is fantastic, right?
I mean, that's, and to some degree, that's the building block that you all really needed, right?
Yes, yeah.
Yeah, definitely.
Yeah.
I must mention also, yeah, Michael Dropbom and Christian Himes, who has been also pushing a lot of the Python on WASM ecosystem.
Yes.
Yeah.
There's a lot of good energy in the Python community to actually try to push that together, right?
Yeah.
And also Brett Cannon has been a big proponent of making that happen.
I don't know how directly he evolved with the day-to-day, like, let's make it compile, but I know he's been really pushing on that effort as well.
This portion of Talk Python to Me is brought to you by Microsoft for Startups Founders Hub.
Starting a business is hard. By some estimates, over 90% of startups will go out of business in
just their first year. With that in mind, Microsoft for Startups set out to understand
what startups need to be successful and to create a digital platform to help them overcome those
challenges. Microsoft for Startups Founders Hub was born. Founders Hub provides all founders at
any stage with free resources to solve their startup challenges. The platform provides technology
benefits, access to expert guidance and skilled resources, mentorship and networking connections,
and much more. Unlike others in the industry, Microsoft for Startups Founders Hub doesn't
require startups to be investor-backed or third-party validated to participate. Founders Hub is truly open
to all. So what do you get if you join them? You speed up your development with free access to
GitHub and Microsoft Cloud computing resources and the ability to unlock more credits over time.
To help your startup innovate, Founders Hub is partnering with innovative companies like OpenAI,
a global leader in AI research and development, to provide exclusive benefits and discounts.
Through Microsoft for Startups Founders Hub, becoming a founder is no longer about who you know.
You'll have access to their mentorship network, giving you a pool of hundreds of mentors across a range
of disciplines and areas like idea validation, fundraising, management and coaching, sales and
marketing, as well as specific technical stress points. You'll be able to book a one-on-one meeting
with the mentors, many of whom are former founders themselves. Make your idea a reality today with the
critical support you'll get from Founders Hub. To join the program, just visit talkpython.fm slash
foundershub, all one word, no links in your show notes. Thank you to Microsoft for supporting the show.
Let's get to your announcement. I mean, I didn't go to PyCon this year, mostly just not ready to be in a
room with people from around the world for that long and to give the world a chance to try it out,
then I'll see how it goes and do it next year. But I missed everyone there. And, but I got a lot of
messages. One was friends saying, why aren't you here? Why can't we have a beer together? Which,
sorry, I really missed that. And then the other is, have you heard of PyScript? Oh my goodness,
this was the announcement. Like this, if there's any big piece of news that came out from presentations
and talks and announcements, like this is the one. So PyScript, people can guess, but what is it?
Tell us about this. So PyScript is a framework that allows users to basically use HTML tags to define,
to run Python code and define different components. Those can be related to executing code, but also
providing, defining your environments, what packages you want to install, et cetera, as well as some UI
components that make things easier for users that are not familiar with HTML and CSS and all the styling
of things. It's based on a Python runtime, which is Pyodide that allows Python execution on the browser.
And it has interoperability capabilities with JavaScript as well. So you can use both Python libraries as well
as JavaScript libraries in your code.
Yeah. This is really great. And if people go to PyScript.net and scroll down and what is PyScript,
it really calls all these out. Like if you're trying to present this to your boss or your team,
you're like, this is something cool we should check out. Like they should definitely go to that list
right there. Yeah.
Yes. Yeah. That is, you know, the most immediate list of things. You know, there's a lot that we're
working on and trying to provide as a tooling, but it's very, very new and very, you know, green,
if I must say. So yeah.
So maybe don't totally release a product on it just yet.
Yes. Definitely. Very bad idea to release a product. This, you know, expect APIs, code and features to change.
Actually, it's one of the things that we intentionally talked about before Python was, you know, should we have a versioning in place or something like this so that, you know, you would expect any project to go that goes out there to have versions and everything.
Yeah. Yeah. So we intentionally said, no, let's wait because it is, or let's put a version like do not use in production dot zero dot one.
Zero dot zero dot zero dot negative one.
Yes. Mostly because, you know, with this, we want, we wanted to have something that is working, that is useful, that it can be used by and hacked on by users that they want, but also give the vision that we have in mind and for people to see the possibilities.
And that was the main focus for the project until Python.
Right.
Now, a lot of the following things are just the things that we want to achieve in order to enable a community.
And this is an open source project.
It's not an, it started at Anaconda, but it's an open source project.
We want to have a strong community, have contributors beyond the Anaconda team and build it together.
Yeah. That was one of my questions I wanted to ask you about is it sounds like you all have a very strong vision of what this should be and where you want it to go.
Yes.
But from what you just said, it's, I was wondering, does that mean it's more source open than open source?
And like, we're driving this way and we'll take PRs as long as it's on our, our roadmap or how open are you to people just jumping in and giving ideas and trying to build it up?
Oh, yeah. Great question. We are very open. So it's worth also saying that right now we are at the stage where I don't think we've made it that easy for people to onboard and understand the vision, understand the project, and actually be able to contribute.
We're missing a lot of documentation. So one of the biggest pushes that we we've been having after PyCon is to actually build up the documentation around those things so that anyone contributing have a easier time onboarding, understand the visions, and can give feedback based on those things.
So as soon as we are also growing the team behind it that so there's a lot of small things that we are preparing for the being a community that is on itself or self organized and everything.
So overall, I think that this is really a community project.
Sure. Speaking of community, let me just pull up the GitHub page. So you're just shy of 10,000 stars.
Yeah, crazy.
That's, I don't know how old it is, but it's how long is this repo been public? Not that long, right?
We actually made it public 10 minutes in during Peter's talk.
Okay. So you're like half of Flask almost or half of closing in on FastAPI levels of numbers of stars. There's a lot of interest in this.
Yes, which is really exciting, but also is somehow overwhelming, right? Like I'll be very honest.
There's a lot of expectations as well, right?
Yes. Yes. And so we are aware of all of that. I think the main thing really for us is to, you know,
we want to make sure that our users have patience because we're trying to get to a stable state or at least, you know.
It's less than two weeks old. Come on.
Exactly. Yes.
It's a baby.
Yeah. I could talk about this for hours. But at the same time, we want to make sure that it's usable and we want to collect users' feedback to make it better.
Actually, one thing that is very important is that it got a lot of interest and a lot of excitement from the Python community and some of the web community as well.
But I really want to make sure that everyone understands the picture. The full picture is what Peter said, like programming for the 99%.
So beyond developers, how can we have a tool that students can learn very fast, get to learning coding very fast or even non-developers?
I would love my mom to write her recipe book with PyScrime, right? Because it's that easy.
Yeah.
And thinking about the possibility of shipping that in your phone or your mobile users in developing countries that do not have access to computers and things like this, but they have a phone.
What we also hope is that the social impact of a tool like this could be very big. One can dream.
Yeah. Yeah. One can dream for sure. So something maybe you could take inspiration from is the Swift Playgrounds, right? It seems like you can model that pretty well.
And I feel like Swift was largely borrowing from Python in a lot of its ways. So it's time to borrow a little back from Swift.
Yes.
For people who don't know, Swift Playgrounds is like a little bit like a REPL, a little bit like Jupyter.
But then on the right, you get kind of more iOS outputs, like little widgets and graphs and animations and whatever.
But it seems like that could be a similar way that's sort of like Jupyter, but also a little more web playful.
Right. Yes. And I would say we have no shame into like borrowing from others, right?
I think that actually is how you can grow well.
Like take what's successful from this community or this language, et cetera, and try to use that to make a better tool.
Yeah. Because it's so early, because it's so fresh.
Like one of the drawbacks, call it a drawback, one of the temporary limitations is people can't just jump in and build the next version of Gmail or whatever with it right now.
But a benefit is so many people want to contribute to open source and they're like, I love Django.
I'm going to contribute to that. Or I love Jupyter. I want to contribute to that.
And then it's such a complex, highly leveraged, very polished system that like, well, contributing to that means you have like an insane level of understanding to make this little change that won't break everything else.
Whereas this is pretty fresh, right? So if somebody wants to come along and build something like a Swift Playground equivalent, the door is open for, and I'm not sure how much you want to accept that, but like the door is open for people to be, to grab ideas that are lower hanging fruit at the moment.
Yeah. The idea is also to allow users to extend the tool itself and without having to change the tool, like with extensions and things like this.
Like in my mind, I see that as a sort of Minecraft for programmers, right? Like you can view your own blocks and then share with others and then they can share, they can.
Right. I can check out my mod pack for this thing or whatever.
Yeah. Yeah. Yeah. And yeah, the idea is to make it well, powerful, but also fun and hackable.
Yeah. Very cool. All right. Now let's talk about, I know we talked to some of these things here, but let me just dive in a little bit on the bullet points to kind of do a wrap up summary before we move into the coding.
So Python in the browser, this means it runs 100% in the browser through primarily WebAssembly, which is leveraging the Pyodide project. Yeah.
Right. That's right. Okay. And the WebAssembly stuff runs, I think, even better than the JavaScript.
The C code compiled to JavaScript because this is still more of a binary form and whatnot.
That's pretty excellent. One of the things that really inspires me here, you spoke about this will allow us to do things on our phones and on lower end computers and do other things like that.
where like now we have this possibility
just if you have a browser, you can kind of do it.
I totally agree and that's great.
But what really gets me excited about where this could go
is progressive web apps
or something even like Electron.js, right?
Where I build like a true desktop application
like VS Code or Slack or whatever,
but instead of having to write everything in JavaScript,
you know, write it in Python, right?
And just got to include the 2 meg or 3 meg WASM file
with your, what is already a massive Chrome distribution.
So no one would know anyway.
Right.
Anyways, all right.
So yeah, the estimation.
Think about this, like there's a way to sort of,
this is what I was hinting at at the beginning as well.
Like, oh my gosh, we can have things in our doc
that are like modern looking,
that are based on Python easily.
Very exciting.
Yes.
Or Taskbar if you're a Windows person.
Right.
The whole story about the native apps
and mobile and whatnot.
Russell Keith McGee, maintainer of beware,
is he just joined Anaconda a few months ago.
Oh, he did?
Okay.
I didn't know that.
Excellent.
Yes.
And he's been sort of looking at the project,
collaborating, contributing with some stuff.
He actually made an example.
One of the examples is written in Toga,
which is the beware toolkit for UI design
and stuff like this.
And it's built in Toga,
but has a PyScript backend
so that it can render to PyScript directly.
Pretty much like it can build for iOS or Android or Mac.
But another interesting story is the opposite, right?
Like, can we have an app,
a PyScript app that then Toga can transform
into an electron-like app
that you can just run on your mobile?
Lots of possibilities.
Please do it.
Do it.
So many people would be happy, yeah.
Yeah.
If you're listening, that's for you.
Yes.
Oh, my goodness.
Look, I think there are plenty of negatives
about electron apps.
Like, why does my password manager
need 400 megs of RAM to run?
But we have such a limited set of options
for desktop and mobile apps and Python
that for now, that would be massively welcome
to do something like this.
And then there's always possibilities of,
well, do you actually have to ship Chrome
in some like massive runtime
or could there be a smaller host, right?
Like there's layers of improvement.
All right, next one, Python ecosystem.
When you think about the history,
this is not the first or the second time
that someone has done Python in the browser.
Like if you're familiar with,
are you familiar with Anvil?
Yes.
I had Meredith on from Anvil
to talk about both Anvil one time
and then I think it was Sculpt,
which is what they use.
And Anvil has both a back end and front end
that's all Python.
A really interesting project.
And they were using a JavaScript variant
called Sculpt.
And there's, I think,
Brython is another one that you could choose.
But one of the challenges of that
is it's Python-like, right?
It's not really the Python runtime.
Do you maybe want to talk about
like how that differs from the Python ecosystem,
Python runtime that you all have?
Right.
That's exactly the difference, right?
And probably the Pyodide folks
would have a lot more to say.
But the big difference is what you said.
Like it's Python-like.
For example, numerically,
like JavaScript doesn't have integers.
So your Python has to somehow fake integers
if you're going to do things like that, right?
Right.
It's mimicking what you would expect with Python,
but with the JavaScript.
And it's not really a full-blown Python interpreter
that you can also install your packages.
The whole Python ecosystem is not supported.
And I think that's the big difference
that was the differentiator for Pyodide.
And now that, you know,
CPython actually compiles to Asm through M-Scripten,
it's very exciting that we can...
Is running the same VM or the same runtime
that we get with CPython on our desktops,
more or less, like a cut-down limited version,
but it's not like a weird transpile to JavaScript
and then run it.
Yes, correct.
With a few caveats, right?
That's one of the things that I think is worth mentioning.
It's the same CPython code,
and it's the same thing you get in your local installation.
A few things are different
just because the browser as a VM,
they work differently, right?
Like file system is different on the browser.
Sockets are different.
Threading, probably.
Threading, multiprocessing,
pipes, and things like this, right?
There are solutions for some of these
that will require work
and probably upstream
with some of the parts of the standard libraries
or the third-party packages,
but they are just different.
So we need to account for that.
Sure.
All right.
So you can use, it says,
many popular Python packages
and stuff in the scientific data stack.
Question from the audience,
from Christopher Tyler says,
my very limited understanding,
since you're using PyDyde,
is that there's a limitation
on the libraries you can use,
meaning can you import your own custom libraries?
Generally, it's yes, right?
But not universally, isn't it?
Right.
That's a great question.
Let's talk first about the standard libraries
and the third-party libraries
that you have on PyPI, et cetera.
So PyDyde ships with the standard library
plus a set of packages that they ported.
Most of these are,
they use C extensions and things like that.
So they need to be compiled.
And so the PyDyde team took that work
and took care of it.
They're included in the distribution.
There is a way for you to also build packages
that depend on C extensions.
They have a nice guide in their website
that you can follow,
and they will help with that.
In general,
you should expect your Python packages to work
if you hip install them, right?
Yeah.
The caveat there is,
do they have other dependencies
that are C,
depend on C extensions,
and that will cascade in what work?
Or do they rely on some of the things
that I mentioned before,
like multi-threat,
multi-processing,
and sockets and stuff?
So in that case,
the package may install,
but it will raise an error
because multi-processing is not supported
or other things like this.
What about simple stuff like async and await?
Great question.
It's not from a,
like,
what it expects of the operating system
is pretty low,
but it's also pretty advanced.
Right.
That is more of,
I think it's less of the packaging problem
and more of a philosophical problem
in terms of how you compare Python
to JavaScript, for instance, right?
JavaScript,
even if it's synchronous as a language,
it has built the idioms over time
to always try to be asynchronous
because for obvious reasons,
you don't want to,
you don't want to block your browser
or, you know,
if you're doing something in your page
and you block your Chrome on your phone.
And that way,
it seems like it should be a fantastic match
for async and await.
Yes.
The waiting on I.O., yeah.
Yes.
It is a fantastic match
and almost everything that you do
that would be blocking in JavaScript,
you would async await.
In Python,
we are used to do everything blocking
and then when we want to do explicitly,
we just,
we use async.io
or something different.
So I think on that side of things,
it's more of a,
how you develop your Python code
rather than the language and the package.
You might have to have a mental model
that matches closer to like
what JavaScript traditionally has.
Yes.
Yeah.
But, you know,
you can use async await
anywhere in your code
in Pyodide and PyScript.
Oh, sweet.
Okay.
I should have started on this list here
40 minutes ago.
But next question from Roller is,
how would I pip install something
into PyScript?
Which is, you know,
a follow-up from what Chris asked
in this like Python ecosystem integration.
Clearly, pip install a thing
is like got to be at least 30%
why Python is so popular.
Right.
Yeah.
Not commenting on the packaging
for Python or JavaScript.
And they all,
we all know that
most people don't have problems with them.
They all have idiosyncrasies,
let's say.
They all got their weirdnesses.
Right.
So Pyodide itself
allows you to use MicroPip,
which is,
we will pip install
your dependencies.
Is it like an NPM-like thing
where it creates like,
instead of a node module,
it creates something else?
Yeah.
It's like NPM,
or it's more like pip
really for Python.
And it will go,
and if it's a package
provided by Pyodide itself,
we will load that package
for you.
If it's a package
that is not available there,
it will check on IPI.
And you can also specify
the location of the package itself.
So if you have your own repository,
but you have your URL
that points to a wheel file
or a zip file,
it will install from there.
Yeah.
And that wheel can be remote,
just like you might have
a CDN-pointed thing
for JavaScript.
Yes.
Like, here's my wheel.
Okay.
Yeah.
If it's pure Python, right?
If it's C,
then all bets are off.
If it's C,
you should have done your duty
and ported it
to WebAssembly.
But the PyScript
provides a layer
on top of that
where you can specify
a tag called PyEnv
and it accepts CMO format
and you can specify
your dependencies there
and both for packages
and also has
an extra key called paths
where you can actually provide
the link to your modules,
custom modules
that you want to...
effectively like the working
directory of your Python.
So when you type
import filename
or directory slash filename,
it kind of mirrors that
to the browser, right?
Yes, exactly that.
If you know how Python works,
it's basically adding
those files to your syspath.
So it finds them.
Interesting.
Yeah.
Cool, cool.
All right.
Another one that's really important here
is Python with JavaScript.
So it's not like you're locked
into this PyScript little box, right?
What I think this is another thing
that makes me very optimistic
for the future is
you can communicate back
to other JavaScript,
to JavaScript events,
button clicks to the DOM.
So if here's another dream
that I have is something
like a Vue.js wrapper
type of thing
that I could do in Python
and then do sort of model binding
or attribute binding
to the DOM
and have that sort of stuff happening.
And this is really important
to make it a first class citizen
that can work with
all the stuff on the page.
not like a canvas
that was given or something.
Yeah.
So before I go into this,
I want to plus one
on what you said
around reactive
sort of programming
and components
where they can be attributes
that auto notify
others' elements.
That is definitely something
that we would love
to explore more.
And there's a lot of interest.
And on the Python
with JavaScript side of things,
I, after the keynote
at PyCon,
I saw a lot of videos
coming up with like,
oh, is JavaScript that
now that Python
can run on the browser
and things like this.
I think that narrative
kind of looks at
one side versus the other
where we,
what we really want to encourage
is actually the two together.
There is a ton
of really great libraries
in JavaScript.
And there is a level
of maturity in JavaScript
on things on the browser
or UI creation
or, you know,
drawing on Canvas
or on the page
that we are nowhere close
to the 1% in Python.
And all of a sudden,
you can use those tools
in Python and vice versa.
All of a sudden,
JavaScript users
could use NumPy
or SciPy
and other things
to power their applications, right?
Wow, that's interesting.
I hadn't really thought
about the benefit others
like outside of Python
people may be receiving.
But yeah,
now Python becomes a thing
so they could leverage.
Yeah, exactly.
I think if we start
looking at this that way,
then you can see
how PyScript is a glue
for building
reacher applications,
depending,
like independently
if you're a JavaScript developer
or a Python developer.
And we are starting
with Python.
It makes a lot of sense.
But if there is
a Rust implementation
on WASM
or an R,
I'm sure
that the Python
scientific community
would love to
use R tools
in the page
with Python stuff
and maybe JavaScript
as well, right?
Yeah.
I think it's
building together
kind of movement
that we want to push forward.
Yeah.
If I can look out
and imagine a future,
I don't know
that there's a chance
how much it would exist,
but a really great future
of like,
well,
we have WebAssembly.
What if we really
made WebAssembly
more of a
first-class citizen
from a browser maker
perspective?
one thing
I think would be
fantastic is
if instead of
getting to the DOM
through JavaScript
and through the events
through JavaScript
is if all of the
browser makers said,
here's a WebAssembly
native thing
that you can use
to bind to the DOM
and to the events
and basically control it,
you know,
you could have
Rust in the browser,
Python in the browser,
C# in the browser,
and they could all have
this common API
defined in
maybe even
an adapter type thing
like,
well,
in C#
it's classes
and in Python
it's,
you know,
Lambdas,
I don't know,
whatever,
right?
Like some variation
that's more native
to your world,
but if there was
some kind of interaction
that we could build on,
that would be even better,
but we don't have that,
so this integration
with JavaScript
and all of its
modern features
is fantastic.
You still would want that,
but it would be nice
if there was a way,
just put Python aside,
like if I'm doing
WebAssembly stuff
that I could stay
in WebAssembly,
stay native
to interact more
with the browser.
Yeah,
and honestly,
the interaction
between the WebAssembly
part of it
and JavaScript,
it's very fast.
You know,
I want to highlight
one thing that you said.
A lot of the future
and how can this improve
is on the,
you know,
browser folks to...
It's on the vendors,
yeah,
it's on the shoulders
to do it.
Yes,
because like
the huge bottleneck
that we have right now
is that you still,
like when you load
your things,
you still need
to compile them
and run them
in WebAssembly.
So there's a loading time
right now
is very high
and we're working
on optimizing things
and there's a lot
of great work
from the CPython folks
and the Pyodide folks
to reduce the size
of things that you're shipping
by default.
But ultimately,
if you have a large
scientific application,
you still want to install
NumPy
and Vokey
and other stuff like this
and you will have
a loading time.
There is a loading time
and, you know,
I think that might mean
it doesn't make sense
for the homepage
of Reddit
or like your marketing page
that needs to load
super fast
to have
to be implemented in this.
But if you're writing
something like
Google Maps,
Gmail,
like I go to those sites
and then they spin
and spin and spin
for three seconds
already,
you know,
like the first time
you hit that,
it does that.
The second time
it would just be cached.
Right?
All the stuff is off.
The WebAssembly stuff
is just off disk
and if your expectation
is this page
might take two seconds
to load sometimes,
you're good,
I think, honestly.
Yeah.
All that to say
like this is the current state,
right?
I think there's a huge
margin for improvement
in the future
and a lot of really great
people are looking at it.
Yeah.
Okay.
I agree
and I think the momentum
is just building.
So let's look at some code
and some examples
so we can make this concrete
for people over audio,
which is tricky,
but let's do it anyway.
So you've got the GitHub page
which has a bunch of examples
and so what I want to do
is kind of just pull up
some of the examples here
and let me remind myself
what they are called.
Let's do this one first,
actually.
I want to look at anti-gravity.
So we all know the xkcd
and if you go to the REPL
and Python
you type import anti-gravity,
amazing stuff happens.
And so here we have that
equivalent in PyScript,
but there's a couple of things
that are really interesting
about this.
So let's pull this up.
It says based on this thing
and you give it a second
and it says,
the xkcd is,
how are you flying?
There's someone up there flying.
They're like,
Python,
I just imported anti-gravity,
right?
It's great.
But this is a variation.
Maybe describe what just happened
on the screen here.
People can go to the demo
and watch it,
of course.
This is,
yeah.
If they just check out the repo.
This is a great,
great example
done by Philip Rudiger,
his core contributor
to PyScript
but also contributor
to Panel,
the Holovie,
he's done a lot
of great stuff.
And what's happening here
is we're loading
the SVG first
and then there's
another Python function
that basically takes
that statement
and makes it float
but basically changing
coordinates.
literally animates
and flies up
into the sky.
Like it really takes off
not just it's up there,
right?
Yes, yes.
And for anyone
wanting to check them out,
the examples
are also available
on pyScript.net
slash examples
and you can run them.
They are, okay.
Directly there.
Interesting.
We'll link to that as well.
So I said this is interesting.
It's interesting
for several reasons.
One,
if I go and look
at my task manager
in Vivaldi,
this is doing like
30% CPU
constantly refreshing.
I don't know
what the frame rate is
but it seems certainly
passable in terms of
there's cool animations
going on
on this rendering
this canvas
and it looks good, right?
It doesn't seem like
oh, this just isn't
going to work.
It's like the person
doesn't like glitch.
Right, right.
You know what I mean?
Yeah.
The other one is
it highlights many
of the things
that I think are
pretty interesting here.
Let me pull up
the code for the example
and this maybe
will give us a chance
to talk through
the programming model.
So first of all,
the first thing
that's interesting
is it has this
pyenv section
and you have
people maybe
have seen examples
and if you go
to the home screen
you can actually
the pyscript.net
it says
there's new tag
done through web components
called py-script
instead of just script
and you can just
write Python code
directly in the browser
but you only want to do
that for so long
until you want to
read it across
a couple pages
or whatever.
So what's really cool
here is the
implementation of this
is actually a custom
Python file
on the server, right?
Yeah, exactly.
We've been working
on that
for some time
the design of this
because as you said
there's a tension
between allowing people
to just drop things
in the page
and then have your
Python code there
and it just works
to also
suggesting
better patterns
to do this.
Like you definitely
don't
from a quality
point of view
it's really hard
to test anything
that you just drop
on the page
you know
a readability
point of view
or refactor it
or anything, right?
Right, right.
But at the same time
we really want this
to be
something that people
can play with
and hack with
and then don't have
too much to think
to think about
oh I need a file
I need to name it
Python
you know all of that.
If there was a
npm install step
and then there was
a compile step
and then a pack step
like you would shave off
like 75% of the people
who just wanted
to check it out.
Right.
So we allowed
this pattern
but you could also say
like the same code
could be
the same thing
in PyM
and then in PyScript
you could also have
PyScript source equals
in a Python file
so you can run that
from files as well.
Right, yeah.
So just like
with the regular script tag
you say source
and it can do a thing
on startup
you know like
jQuery did it
$document.ready
hook right at the top
all the time
like you could do
the equivalent
of something like that.
Okay, this is cool
but this is only part of it
let me open up
the other file
the antigravity.py
and this is the one
this is the one
that made me really happy
because when I look at this
it's
you know how is that
animation happening right?
What you do is
you set a timer
do a callback
you know where you are
in JavaScript
and it goes
click, click, click, click, click
let's see how often
are you doing this?
Do you remember
what the target
frame rate was here?
I don't remember.
Yeah, anyway
there's some sort of time
where you say
run it this frequently
and basically
what you do
is you go over here
and you say
this is Python
you say document
get element by ID
alright
first of all
awesome
with a ternary expression
and then
you go
and
add
through the DOM parser
you add
the SVG in there
that's amazing
you do a replace child
with some HTML stuff
and then
you go
and you hook
the set interval
so set interval
is the way to say
set a callback
on a timer
in JavaScript
and
then you just call
the Python function
self.move
right?
So there's a really
cool interaction
between JavaScript
that's happening
at a high
frequency
that shows
do some stuff
in Python
go over to JavaScript
go through the DOM
and then call back
into Python
when things that are
interesting happen
here is an interval
but it could be
a button click
or a drop down
select
or whatever
right?
Right
right
and
we're doing
some work
right now
at
providing
a higher level
interface
that would
be more
Pythonic
to those
JavaScript
you know
the usual
things that you
would always
do in JavaScript
like selecting
an element
by ID
or class
or things
like this
like a CSS
selector
sort of
right
model
or something
yeah
exactly
so I think
the goal
is to provide
the simplest
and more
expressive
or Pythonic
interface
that we
could
to hide
some of
that
complexity
because
at the end
a lot of
Python users
or new users
will have to end up
learning about
JavaScript itself
right
I didn't want to learn
JavaScript
and here I am
learning JavaScript
I think what you're
learning though
is not
you're not learning
JavaScript
what you're
learning is
the DOM
API
the APIs
that JavaScript
often consumes
right
correct
right
you have to
learn that
the DOM
has a
get element
by tag
name
rather than
I have to
say
I can't
say var
anymore
var
char
they have
to say
let
or else
that'll
complain
you know
what I mean
like
you're not
learning
the language
nuances
but you are
learning the
APIs
that JavaScript
people are
very common
familiar
with
and it's
a great
point
like
another
thing
for instance
the set
interval
could be
replaced
with
full
Python
and just
say
like
from
asyncio
important
sleep
you know
time sleep
and then
while
just do a loop
and asyncio
wait
interesting
no kidding
okay
like a while
true
exactly
await sleep
then move
okay
yeah this is
really really
neat
I think
this example
is so simple
it's playful
and it's not
just
we put a graph
on the page
not to say
that that's
not important
but it's
different
than what
we've seen
before
often
yeah
honestly
I really
props to
to fill
it like
in I don't
know what
50 lines
of code
or 40 lines
of code
yeah like
yeah 45
for the entire
implementation
of a flying
anti-gravity
right
SKCV
pretty neat
yeah
and in Python
those are not
45 lines
of JavaScript
right
cool
okay
audience question
Marcel
says
would it accept
loading data
from a file
for processing
like you know
we're pulling
in modules
but like
what's the
data story
that's a
really really
great question
I think the
data story
is yet to be
told
we're
dedicating a
lot of effort
to that
right now
you can
you can load
data using
fetch
basically
and you can
fetch data
and then read
just like normal
files
PyDite provides
a PyFetch
wrapper around
the JavaScript
fetch
but there
is a lot
that can be
done
and we are
working on it
to have
better support
and just
how does the
story for
larger files
look like
can I do
a panda
read CSV
and give
it a URL
or something
like that
that's a
great question
I'm not
sure
I don't
know
yeah I
don't know
I have no
idea I really
just wondering
yeah
yeah but
yeah that's
one of the
stories that
I think
is needs
more development
right now
you can pull
files and read
them with that
method but
there's more
work to be
done there
yeah
okay let's
look at another
demo here
let's see
give me
so good
okay
this one's
interesting too
this panel
I think it's
panel stream
is the one
and this
is one of
those that
is gonna
take some
time to
load
because
under the
hood it's
installing
panel
and installing
bokeh I
think and
other visualization
libraries that
are heavier
right right
right so
well let's try it a
second time right
so
what do you
guess seven or
eight seconds
maybe it took
that first time
but if I
hit it again
it says it
downloaded 3.6
megs
yeah
tick tock
you should
have cached
most of the
things that you
compiled
but also if
you have
if you set
your browser
to not
cache it
will not
change anything
yeah well I
think the
the challenge
is that I'm
using just
python-m
HTTP server
so I'm not
really using a
proper server
for this
yeah
so that's not
helping
I'm gonna let
that one load
up while we're
I'm pulling up
another one here
that I want to
talk about
yeah is there
one that you
think we should
highlight in
particular I
mean we've
got the
matplotlib
one which is
pretty interesting
over here
that shows
this
the d3 one
is pretty
interesting as
well
the d3 one
you said
right
okay
d3 has been
a library
that python
folks have
always wanting
to be using
that one was
super fast
that one was
two or three
seconds
right
maybe less
than two
seconds
yeah
and that
should have
basically the
same loading
time as
javascript
because we're
not really
importing
much
or installing
new
libraries
and once I
hit your
your example
server then it's
cached it
right
yeah
the second
time you do
yes
so yeah
another one
the webgl
right down
this one
this also should
load pretty fast
and shows
wrapping webgl
oh yeah
directly
this one
this one shows
an example
of
codecahedrons
or something
a bunch
sort of rotating
spinning around
it's a little bit
like a 3d
asteroid game
with no
spaceships
something like
that I guess
maybe is a way
to think of it
and if I go to
oh and also
as I move my
mouse it reacts
to I didn't
I hadn't moved
my mouse
so that's pretty
cool
I open up my
little task
manager thing
I don't know
if it shares
but it says
basically
it shows you
how hard it's
working and it's
20% CPU
for this 3d
rendering
interaction thing
that's
if you probably
try to do this
in pure Python
and like Pygame
it might be more
yeah
I'm not sure
about like
the performance
and you know
like resources
but it should
be pretty much
once you're
using JavaScript
things
they should be
pretty much
the same
as JavaScript
pure JavaScript
much like Python
often just sort
of orchestrates
C code
once you've loaded
something into
the C layer
and you're kind
of just
instructing it
through simple
commands
it's probably
not very
different here
exactly
yes
all right
cool
all right
so I strongly
encourage people
to go check
out the demo
code
it's just under
the example
folders
in the GitHub
repo
which we'll link
to
Fabio
we're running
low on time
here
there's so much
so much more
I want to talk
to you about
you drive
yeah
let me just
see a couple
of example
or a couple
of areas
I want to
talk about
here
I just want
to quickly
touch on
security
I think
the security
story is
pretty simple
but I do
have one
question
so to some
degree
people might
go oh
my gosh
it's compiled
C and
JavaScript
in the browser
like you know
what madness
are people
going to
unleash
on the world
right
this is like
ActiveX
or some
dreaded
com thing
all over
again
and really
WebAssembly
also has
the same
sandbox
security
as JavaScript
right
actually a lot
of the issues
that we've
been getting
around security
boils down
to that
people like
not being
used you
know to
seeing the
browser as
a VM
so oh
if I type
OS list
there and
stuff like
this I
can I have
access to
the file
system
well you're
having access
to an
ephemera
file system
in the
browser
here and
not your
local file
system
that is a
very important
aspect
one thing
that would
make me
super happy
is if we
had some
beautiful
Python API
to the local
data side
of things
so inside
the browser
in JavaScript
you get
access to
what's it
called
local DB
and there's
like a
there's
different
levels
there's
like a
file
sort of
per site
file storage
thing
that's tied
to your
user
and then
there's
like an
embedded
SQLite
like thing
I mean
if you had
something like
SQL model
or some
other
proper ORM
that would
let you
connect
to query
that
I suspect
that could
probably be
built pretty
easily
with a
interoperability
layer to
figure out
just how to
translate that
over to
JavaScript
but is it
what do you
think
you know
more than I do
there are
lots of
possibilities
and scenarios
of you know
using what
the browser
provides you
like local
storage
or small
instances of
databases
and stuff
like that
so that is
almost
shipped
and default
with all
the browsers
there are
interesting
projects
well at
least one
that I've
seen
like
Google
project
where
from
Google
from the
Chrome team
that is
experimenting
with scenarios
where you can
actually
allow apps
to access
your file
system
or other
resources
native
resources
right
like and
it's
it goes
through a
process of
approval
but you
can mount
directories
and use
them from
your browser
as a local
mount
those are
also
very
interesting
scenarios
that
could
open
up
a lot
of
different
ways
of
interacting
with
PyScript
maybe
it would
mean
you can
actually
develop
your
PyScript
app
directly
from
your
local
machine
and
then
serve
it
on the
browser
real
time
or
your
app
could
write
files
or
do
your
models
or
computation
of
the
browser
and
then
write
results
your
local
files
there's
a lot
that
can
be
explored
my
security
question
outside
of
the
sandbox
let's
not
stress
about
it
we
already
have
had
web
assembly
for
a long
time
is
this
py
env
section
here
where
you
can
say
go
find
this
file
right
and
I'm
thinking
of
my
website
which
has
a
static
files
folder
section
where I
might
put
this
because
that
needs
to
be
served
up
as
effectively
a
static
file
to
the
front
end
but
I've
got
my
app
py
my
various
views
and
settings
dot
json
and
like
if
I
put
too
many
dot
slashes
there
am I
going to
be able
to get
to
other
stuff
or
is
it
okay
suppose
this
folder
this
file
lives
in
static
slash
antigravity
dot
html
but
the
rest
of
my
app
is
like
one
directory
up
from
that
could
I
say
my
path
to
my
module
is
dot
slash
app
dot
pi
and
then
maybe
read
like
some
right
source
code
with
like
a
token
that
I
put
in
there
that
I
shouldn't
have
put
in
there
but
then
now
it's
public
yeah
relative
paths
should
work
just
fine
there's
also
I
think
with
PyScript
the
distinction
between
development
time
and
deployment
time
or
bundling
time
is
a
little
more
highlighted
like
as a
developer
I'd
love
to
have
those
relative
paths
and
explore
and
have
full
access
to
a lot
of
libraries
but
when
I
deploy
I
bundle
my
application
one of
the
things
that
we
are
very
interested
in
developing
more
is
we
should
bundle
that
as
one
thing
and
paths
should
be
absolute
so
there
is
no
issues
with
what
you're
saying
we
could
bundle
the
interpreter
and
your
dependencies
so
that
we
can
optimize
size
remove
dependencies
that
you're
not
using
so
the
loading
time
is
smaller
basically
three
shake
like
a lot
of
JavaScript
libraries
do
so
there
are
definitely
patterns
to
explore
in that
scenario
soon
yeah
okay
yeah
you
definitely
don't
want to
go
dot dot
slash
app
because
somebody
could
then
inject
that
but
yeah
it's
interesting
I'll be
cool to
see what
you'll
do
there
but
definitely
that's
the
only
thing
that's
coming
to
mind
like
hmm
I
wonder
what's
gonna
happen
there
oh
so
but
if
you do
dot dot
app
you're
still
like
it's
basically
on you
to
define
what
you're
actually
serving
as
your
static
file
server
if
it's
not
accessible
as a
static
file
already
this
will
just
404
yeah
okay
then
right
yeah
then
flask
pyramid
friends
have it
covered
yeah
exactly
now
it's
just
you're
like
it's
not
our
responsibility
but
you
shouldn't
be
allowing
you
know
slash
static
slash
dot
slash
app
dot
pi
being
served
anyway
right
okay
cool
the other
thing
is
one
of
the
things
that
Steve
Dauer
talked
about
recently
is
that
they
started
enable
the
real
the
full
c
python
to
being
built
within
mscripten
web
assembly
targets
is
this
of
interest
to
you
all
does
this
supersede
Pyiodide's
version
in some
way
is
what
Pyiodide's
version
actually
is
the
Pyodide
team
and
the
c
python
team
are
collaborating
on
making
the
two
making
Pyodide
basically
use
that
as
a
baseline
python
that
actually
would
be
very
helpful
to
the
Pyodide
team
as
well
they
would
have
way
less
things
to
maintain
they
can
just
delegate
to
improvements
and
optimizations
that
the
c
python
core
team
is
they're
doing
and
can
focus
on
the
additional
features
of
Pyodide
so
that
actually
we had
a
few
they're
building
in the
web
assembly
version
because
it
didn't
exist
that's
probably
not
what
they
want
to
do
right
exactly
yes
yeah
okay
their
real
innovation
I think
in addition
to just
getting the
web
assembly
thing
working
is
like
how
do
you
bring
these
important
C
mixed
C
libraries
in
like
numpy
and
such
to
the
browser
that
otherwise
wouldn't
just
drop
in
as
you
know
python
stuff
running
on top
of
the
interpreter
right
that
seems
to be
the
most
important
thing
that
they
brought
to
the
table
right
not
discounting
that
there
was
not
a
web
assembly
version
and
they
made
that
also
happen
right
like
that's
also
super
important
but
well
yeah
I guess
what makes
them more
distinct
of
all
the
other
attempts
is
that
they
are
really
focused
on
making
sure
that
data
science
libraries
work
in
this
situation
yes
I think
that
is
one
of
the
main
things
that
made
high
dive
successful
because
a lot
of
times
you
would
support
just
the
language
itself
and
then
when
you
want
to
support
more
complex
use
cases
like
C
dependencies
you
are
too
far
in
the
process
of
your
implementation
and
then
you
are
like
oh
now
we
have
to
rewrite
half
of
the
code
to
refactor
to
account
for
a lot
of
the
complexities
yeah
we
got to
backfill
it
so
we
have
support
for
all
these
things
how
are
we
going
to
write
our
own
numpy
now
or
something
right
yeah
and
C
extensions
are
always
the
place
where
most
projects
have
a
hard
time
right
like
historically
the
different
implementations
of
python
and
dotnet
or
pipi
or
others
C
extensions
has always
been
like
the
trouble
kid
it
definitely
is
it's
also
tricky
for
thinking
about
reference
counting
versus
other
collection
cleanup
tie
yeah
it's
an
important
boundary
to be
aware
of
but
it's
also
really
been
a lot
all right
final
final thing
let's
just wrap
this up
with
what's
next
where
you
going
so
I
think
I
hinted
at
a lot
of
those
I
think
the
main
thing
for
us
in
the
immediate
future
is
really
to
work
with
the
community
and
build up
more
of that
side
of
things
and
then
also
work
on
documentation
to
put
out
the
vision
and
what's
next
there
are
a bunch
of
things
that
are
really
interesting
that
we
will
be
looking
at
a
reactive
layer
or
components
to
interact
with
each
other
and
notify
each
other
the
story
around
data
and
how
does
working
with
data
look
like
in
PyScript
a lot
of
development
around
the
possibilities
of
using
PyScript
in
a
peer-to-peer
or
web
three
sort
of
scenario
right
what
can
we
make
to
support
applications
talking
to
each
other
directly
or
you
know
using
a
mode
where
you
work
offline
and
online
and
you
can
you
know
make
the
experience
better
right
like
a
little
bit
of
a
progressive
web
type
of
thing
yeah
I'd be
super
excited
to see
that
come
along
yeah
honestly
one of
the
difficulties
with
this
project
is that
it breaks
so many
patterns
that we
are used
to
you know
both like
oh I'm
running my
thing on
my machine
or in a
server
or I'm
doing a
web
it means
okay
it means
that I always
have a
server
and a
client side
they have
the network
in between
now
we're
shifting
the
paradigms
and a
lot of
things are
new
so we
can
explore
right
the other
thing
that we're
looking at
well
better support
for the
optimization
loading times
all of
those things
how can
you
can you
hold
state
of your
application
so basically
as it's
it's
running
etc
or if
you
just have
a
notebook
like
sort
of
workflow
how can
you save
the state
of your
PyScript
app
and share
with others
and they
can start
from the
same point
you were
okay
those are
all great
things to be
working towards
is this
tying in
any way
to
Jupyter
Lite
and it's
got similar
goals
I'm not sure
if it has
any similar
foundations
or anything
maybe
I'm very
familiar with
the Jupyter
folks
I work
together
with many
of the
core
developers
and
historically
Jupyter
Lite
is a
great
project
that
basically
implements
the
Jupyter
notebooks
using
Pyodide
as a
runtime
or
a
shell
yeah
so
it's
not
that
far
out
of
being
maybe
in
a
similar
space
but
right
yeah
it's
similar in
that
sense
that
it ties
right into
the Jupyter
experience
so it
has
it's
locked
into
the
notebook
flow
and
altering
notebooks
and stuff
like that
where
PyScript
is more
has a
larger scope
and it's
really to
author
applications
sure
a little
different
okay
very
interesting
all right
well
congratulations
this seems
like a pretty
promising project
and I know
there's a lot of
interest in it
let me close it
out with a
comment from the
audience
Andre
Muller
said
I tried
Jinja
the Jinja
wheel
just
straight up
with PyScript
and it works
straight away
like no
changes
so that's
that's kind
of meta
actually
that's
Jinja
within PyScript
within HTML
love it
yeah
awesome
all right
well let me ask you
the final two
questions before
we get out
of here
if you're
gonna write
some Python
code
what editor
are you doing
using these
days
I'm usually
a mix
between
VS Code
or PyCharm
all right
cool
yeah
both good
and
notable
PyPI package
or you know
some other
kind of maybe
it doesn't come
quite off
PyPI
maybe it comes
off a CDN
these days
PyScript
obviously
what do you
want to give a
shout out to
gave a lot
of shout outs
to Pyodide
once again
it's a great
project
I think
I use
notebooks
and the whole
Jupyter
ecosystem
a lot
as well
the whole
scientific
stack
and a lot
of the things
that are
around
you know
the many
interesting
projects
like
you know
NumPy
Pandas
Dask
the Bokeh
Numba
a lot of
that ecosystem
is really
in my day-to-day
kind of
workflow
yeah
fantastic
yeah
well cool
all right
well
once again
congratulations
on all the
interest
and excitement
it's
it's really
taken off
the last couple
weeks
so
thanks for
coming on
the show
and talking
about it
thank you
so much
for the
opportunity
I had a
great time
chatting
about it
yeah
you bet
and
final call
action
people want
to get
started
what do
they do
great
question
go to
pyscript.net
check the
website
we have links
to the
repo
and
to the
you have
very
interesting
install
steps
here
right
and it
says
no you don't
install
yes
we hope
people would
click
and actually
see the
easter egg
which was
good
and yeah
you know
we want to
really want to be
inclusive
community
so if you have
questions
or have
you want to
report bugs
or just
ask where
you can help
just reach out
either on
on twitter
or reach out
on the repo
open bugs
there
we are
in the next
you should expect
more documentation
on community
engagement
having a
discussions
group
where people
can actually
ask questions
more easily
we're evaluating
starting
bi-weekly
or something
like that
community
call
where we
just
are there
for the
community
to ask
questions
live
on a
zoom
or something
like this
so be
patient
we're
getting there
to support
our community
and allow
people to
actually contribute
back
well
very exciting
thanks for
doing it
thanks for
being here
thank you
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
starting a
business is
hard
Microsoft for
startups
founders hub
provides all
founders at
any stage with
free resources
and connections
to solve
startup challenges
apply for free
today at
talk python.fm
slash founders hub
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 slash
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
slash YouTube
this is your
host Michael
Kennedy
thanks so much
for listening
I really
appreciate it
now get out
there and write
and write some
Python code
and write some
things like that.
and write some
things like that.
And I'll see you next time.
I'll see you next time.
Bye.
you
Thank you.