6 ms·
> scientific software ... where interfaces are notoriously bad. I think the problem here is two fold: bad UIs and bad APIs. In the science world, there doesn't
by petargyurov 6y ago
> scientific software ... where interfaces are notoriously bad.
I think the problem here is two fold: bad UIs and bad APIs. In the science world, there doesn't seem to be any abstraction between backend and frotnend -- the whole thing is one intertwined mess.
Scientists don't always write great software; they write scripts that get the job done quickly in a very specific way. Pair that with the lack of time that they have to wrap things in a GUI and you get a Tkinter/Qt app that is unmaintanable.
I'm currently volunteering with the NZ Department of Conservation. Here is a tiny preview [0] of an app that I have just started making for them. It's purpose is to aid scientists with processing camera trap images using machine learning. I'm building the UI using ElectronJS and Svelte, whilst the backend is a separate Python project.
[0] https://streamable.com/0ji1ii https://streamable.com/0ji1ii
- Neputys 6y agoHow is Electron doing btw? I'm itching to use it in one project but it doesn't feel like it's getting any traction in the community for a long time now. Since it's a long term project I kind of get mixed feelings about using it.
- petargyurov 6y agoThis is my first project with it so I'm probably not in a position to provide much insight. So far development with it has been almost identical to coding a website, but maybe because I am yet to start on any OS dependant features. What makes you say that it isn't getting traction? AFAIK, some huge companies are using it to create their apps. I think it gets a lot of underserved hate, just because it's JS and because it isn't "truly native". People also love to chime in about its performance but 9/10 times that's down to a bad implementation, in my humble opinion.
- pjmlp 6y agoOn top of that, I already have a browser installed and each Electron app is a step for turning the Web into ChromeOS.
- polishdude20 6y agoIs there any benefit to using electron vs a website with the same code? Especially if you want it to be free and accessible to everyone
- westoncb 6y agoI have built a couple Electron apps, one of which will be available as a commercial product soon. The main advantages (over executing your app in-browser) to my knowledge: 1. You can execute native code outside normal browser sandbox 2. You get your own application window
- polishdude20 6y agoWait, you can execute say c++ using electron?
- westoncb 6y agoYep: https://www.electronjs.org/docs/tutorial/using-native-node-modules https://www.electronjs.org/docs/tutorial/using-native-node-m...
- wlesieutre 6y agoYou can even have multiple application windows! But VS Code is the only one I can think of that bothers. God forbid you want to be in two Slack orgs at the same time, perhaps on different virtual desktops. Off to the browser version with you!
- httpsterio 6y agoThat's just bad usability on Slack's part, not a technical limitation of the tech. Also, afaik Slack is/has moving away from Electron.
- wlesieutre 6y agoAgreed on the bad usability, but that's par for the course with most Electron apps. You get the laziest possible "stuffed a webpage in a window" UI. And maybe it's even a nice UI in some ways, but it's usually pretty clear that it's not native software. Re: moving away from Electron, not as far as I know. They had a major update a year or so ago to make some big efficiency gains by not running a separate Electron instance for each organization, but the new version is still in Electron: https://slack.engineering/rebuilding-slack-on-the-desktop/ https://slack.engineering/rebuilding-slack-on-the-desktop/ One can hope that they'll take the iPad version and make some improvements to let ARM Mac users get that instead, but currently they've chosen to disable downloading it from the Mac App Store.
- mimixco 6y agoSpotify is an Electron app that's doing well. Also my own company's experiences with it have been good.
- ronjouch 6y agoSpotify isn't an Electron app. It predates Electron and uses CEF ( https://bitbucket.org/chromiumembedded/cef https://bitbucket.org/chromiumembedded/cef , https://en.wikipedia.org/wiki/Chromium_Embedded_Framework https://en.wikipedia.org/wiki/Chromium_Embedded_Framework ), like Steam.
- mimixco 6y agoI should have said Slack.
- klenwell 6y ago> I'm building the UI using ElectronJS and Svelte, whilst the backend is a separate Python project. Thanks for sharing this. I have a relatively simple Python script that I'm trying to package for a non-technical Windows user so, as someone whose experience skews toward web development, your comment caught my attention. I just googled "electron svelte python" and found this write up: https://medium.com/@abulka/electron-python-4e8c807bfa5e https://medium.com/@abulka/electron-python-4e8c807bfa5e Which references this Github repo: https://github.com/fyears/electron-python-example https://github.com/fyears/electron-python-example It all sounds pretty brittle. How are you managing communication between your ElectronJS frontend and Python backend? Any references you recommend?
- petargyurov 6y agoI think I came across that as well. I didn't like it. As far as I understand, there are two ways to handle communication between the Python and ElectronJS: 1) Use inter-process communication. Basically, your Python app outputs to stdin and your Electron app consumes the output. Also works the other way. This is what I went with. 2) Use a Flask (or equivalent) local web server and have your app send requests to it. I find method 2) a bit hacky and unintuitive for a desktop app. If you are planning on hosting your backend in the cloud this would be a decent solution, but I am not. I had already done some work to turn my Python app into a standalone CLI tool using `click` [0] which made the interaction with ElectronJS very simple. I used `python-shell` [1] for the inter-process communication. I do think that I might not need this once I package my Python app into an .exe -- then Electron should be able to interact with it in some way without caring that it's built in Python. You can take a look at my repo here, though it's still in its infancy: https://github.com/petargyurov/megadetector-gui https://github.com/petargyurov/megadetector-gui [0] https://click.palletsprojects.com/en/7.x/ https://click.palletsprojects.com/en/7.x/ [1] https://www.npmjs.com/package/python-shell https://www.npmjs.com/package/python-shell
- vlovich123 6y agoWhy not use something like gRPC or cap’n’proto to make the request/response stuff easier to manage?
- nexuist 6y agoThis is very pretty. Great job on the frontend.
- andkenneth 6y agoNZer here, interested to hear more about how you ended up doing that.
- petargyurov 6y agoPasting my answer from a similiar comment above: > I sent an email to a specific conservation project, asking if they happen to need any software help at the moment and they did. We got chatting, agreed on some goals and I got working. I signed their volunteer agreement form which sets out some conditions (nothing unsurprising). That's it really. For what it's worth I am not even based in NZ; I'm in the UK. Happy to chat in more detail if you want to know more (my email is in my profile)
- spondyl 6y agoAs a curious New Zealander, how does one volunteer with a government department? I had always assumed it would have to be strictly a contractor type relationship
- petargyurov 6y agoI sent an email to a specific conservation project, asking if they happen to need any software help at the moment and they did. We got chatting, agreed on some goals and I got working. I signed their volunteer agreement form which sets out some conditions (nothing unsurprising). That's it really.
- spondyl 6y agoAh, interesting! I had just assumed that most departments wouldn't have a process for handling this kind of stuff or that it would be considered more costly in terms of getting a signed agreement, coordinating etc etc
- Aeolun 6y agoThat actually looks really cool! Are you planning to display the output in the UI as well?
- petargyurov 6y agoThanks! Yes, I am. The intention is for the user to also be able to correct the output of the model. After that I want to give the user an easy interface for training their own models (transfer learning using an existing base model).
- OOPMan 6y agoYou realise it's possible to write a decent UI in Qt that isn't a dumpster fire from the codebase perspective right? I know the fad these days is to turn everything into a web app but my experience working with Qt really just demonstrated to me that a lot of web UI development is reinventing wheels from desktop UI but poorly and with more bugs and frustration. That's just my perspective though :-)
- PoignardAzur 6y agoMy personal experiences differs. I recently spent a year working on a Qt app for drawing circuit diagrams, aimed at nuclear engineers. I've lost count of the number of times I found myself wishing for some feature that React has implemented for years. The parts of the code that were easiest to maintain were the ones that reinvented reactive UI: every modification to the underlying data called some "updateGraphicsView" function that would then re-render the entire thing. Not great for performance, great for avoiding bugs. Seriously, for me Qt goes in the "never again" category.