3 ms·
Honestly, I'm increasingly sceptical on this point. If your developers are comfortable writing Rust (and in fairness, this is a big "if", particularly with juni
by MrJohz 4y ago
Honestly, I'm increasingly sceptical on this point. If your developers are comfortable writing Rust (and in fairness, this is a big "if", particularly with junior developers), then I think you can use Rust as a fairly high-level language, and it will quite happily replace Python or Ruby if you want it to.
Recently at my job, we started a new project in Python, which worked fairly well, but the code runs in a somewhat constrained environment. Out of interest, I rewrote the whole project in Rust in about two days, and implemented a big new feature in another day. What I found was that the code ran ~10× as fast, but it was, if anything, even simpler to implement than in Python. Part of that was probably the rewrite effect, and part was definitely the web framework (Warp), but I found I was still mostly writing fairly high-level code. On top of that, when I had to drop down into using more natural synchronisation primitives, it was very easy to (a) do that and (b) wrap that low-level code in a high-level abstraction.
In the end, we decided not to go down this route, mainly because others in the team were less confident about using Rust, but it was, for me at least, a really impressive example of how one can get a lot of the benefits of low level languages with relatively little development cost by using Rust. We probably noticed more of a benefit because of the more constrained environment (although bear in mind, the python alternative had been working just fine for us up until then), but even still, a quicker implementation means less hardware, which means cheaper costs - if you can do that without much effort, that's a pretty good trade-off!
- hot_gril 4y agoI don't think Rust is a lower-level language exactly, but it can be more cumbersome for high-level code than something like Python that has GC, duck-typing, and short-hands for things like generators and list comprehension. For a web backend, I'd actually prefer NodeJS, but you mention a constrained environment and synchronization primitives, which both sound unusual for that application. When I used Rust, the entire purpose of the project was performance. It was a software-defined networking middlebox that's part of LTE networks. But we were doing FFI with C code. Rust was better for the larger concurrent pieces, but I still liked writing in C better for the fine-grained stuff (packet parsers etc).
- Austizzle 4y agoSame thing with me at my job. Super tiny team, just a couple of people. I played around with replacing some of our python with rust and it blew me away how easy it was (once I understood rust at a basic level) while also being so much faster. Similarly, none of that code lives today because the team is too small and nobody else knows rust, so we're sticking with python everywhere