(OFF-TOPIC, sorry)
Tell me about it! I’ve been prototyping no less than 7 separate Rust programs in the last months – relatively complex too, with async / parallelism mechanics and a lot of zero-copy code blocks that involved way too much fighting with the borrow checker (at one point I gave up and started using .clone()
in all non-hot coding paths because the return-of-investment ratio of developer time was abysmal).
I can confidently say that:
-
Rust is absolutely fantastic, it can ingest thousands of events per second from network and the memory usage in release/optimized mode was like 25MB and the CPU barely registered 3% load. And I had several Rust jobs in the last years, intermingled (and sometimes mixed; maybe I should apply to Fly.io!) with Elixir ones, and I’ve seen Rust programs not breaking a sweat working with 150k req/s in some meager dual-core CPU containers with 4GB RAM. But it’s not just the performance, that’s only a nice bonus. The correctness guarantees and the fearless concurrency do work and they do work amazing. The compiler has stopped me from introducing weird race conditions, many times. I learned and re-learned a lot.
-
…but if you want to prototype quickly and make a proof-of-concept THEN STAY THE HELL AWAY from Rust! (Unless you’re already a master which I am working hard on becoming but not quite there yet.) Rust is not good for prototypes. I dearly regret not writing a library for the network protocols I needed in Golang or Elixir. I could have iterated no less than 5x to 10x faster after that initial time investment. I am not joking. Later on I did a more detailed GitHub search and found a Golang library, and honestly, it took me 2 hours both to relearn Golang and write a prototype that took me 2 weeks with Rust. The difference is that huge. (Although the Rust libraries I had to work with were train wrecks and I had to assemble a working solution out of the ruins of 4 of them – so that was a factor as well).