Re:Introducing PyScript (summary of PyCon keynote)
by lo5 on Thursday June 23, 2022 @11:16AM
(#31850295)
Does PyScript offer anything of significance over and above what Pyodide already offers, other than several py-* tags?
In my experience, it's trivial accomplish this with Pyodide.
Here's a web worker that hosts Pyodide and loads packages, PyPI wheels, external modules, etc. and launches type=text/python script tags in-browser:
https://github.com/h2oai/nitro/blob/main/web/public/nitride....
About ~100 lines of code.
Re:Introducing PyScript (summary of PyCon keynote)
by j0hnyl on Thursday June 23, 2022 @12:23PM
(#31851352)
Maybe what it offers is abstraction. Boilerplate not required for immediate results, just a pyscript tag.
Re:Introducing PyScript (summary of PyCon keynote)
by lo5 on Thursday June 23, 2022 @12:54PM
(#31851857)
I understand that, but it's not much of an abstraction:
const
pyodide = await loadPyodide(),
input = document.getElementById('#input').textContent,
output = await pyodide.runPythonAsync(input);
document.getElementById('#output').textContent = output;
I can see there are other tags (py-env, etc.) that provide some yaml to fetch additional assets, but again, nothing significant that warrants the hype.Maybe I'm missing something?
That said, it has really brought out the knee-jerked clichéd responses:
- X is way better than Y
- X is the Y killer / no it isn't
- Did you know Python is really slow?
- Sure you can, but why do this? (implication: don't do this)
To add to the fun, it attracts huge interest, and amongst those interested are a weird set of people who seem to know little about Python, little about JavaScript and seem unable to read before they try something impossible and then post a query about why their almost certainly never-going-to-work attempt hasn't worked! It needs plenty of patience pointing them to the huge pile of matching queries! I'm sure something will be done to give those types a friendly nudge in the right direction.