3 ms·
Yeah, rewriting it with Electron + Svelte + a Rust backend for the heavy lifting. I looked at alternatives to Electron because I wanted to avoid the bloat, but
by dceddia 5y ago
Yeah, rewriting it with Electron + Svelte + a Rust backend for the heavy lifting.
I looked at alternatives to Electron because I wanted to avoid the bloat, but nothing felt like the right fit. Tauri (https://tauri.studio/ https://tauri.studio/) is the most exciting, but I couldn't find a good way to get raw video frames into the UI without a bunch of expensive copies or serialization. I also looked at native toolkits like Qt (I've worked with it in the past) but I didn't love the idea of building lots of custom UI components without the benefit of HTML + CSS. So for now it's Rust + Electron, and I'm paying extra attention to performance.
- vips7L 5y agoDid you look at .Net solutions like Maui, xamarin, uno platform, or AvaloniaUI?
- dceddia 5y agoMy thought process was, if I’m gonna have to rewrite the app, I may as well use the web dev skills I already have, so that at least the UI work will be in my wheelhouse. Rust is new to me, as is low-level ffmpeg stuff, both of which I’ve had to learn from scratch. I learned Swift in order to build the Mac app, and I know from that experience that building custom UI controls while learning a new ecosystem slowed me down a lot. I didn’t love the idea of repeating that experience, and where I’m headed there’s gonna be a good bit of custom UI.
- spoils19 5y agoSounds like an easier process for you, but at the cost of your users. This proliferation of web tooling when it clearly doesn't suit the environment (desktop) is part of the reason why our software is getting slower, even as our hardware is improving.
- cakoose 5y agoNot always at the cost of the users? If dceddia is able to add features and fixes more quickly, that's good for users too. And if Svelte on the desktop becomes popular, people will likely come up with more efficient options. For example, a more efficient Electron or something like "Svelte Native", which could be a good thing. I'd love if all software were more efficient, but getting up to speed on a new platform has a huge opportunity cost too.
- LinguaBrowse 5y agoNot clear from your wording, but Svelte Native incidentally does exist: https://github.com/halfnelson/svelte-native https://github.com/halfnelson/svelte-native It's a Svelte renderer for NativeScript (a framework targeting iOS and Android), rather than being a port of React Native to Svelte.
- dceddia 5y agoBeing very conscious of those downsides, I'm putting in extra effort to make sure it's fast. So far it seems to be working! It uses less CPU than any other Electron-based video apps I've seen (and even less than a few Qt-based editors I tried) and it feels snappy. I think tools like Figma have shown what's possible when enough attention is paid to performance early on – but yeah, it's one of my main worries with going with Electron and I'm trying to avoid the downsides as much as I'm able. The ones I have less control over are memory usage and disk space. I'd love to get those down but it seems like that'd require digging into Chromium and ripping things out. Which, honestly, I looked at doing, but that code base is a beast and I'd rather get something into peoples' hands sooner. On a related note: I think there's a real opportunity for an "Electron Lite", like some kind of custom Electron/Chromium build that turns off stuff you don't need. I suspect it could help disk usage + memory usage + startup time. Chromium's build system has lots of flags that make it seem like you can turn things off. But it didn't work that way when I tried, so I think it probably requires source-level changes, which then means maintaining those patches across Chromium updates etc. But really, though: I don't need WebRTC, or printing, or media codecs, or probably a zillion other things. It'd be so cool to be able to turn those things off at will.
- O_H_E 5y agoThat sounds like a responsible way to divide focus. Kudos I forget the word or the link, but I think there was a "rule of thumb" thing that circulated HN about having a limited budget for taking-risks/being-bleeding-edge, and focus in spending that on differentiating properties of your projects, while the rest should stay "old and boring"
- dceddia 5y agoThanks, and yes! "Choose Boring Technology", love this: http://boringtechnology.club/ http://boringtechnology.club/ The idea of spending fewer "innovation tokens" was definitely on my mind when I was thinking through this.
- nicoburns 5y agoReact-native might be the close to what you're looking for at the moment. But the ecosystem is still tiny on Desktop, and I don't think it supports desktop linux at all.
- dceddia 5y agoYeah I looked at it briefly but the lack of usage was a bit of a worry. And if I’m honest I really wanted a chance to use Svelte :)
- rickstanley 5y ago> without the benefit of HTML + CSS Are you referring to ease in complexity of creating components compared to the alternatives? Because I end up with the same choice when sieving frameworks to use crossplatform. But I've been looking nto Flutter recently, although it's still in beta, it has potential.
- dceddia 5y agoYeah. I talked about this in another reply but I’ve had mostly web development experience over the past few years and UI work is familiar. I didn’t love the idea of having the entire tech stack being unfamiliar. (I’m already new to Rust and ffmpeg/video stuff)
- combyn8tor 5y agoInterested to hear if you considered compiling Rust to WASM and what your thoughts were?
- dceddia 5y agoI looked into it at one point and it sounded like WASM isn't as fast as native (yet?), and the main benefit would be the ability to run in a browser. That'd be useful for making a web version and I might look into it again, but for now, if I'm already shipping an Electron app, WASM seems like extra hassle with less speed. I might be wrong about this though! Happy to hear if there are benefits I'm missing.
- combyn8tor 5y agoIt's pretty dam close to native. I would consider researching it again. You could do away with Electron altogether and just run it in browser. You can make it a PWA to give it that "Native app" feel so the users are none the wiser but you don't have to deal with the complexities of Electron and managing releases etc. If you want to launch a new release just deploy it to your web host and you're done for all platforms. This is all assuming there isn't some specific OS level requirements in your app. I know there are other video editors using WASM successfully and apps like Figma.
- dceddia 5y agoDefinitely worth another look. Thanks for the link!
- combyn8tor 5y agohttps://clipchamp.com/en/blog/clipchamp-pwa-case-study/ https://clipchamp.com/en/blog/clipchamp-pwa-case-study/