Coming into an internship you never really know what to expect from your summer. What I definitely didn’t expect was that my whole summer would center around one library – Pyodide – and that it would leave such an impression on my team and organization.
Pyodide is an open-source library that was started at Mozilla as part of the Iodide project. Pyodide allows a user to run Python in a web browser through having the Python interpreter compiled to Web Assembly (WASM). It comes with 75 packages already in the base library, most of which are part of the scientific stack such as NumPy and Pandas. Other packages can be installed if they are pure python wheels from PyPI. Check out the Pyodide library here and the docs here.
With my project being very open-ended, the question I wanted to investigate was how can my team, the Python Tools for VS Code team, use Pyodide? The idea of running Python in a web browser seems amazing, but how easy is it to work with and what can we actually prototype?
Since Python is a great language for beginners, we always keep beginner programmers and students top of mind when we think about who our users are and what they need. We have found that beginner users struggle to install and configure Python and these steps are a barrier during their getting started experience. Additionally, we have seen that some schools who restrict network access on school computers accidentally block students from downloading Python onto a school computer. Both of these problems could be fixed with the design of an extension, accessible through the VS Code marketplace, which would allow a user to run their Python code via Pyodide on the web. This was a very compelling use case and so I began exploring it as an option and I learned so much about Pyodide along the way. We were able to solve the problems with an extension as you can see in the demo below but this involved some workarounds that made it not production worthy. Here are my biggest takeaways and where I see this library going.