PyScript compatibility #458
Replies: 6 comments 6 replies
-
👋 Hi folks... Thanks for the ping Chris. Umm... so @chrisbuerginrogers is a totally amazing professor at Tufts, Boston, USA. I'm based in the UK and work on the open source project PyScript, which is basically a platform for Python in the browser (using WASM). We've been collaborating for, well I can't remember how long, so it must be a long time... and we both share a passion for engineering education. The thing about PyScript and Python in the browser is that you don't have to install anything on your local machine (it's all in the browser, shared via a URL), Python packages you may use are kept within the browser sandbox, AND you get access to all the funky APIs modern browser have, such as BLE, web-serial, camera, speech synthesis and all sorts of fun stuff. Clearly Chris sees your project as something to explore for pedagogical purposes, and wouldn't it be cool to be able to use it with just a modern web browser..? How can we help make this happen? (If this is of interest.) |
Beta Was this translation helpful? Give feedback.
-
fyi @Tobias-Fischer, given the work presented in https://arxiv.org/pdf/2409.09941 . |
Beta Was this translation helpful? Give feedback.
-
Hi @chrisbuerginrogers and @ntoll, As @traversaro said, we've been working toward a very similar aim, and you can read what we've been up to in https://arxiv.org/abs/2409.09941. Rather than using PyScript, we've been opting for https://emscripten-forge.org/. In addition to Peter's toolbox, we've also managed to compile ROS2 for WASM (which was much more challenging ..). At the moment, the demos are scattered and not yet polished:
Note that I got some funding so that @nmarticorena will work on polishing these demos in a few weeks time. Would be great to collaborate if you are interested. |
Beta Was this translation helpful? Give feedback.
-
Hi Folks 👋 This is such an interesting endeavour for all sorts of reasons: Python, WASM, conda (my employer is Anaconda, originators of this technology, although not the same as emscriptenforge). So I guess we should compare notes. PyScript (technical docs here, source code here) is simply an easy to use platform for Python in the browser. With just a single reference in the We chose Pyodide as our version of CPython because it is simply the most mature project, we have an excellent collaborative relationship with its core maintainers, they have already working versions of the most commom C-based tools such as I've very quickly skimmed the paper to which you link. As far as I can tell (caveat - I've probably missed something), the core surrounds making Regarding MicroPython, it's very small, fast and works exceptionally well in a browser context. When you don't need everything-but-the-kitchen-sink in Pyodide, but just a lightweight Python, MicroPython is ideal. Furthermore, there's a well documented way to create Python APIs that wrap C code, in MicroPython. This is very different to the world of CPython, most particularly because the C code is compiled into a bespoke build of MicroPython itself. That is delivered to the browser as a single asset. I'm mentioning this, not only for size/speed or startup reasons, but because Damien (creator of MicroPython) is a former Robo World Cup participant (so has an advanced background in robotics) and is Australian. ;-) I'm just thinking of the Venn diagram of shared interests and how such overlaps often lead to fruitful collaborations. Also, Chris has made extensive use of MicroPython in embedded (robotic) devices controlled by various microcontrollers... so the "stack" is always the familiar MicroPython. See, especially, is amazing work (and the work of his students) with Lego Spike Prime devices. Anyway. How does this sound..? Happy to answer questions and dig into details further. If you're happy for me to do so, I can bring in various PyScript collaborators and some |
Beta Was this translation helpful? Give feedback.
-
Just thinking out loud here... if Emscriptenforge have their own Python interpreter with their unique capabilities and features, why can't that be another Python interpreter available via PyScript..? Clearly I need to understand the technical aspects of what's there. But like I said, just a thought. @DerThorsten / @IsabelParedes / @wolfv..? |
Beta Was this translation helpful? Give feedback.
-
Polite ping. Any movement on this? |
Beta Was this translation helpful? Give feedback.
-
Hi all - thanks for the robotics toolbox (and @peter - sweet website - I have used it a bit in the past) - looks pretty awesome - I am hoping to embed it into a PyScript page so that I can customize (and then my students can too) a UI for robot control. It would be great to embed Swift as well - if possible. This is for an introductory robotics course at Tufts University. If you all are at all interested, let me introduce Nicholas (@ntoll ) - he is part of the PyScript team at Anaconda (he and I do a lot of education robotics stuff - he, Mu and I, LEGO). If you all are interested - it would be cool to also link it with a bunch of ROS/Jupyter Lab stuff we have running as well. Thanks
Beta Was this translation helpful? Give feedback.
All reactions