Comment by dceddia
5 years ago
This seems like a huge positive step forward for Svelte and the community. Big congrats to Rich!
I've been excited about Svelte for a while and recently chose to use it as the UI for a cross-platform video editing app (https://getrecut.com), with the back end in Rust. I've found it a pleasure to work with -- Svelte Stores and the Context system are especially great for sharing state, and the app feels snappy. Last few weeks most of the focus has been on the Rust backend but I'm really looking forward to building out more of the UI soon.
I've also been happy to find that its generated code is pretty readable. On one little performance-tuning side quest, I was profiling to figure out why the app was performing a Layout on every video frame, and I was able to step through the compiled Svelte component code and narrow it down to one of my own functions. I also briefly went down a path of trying to manually set the text content on an element, to see if it'd be faster than letting Svelte do it. Turned out the answer was no, but it was nice to know that level of control is available if I need it some day.
Excited to see where the Svelte community goes from here!
> I was able to step through the compiled Svelte component code and narrow it down to one of my own functions.
This is the best part about next-gen frontend frameworks. We can go back to having a stack trace uncluttered by layers of asynchronous abstractions.
Love me some good old synchronous code! :D
Do you have a mailing list I can toss my email on for when this is available on Linux? Honestly I was ready to buy it instantly before I saw the platform limitation, but it would be even better if it could run some basic filters like removing pops and de-essing, which I always struggle to get working right in Audacity (I have a screenshot saved of my filter curve because Audacity doesn't save it, it's so stupid).
It's not Linux-specific but you can sign up to hear about the Windows one (click the "Get Notified" button on the home page) and I'll let everyone know if/when there's a Linux version.
Fair warning I haven't even tried getting it to run on Linux yet... but I've been meaning to try it out, if only for the profiling and debugging tools! (rr looks really cool!)
In theory it runs everywhere because Electron, but my gut says the difficulty with supporting other platforms will come down to compiling and packaging. That's been the biggest hurdle with Windows so far anyway.
Linux packaging can definitely be confusing -- as a user I definitely prefer something like an AppImage for a program like this, which should be easy enough to provide. I wouldn't worry about making distribution specific deb and rpm packages, personally.
I see your app is MacOS only at the moment. Are you re-writing it in Electron or what? Very curious
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/) 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.
> 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.
1 reply →
Did you look at .Net solutions like Maui, xamarin, uno platform, or AvaloniaUI?
7 replies →
React-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.
1 reply →
Interested to hear if you considered compiling Rust to WASM and what your thoughts were?
4 replies →
Also curious - I'm spinning up a small side project with Rust and Svelte. Was looking in Tauri as a replacement for Electron but wondering what other approaches people have worked with (assuming this is a cross platform desktop app, that is).
I'm using quickjs (rquickjs specifically) to bind GTK's C API to Javascript and adding a light DOM wrapper (get/setAttribute, add/removeEventListener, etc) that covers all the functionality Svelte needs. I've had to make a few modifications to the compiler (<10 lines total) to get binding and CSS working but so far it's been great.
Working in GTK with hot reload and instantaneous esbuild rebuilds is.... insane.
Tauri seems like a nice option. It's not as full-featured as Electron yet but their focus on security is great to see (last I saw they were getting the codebase professionally audited). The main reason I didn't go with it was just that doesn't seem to (yet?) suit my use case with zero-copy data transfer between Rust <-> Browser.
My hope is that by writing most of my backend in Rust, that it'd be easy-ish to switch to Tauri or other options if something changes down the road.
Looks cool - what is the timescale for Windows?
Weeks to months, hopefully by the end of the year? We’ll see! A lot depends on what other challenges come up, heh.