Live data from Hacker News

Pyodide: Bringing the scientific Python stack to the browser

hacks.mozilla.org

61–70 of 120 posts

Re: Pyodide: Bringing the scientific Python stack to the browser

#61

It's a cool project technically, but I don't understand the use case? I mean surely everyone can just have real python/jupyterlab - if you run it in Docker it's easy to handle the dependencies etc. Am I missing something?

Sounds like you could use it for interactive visualizations in the browser, similar to D3

Re: Pyodide: Bringing the scientific Python stack to the browser

#62
post #25

Wow, it seems to work really well. After giving it a small test drive, I'm impressed. Solid work from Mozilla, and a pretty informative article too! That said, between this, iodide and ObservableHQ, I guess I give up. The browser is the new OS. My question now is - how can we make browser environment to be more like Emacs (bear with me)? My main complaints are: - Browser ergonomy absolutely sucks, and there's nothing…

> If I'm to spend 8+ hours a day doing serious work in a web browser, the browser needs to be better. Agreed! Jupyter notebooks are great, but I miss my Vim keybindings when editing code in cells. (Plugins like Vimperator always collide with some native keybindings.)

Not just keybindings. I don't know how your Vim setup looks, but my Emacs setup gives me some extra "non-default" tools that are consistent across the whole program, whether I'm editing Lisp, JS or managing files in a directory. Two that I use daily are semantic select (you press a key to expand your selection to the nearest encompassing semantic unit) and multiple cursors.

I did spend several days in a row typing code 10+ hours a day in Observable notebook (I had some idea I needed to validate and demonstrate to other people in the company). While the tool itself was amazing, the coding aspect was not.

Re: Pyodide: Bringing the scientific Python stack to the browser

#63
post #25

Wow, it seems to work really well. After giving it a small test drive, I'm impressed. Solid work from Mozilla, and a pretty informative article too! That said, between this, iodide and ObservableHQ, I guess I give up. The browser is the new OS. My question now is - how can we make browser environment to be more like Emacs (bear with me)? My main complaints are: - Browser ergonomy absolutely sucks, and there's nothing…

> If I'm to spend 8+ hours a day doing serious work in a web browser, the browser needs to be better. Agreed! Jupyter notebooks are great, but I miss my Vim keybindings when editing code in cells. (Plugins like Vimperator always collide with some native keybindings.)

It's far from perfect, but I use jupyterlab with the jupyterlab-vim extension for this: https://github.com/jwkvam/jupyterlab-vim

Re: Pyodide: Bringing the scientific Python stack to the browser

#64
post #30
post #25

Earlier quoted context omitted.

> If I'm to spend 8+ hours a day doing serious work in a web browser, the browser needs to be better. Agreed! Jupyter notebooks are great, but I miss my Vim keybindings when editing code in cells. (Plugins like Vimperator always collide with some native keybindings.)

If you run EIN (Emacs Ipython Notebook module) in emacs with vim keybindings (via spacemacs or evil mode, or some other distribution/mode) you can get some pretty great results. Would definitely look into it if you're either already using emacs or willing to try it out.

I tried it at some point, but a minor inconvenience was that it kept adding superfluous metadata to the cells I was editing.

Since some of the notebooks I work on are collaborative and versioned with git, this was painful for reading diffs (even more so with the ipynb format) so I dropped it to my regret.

Re: Pyodide: Bringing the scientific Python stack to the browser

#65

Wow, it seems to work really well. After giving it a small test drive, I'm impressed. Solid work from Mozilla, and a pretty informative article too! That said, between this, iodide and ObservableHQ, I guess I give up. The browser is the new OS. My question now is - how can we make browser environment to be more like Emacs (bear with me)? My main complaints are: - Browser ergonomy absolutely sucks, and there's nothing…

Fully valid points. And I see no reason why we should accept the urge to use the browser for many tasks which are way better accomplished with existing solutions. After all, aren't we increasing the complexity while limiting functionality and ease of use? Sure, if your core business is in the Cloud and browser market, this may look different, but I believe the terminal will still continue to serve the scientific comp…

I'm getting tired of fighting an uphill battle here. Web technologies have overwhelming dev mindshare; all the cool things happen either as web pages or Electron apps now (which are even worse than web pages, because raw browsers we can upfix a bit with userscripts and plugins).

> terminal will still continue to serve the scientific computing community well

I hope so, but note how data is on the web, the output is expected to be on the web (so others can consume it), collaboration is expected to be on the web, and now you can code things on the web... Everything is moving into the browser.

Re: Pyodide: Bringing the scientific Python stack to the browser

#66

Earlier quoted context omitted.

WebGL doesn't have compute shaders. There are (gross) hacks that "emulate" gpu compute on top of stock shaders but they're limited and can't possibly compete with CUDA.

What now? https://www.tensorflow.org/js/guide/platform_environment#web...

[deleted]

Re: Pyodide: Bringing the scientific Python stack to the browser

#67

Earlier quoted context omitted.

WebGL doesn't have compute shaders. There are (gross) hacks that "emulate" gpu compute on top of stock shaders but they're limited and can't possibly compete with CUDA.

What now? https://www.tensorflow.org/js/guide/platform_environment#web...

I don't know the details but the WebGL backend will have severe limitations because it doesn't use compute shaders or CUDA. This means that certain functionality like random writes to arbitrary buffers can only be emulated through workarounds that are like an order of magnitude slower than using compute shaders, and some things are going to be impossible entirely. There is something about CUDA in the link you provided but since that isn't natively supported by browser either, it will require the user to install something or use a server backend where communication between server and client is going to be an excruciatingly slow bottleneck.

So no, this isn't a web thing and not usefull for web apps/web pages, except maybe for a very limited and small set of use cases.

Re: Pyodide: Bringing the scientific Python stack to the browser

#68
post #12

Earlier quoted context omitted.

You can do GPGPU stuff via WebGL, right?

WebGL doesn't have compute shaders. There are (gross) hacks that "emulate" gpu compute on top of stock shaders but they're limited and can't possibly compete with CUDA.

Compute shaders are available on chrome on windows if you start chrome with some flags. Here are some compute shader demos: https://github.com/9ballsyndrome/WebGL_Compute_shader

And here is a draft spec for WebGL2 Compute: https://www.khronos.org/registry/webgl/specs/latest/2.0-comp...

Only a matter of time until this will be available in chrome and firefox by default. Probably never in Safari though, since it doesn't even support WebGL 2.

Re: Pyodide: Bringing the scientific Python stack to the browser

#69

It's a cool project technically, but I don't understand the use case? I mean surely everyone can just have real python/jupyterlab - if you run it in Docker it's easy to handle the dependencies etc. Am I missing something?

I gave a keynote at PyCon last year that touched on this: https://www.youtube.com/watch?v=ITksU31c1WY#t=32

For me, the most important aspect of Pyodide is that it allows the scientific Python stack to go everywhere the Web goes. And the Web goes everywhere.

That means I can share a link to a Pyodide notebook, and the recipient gets a fully interactive experience, no installation required. And that's really important for the generation that's getting their start in computing through classroom iPads, Chromebooks, etc. which do not easily allow for "real" Python.

Re: Pyodide: Bringing the scientific Python stack to the browser

#70
There is one area where "computing in the browser" misses the mark a little - browser interfaces (like Jupyter) are often used not just for the convenience they offer, but also because they serve as thin clients, which provision vastly better computing resources than you have locally.

So while I do some of my coding in the browser, the code executed is an EC2 far far away, close to my data, with excellent networking etc. There is very little that a Python stack directly in my browser would offer, to me (!) at least (your mileage may vary).

Post reply on HN