[Grad2021] [Turnbull Zemi] You heard it here first: PyScript @ PyCon US

Stephen J. Turnbull stephenjturnbull at gmail.com
Mon May 2 21:58:16 JST 2022


Claus Aranha writes:

 > Thank you for the link! This is really curious. As far as I can tell, it 
 > is a js program that wraps a python interpreter?

Not just "a" Python interpreter, not just "wraps", it's CPython (I
forget the version, maybe 3.10) compiled with WebAssembly as the
target platform with the Emscripten compiler (based on clang).

That means CPython is running natively on a virtual machine that is
available in almost all modern browsers, including those in your
phone, and the HTML incorporates it directly (not via Javascript)
using the same browser scripting API that Javascript uses.

 > Looking a bit through the github, the wrapper leaks a bit through
 > when you need to parse the DOM, but I'm sure they will improve that
 > soon.

Yes, this is alpha all the way down to the virtual machine.  Not sure
about the "leaks", the simpler demos in Peter's PyCon talk were pure
Python + HTML.

Steve






More information about the Grad2021 mailing list