The Python scientific stack, compiled to WebAssembly
github.com
github.com
So there won't be any server side code, you'd just be downloading the entire Python stack and dependencies every time you want to use this through your browser. This time it will be WASM though, instead of x86/x64/pyc.
That we can, doesn't mean that we should.
Like npm? No.
It exists and it's called bower.
And yes I could pay for a Jupiter notebook hosted on some instance but I dont want to.
Of course when it's like 50-100MB you wouldn't use it in some cases. But once cached you're golden for your repeat visitor audience.
The real impressive feat to me isn't hosting jupyter in the browser. It's access to a reasonably fast implementation of numpy in the browser which smokes native JS code for homogeneous array operations. I would love to see a minimalistic WASM implementation of numpy that can seamlessly interop with normal JS. Such a library would open up all sorts of possibilities that aren't currently feasible due to perf reasons.
Running the exported notebook here takes
time py3 python.py real 0m0.145s
chrome: load html: 2sec run html: 13sec!
That's not 10 times slower, but a 100 times slower!
Still good start.
They were purposefully working to reduce abstraction, since performance mattered from day one.
WASM is a huge step backwards in that regard. If you care about performance, just install Python on your box and "pip install numpy". Do you absolutely have to have it come in a browser now?
(Typical disclaimer, I'm a dev on the azure notebooks team; we just try to solve exactly the scenario GP was asking so I would be remiss to not throw our hat in the ring)
Wouldn't Bokeh make more sense? I'd be very interested in a serverless Bokeh that didn't force me to ditch Python, for example.
More recently, pyodide has grown full matplotlib support. See, for example, https://iodide.io/pyodide-demo/matplotlib-sideload.html?side...
TL;DR: pyodide in Firefox was slower than cpython.
> UPDATE 2018-04-11: My hunch was wrong, and I was able to get to the bottom of the root cause and significantly speed up these benchmarks.
And there's an updated graph here:
http://droettboom.com/blog/2018/04/11/profiling-webassembly/
The thing that seems to cause a greater gap between wasm and native speeds is lots of Python-level function calls, not the tight C loops that make up much of Numpy.
``` TypeError: window[s] is undefined ```
with firefox.
I'd love to get to the bottom of that.