4 ms·
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
by jdpigeon 7y ago
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.
- chowes 7y agoWhy wouldn't you just use regular Python?
- jdpigeon 7y agoMy 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.
- arduinomancer 7y agoI 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.
- ptx 7y agoYou can bundle the whole Python distribution with your application and it will still be smaller than Electron. Recent releases of Python have an embeddable distribution for this purpose: https://docs.python.org/3.7/using/windows.html#windows-embeddable https://docs.python.org/3.7/using/windows.html#windows-embed... This is also the way Java is supposed to be deployed on client machines nowadays, apparently - using the jlink tool to create a bundle of the Java runtime for your application.
- mlevental 7y agolol what a crazy rubegoldberg machine - like the person beneath asks: why not just use "native" python
- stult 7y agoPWAs, 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.
- codesushi42 7y agoExactly. Otherwise you'd need some other way to communicate between Electron and Python. This is possible, you could use ZeroMQ. But it would be a huge pain. This would easily make sense where you want to execute your app's logic in Python, but want to keep the UI in HTML and JS.
- stult 7y agoDefinitely. And a lot of the motivation for that type of approach is driven by team skill portfolios rather than raw technical merit. If you have a data science team specialized in python and a front end team specialized in JS (which I think we can agree describes the overwhelming majority of DS and FE teams), there's a really strong organizational motivation to bolt python and JS together in flexible ways that match the available deployment infrastructure, which, like it or not, includes electron.