4 ms·
I’ve been doing mainly JS and TS the last few years and picked up Rust because I wanted to build a video editor. It worked out, the product is launched (used Ta
by dceddia 4y ago
I’ve been doing mainly JS and TS the last few years and picked up Rust because I wanted to build a video editor. It worked out, the product is launched (used Tauri which is also nice) and I’d choose Rust again, even despite the initial pain.
The basics weren’t too hard, but I definitely felt the learning curve! I used C and C++ professionally my first few years out of school, and in some senses Rust felt like coming home - thinking about memory again, references vs values, the short naming conventions… but in other ways (lol borrowing) it was a very different thing. Rust was the first language I learned in recent years where I couldn’t just cobble things together once I knew the basic syntax. The ownership system was at the heart of that, and I kept doing things that went against the grain and made the compiler unhappy.
Having come out the other side though, I’m really happy with Rust. It’s fast, and the safety aspect is awesome because I can be pretty sure that as long as I avoid .unwrap()ing things, the program isn’t going to crash. There’s none of the “null or undefined” anxiety like with JS.
It’s also interesting to see the difference in the communities. I really like how performance is a first-class citizen in Rust! A lot of libraries have benchmarks. People go out of their way to avoid allocating memory. Maybe overkill in some spots for sure, but it’s a stark contrast to the JS world where I often get the sense that talking about performance will attract cries of “premature optimization!”
For learning I used the official Rust Book initially, then Programming Rust (the O’Reilly one) to get another explanation of some things, and then Rust for Rustaceans - which was great but way over my head at the time and I should probably revisit it again.
I would say learning Rust needs a very hands-on approach. It wasn’t, at least for me, the kind of language where I could read a book and then go write Rust. It took practice and failure and mental shifts that I don’t think would’ve happened if I was reading or watching videos.
Good luck with whatever you choose and happy 4th!
- LecroJS 4y agoWow, I can’t believe I’m seeing you in these comments! I was so inspired when I first saw Recut, and I’ve been using your interview questions for inspiration in my own interviews recently. My plan as soon as I get my next day job has been to sit down and start making products with the hope of launching on product hunt and the like to start earning money on the side. This post was mainly shopping for input on long-term conceptual growth, so it’s really nice to get this bonus anecdote on Rust in production from you. I definitely would wait to fully invest my time in it until I have my next job given this + the other replies. I am curious if you did any research on Go or other languages for Recut and why you ended up choosing Rust. Would you make the same decision again? Was it worth the time it took to learn Rust for both product/personal purposes, or would you go with something easier if you had to do it again? Recut was especially interesting to me since I’ve had a real time video chat based app on my mind for almost 2 years now and have known js just won’t cut it. Seems like quite the indicator that I should invest in Rust. Thanks for your reply. Means a lot getting feedback from you down here in the HN trenches!
- dceddia 4y agoAwesome, glad to hear that :) So, for Rust vs Go, honestly I had kinda wanted to learn Rust for a while and have only read a little bit of Go, and – this is going to sound incredibly silly, but I'm not a big fan of some of the syntax and conventions from Go. For Recut, the choice was more between (a) coupling Rust with a web-based cross-platform framework like Electron or Tauri or (b) using C++ and Qt. I guess option (c) would be to write and maintain two versions of the app, one in Swift and the other in something Windows-specific, but as a solo developer I ruled that out pretty quickly. So - Rust vs. C++ - and would the Rust + JS be fast enough? I did some experiments to test out some of the things I was worried about, like rendering video frames, and sending data between the UI and Rust. I've had experience with C++ and Qt in the past, so that was a decent option. But I didn't love the idea of getting back into C++ and fighting with the inevitable hard-to-find crashes and race conditions and stuff. And, from building v1 of Recut in Swift, I came to really enjoy some of Swift's safety, too - like guard clauses that rule out null-pointer-related crashes. Rust seemed similar in those aspects. Given how it turned out, I would definitely choose Rust again. I think it might've been wise to try to learn more about the language and tackle some smaller toy problems first, instead of trying to learn it while writing the app. I didn't do much exploratory hacking, and ended up rewriting whole swaths of the video pipeline stuff multiple times. Like at least 5 times. But maybe that was the best way to actually learn it, too. I don't really know if I would've picked up the intuition for some of the patterns if I hadn't had to fight my way through it. So maybe there's some survivorship bias here haha.