quantum-sheet
quantum-sheet copied to clipboard
Optimized Python side
Future optimizations would be knowing all the different Python functions that can get called and having "callbacks" for them instead of using pyodide.runPython. Basically, executing actual functions instead of eval-ing code.
Relevant
- https://github.com/iodide-project/pyodide/blob/1eb13f2629bed5405e3570e314086de0eb94c468/src/runpython.c#L12
- https://github.com/iodide-project/pyodide/blob/76efcaccf7cb0f478ed1f17fd36cd79f3370980e/src/python2js.c#L17
- https://github.com/iodide-project/pyodide/blob/9afc7a1617c1c127590418e8cdbf2ec9831d7c50/src/pyodide.py#L25
- https://github.com/iodide-project/pyodide/blob/76efcaccf7cb0f478ed1f17fd36cd79f3370980e/src/pyproxy.c#L97
- Directly calling things like
Module.hiwire_new_valueandModule.__pyproxy_apply - https://github.com/iodide-project/pyodide/blob/fc5495ffdb54a11fd588dc60ba6b8777f90c3724/src/python2js_buffer.c#L458
Another potential optimization would be using bytes and buffer objects for larger values, as those don't have to be copied in memory.
Also, keep track of other projects like
- https://github.com/wapm-packages/python
- https://github.com/Nuitka/Nuitka
- https://github.com/RustPython/RustPython
- https://github.com/pmp-p/micropython-ports-wasm
- https://github.com/micropython/micropython/tree/master/ports/javascript
- https://github.com/brython-dev/brython
https://github.com/sagemathinc/zython