News for hackers. Stuff that matters.
Re:Introducing PyScript (summary of PyCon keynote) by d0mine on Thursday June 23, 2022 @02:50AM (#31845917)
As I understand, C extensions are used for CPU heavy work e.g., numpy is likely ported to WebAssembly.
Re:Introducing PyScript (summary of PyCon keynote) by tempay on Thursday June 23, 2022 @03:04AM (#31845986)
Indeed, taken to the extreme a Pyodide-based jupyter is available[1] which uses the same underpinnings as pyscript. It might not be perfectly efficient but it's totally usable, especially considering it moves the compute from a server to the client.

At this point the main issue I've seen is the slow load time (not a problem for jupyterlite but is for pyscript). Hopefully this can improve with time and regardless I think there are a lot of cases for pyscript to remove the need for server-side code and the associated maintaince.

[1] https://jupyterlite.readthedocs.io/en/latest/

Re:Introducing PyScript (summary of PyCon keynote) by codedokode on Thursday June 23, 2022 @04:00AM (#31846270)
No. People won't write C extensions. They will write something heavy like Redux (which recreates full object graph on every event) in Python.
Re:Introducing PyScript (summary of PyCon keynote) by ivoflipse on Thursday June 23, 2022 @01:17PM (#31852234)
You'll like what we've done during my Hackathon https://github.com/fork-tongue/collagraph/pull/66

We added support for PyScript using Collagraph, which allows you to define single file components with a Vue-like syntax.

Excerpt from the project README:

Write your Python interfaces in a declarative manner with plain render functions, component classes or even single-file components using Vue-like syntax, but with Python!

- Reactivity (made possible by leveraging observ)

- Function components

- Class components with local state and life-cycle methods/hooks

-Single-file components with Vue-like syntax (.cgx files)

- Custom renderers (PySide, pygfx and now PyScript)