Live data from Hacker News

Pyodide: Bringing the scientific Python stack to the browser

hacks.mozilla.org

31–40 of 120 posts

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

#31
post #21

I'm looking forward to try out Pyodide in Electron so that I can make use of all the great Python scientific and signal processing libraries for data processing.

Why wouldn't you just use regular Python?

My goal would primarily be to avoid having to make sure there's an active python installation with all the right dependencies set up on a client's computer. That's been a huge problem for me in the past during deployment (esp. older windows OS's).

A nice side benefit I foresee would be easier coordination of state between a JS front end and a Python process running specialized computations. The current best approach I'm aware of now involves sending data back and forth as JSON and trying to mirror what's going in Python with JS state management. The system described in this article where JS and Python can reference the same objects (and somewhat the same typing?) sounds like it could be an improvement.

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

#32

Earlier quoted context omitted.

Why not just use Django or Flask? Python web dev is great because you do have access to so many of these incredible scientific libraries like Pandas, etc.

I don't know anything about web dev, so maybe it's a stupid question, but you still need javascript for the front end, right? You can't build the front and back end development completely in python?

Right now, reasonably you can't. Maybe with Pyodide you may soon be able to.

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

#34
post #29
post #11

It's great to see how far WebAssembly and Emscripten has come and this is a really cool app! > If you haven’t already tried Pyodide in action, go try it now! (50MB download) I wonder though how ready is it for production usage. At Repl.it, years ago[1], we moved away from browser-based execution to the cloud because it excluded many users who don't have the client-side firepower to download/parse/execute this much JS…

Browser vs server-side is always going to be a tradeoff, yeah. In some cases you're ok with paying for server time, and then don't need to depend on clients running your code. But in other cases it's much more cost-effective to run code on the client. Note that the browser has gotten a lot better in the years since repl.it moved away from running code there. In particular wasm parses and executes a lot faster and tak…

We're overdue on toying around and reevaluating wasm. It would be particularly great if we can make the decision on a per-use-case basis. I.e. fallback to cloud in underpowered devices or instances where it makes more sense.

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

#36
post #21

Earlier quoted context omitted.

Why wouldn't you just use regular Python?

My goal would primarily be to avoid having to make sure there's an active python installation with all the right dependencies set up on a client's computer. That's been a huge problem for me in the past during deployment (esp. older windows OS's). A nice side benefit I foresee would be easier coordination of state between a JS front end and a Python process running specialized computations. The current best approach…

I wonder if that could be accomplished with something like PyInstaller?

I guess if you're using JS features too then there might be other benefits.

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

#37
post #11

It's great to see how far WebAssembly and Emscripten has come and this is a really cool app! > If you haven’t already tried Pyodide in action, go try it now! (50MB download) I wonder though how ready is it for production usage. At Repl.it, years ago[1], we moved away from browser-based execution to the cloud because it excluded many users who don't have the client-side firepower to download/parse/execute this much JS…

I'm curious what the security implications would be of running client side vs. server side for something like REPL.it.

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

#38
post #11

It's great to see how far WebAssembly and Emscripten has come and this is a really cool app! > If you haven’t already tried Pyodide in action, go try it now! (50MB download) I wonder though how ready is it for production usage. At Repl.it, years ago[1], we moved away from browser-based execution to the cloud because it excluded many users who don't have the client-side firepower to download/parse/execute this much JS…

I'm curious what the security implications would be of running client side vs. server side for something like REPL.it.

We spend inordinate amount of time and money on security. We didn't when we ran clientside

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

#39

I'm looking forward to try out Pyodide in Electron so that I can make use of all the great Python scientific and signal processing libraries for data processing.

lol what a crazy rubegoldberg machine - like the person beneath asks: why not just use "native" python

PWAs, running in a sandboxed/secured environment where installing native python isn't an option, bolting existing python code bases onto existing electron code bases. There are plenty of use cases. Just because you haven't encountered one doesn't mean there aren't legitimate applications. It's hard/impossible to judge someone's tech stack without understand the constraints they are operating under.

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

#40
post #33

Can this be used to create a desktop application using Electron?

That would be an interesting stack if you could write desktop apps using Python but use the DOM/Browser stuff for the UI layer.

Yeah I often run into the need to develop basic UIs for data analysis for people with limited programming experience. Currently I have to settle for using Jupyter notebooks with embedded ipywidgets, but it's not still not very user-friendly. And the desktop app libraries like PyQt5 are overkill for what I need, and most of the visualization libraries I use are designed for jupyter notebooks/web e.g. Bokeh.

If I could just port my jupyter notebook+widgets+plots into an Electron window and ship it to people that'd be awesome.

Post reply on HN