4 ms·
I think a lot of Rust users would argue they don’t even care much about performance. They just enjoy all of the correctness guarantees the compiler can enforce,
by coder543 4y ago
I think a lot of Rust users would argue they don’t even care much about performance. They just enjoy all of the correctness guarantees the compiler can enforce, as well as how ergonomic the language can feel. Being able to deploy a single static binary, and having an easy to use build tool and package manager are significant bonuses as well. Rust makes really hard problems easier when you know the compiler has your back.
Rust gives you the tools to write very high performance code, but it doesn’t have to be about that.
I’ve had to point out to people quite a few times that garbage collectors can improve performance… especially compared to naive implementations of manual memory management. GCs are not just a tool for lazy programmers. GCs can make allocation incredibly fast, and you get to defer cleanup work to another thread(s), which means less work in the critical path. Removing work from the critical path is how you make software faster. Every tool has tradeoffs, and GCs are a tool. GCs often use more memory as a tradeoff.
I like Rust well enough, but I do wish we had a language that combined the ergonomics of Rust with the dead simple concurrency model of Go/Erlang. I haven’t tried it, but Luantic looks promising: https://github.com/lunatic-solutions/lunatic https://github.com/lunatic-solutions/lunatic
As it is, we’re fortunate to have quite a few great languages and platforms these days.
- drogus 4y agoYou should also check out Gleam! https://gleam.run/ https://gleam.run/ It's almost like Rust and Elixir had a baby :D As for the rest of the comment: totally. Almost none of the code I write in Rust needs C-like performance and I still choose Rust for it.
- ptato 4y ago> I think a lot of Rust users would argue they don’t even care much about performance. They just enjoy all of the correctness guarantees the compiler can enforce Aren't these correctness guarantees only for performance related factors though? (allocation/memory and concurrency). The rest of your program would be just as correct in any other language.
- coder543 4y agoNo. A ton of languages don’t support proper Sum Types, and Rust’s emphasis on errors-as-values helps you think about error handling, instead of only thinking about the happy path. Rust also doesn’t do implicit type coercion and a host of other things that can cause correctness issues. Rust gives you the tools to express more of what you’re doing to the compiler than a lot of languages, which lets the compiler help you more. It’s natural that a lot of programs have some form of concurrency, so that’s an extremely common thing for Rust to help with, but it’s not the only thing.
- ssokolow 4y agoNot really. For me, the number-one Rust feature I love is that, by baking monadic optionality and error return in from the beginning (Option<T> and Result<T, E>), I can trust that, unless an author abuses panic! (in which case I never trust their code again), I can see all a function's return paths in its type signature. (Without having to choke down a pure functional language like Haskell with that currying-based function call syntax that I can never get used to.) The runners-up are how fast Rust starts compared to Python or Java or similar when writing a CLI tool and how nice PyO3 makes safely writing libraries or backends for tools that need to be in Python for some reason like "nothing but PyQt, PySide and possibly QtJambi offers memory-safe QWidget bindings... and I've never found a Java app that didn't feel laggy and sluggish on X11". See also https://cliffle.com/blog/rust-typestate/ https://cliffle.com/blog/rust-typestate/
- lumost 4y agointeresting! The main reasons I like rust are - Can compile to anything, you can use one language to write Cuda Kernels, backend services, distributed processing jobs, WASM apps, and native apps. - Performance, comparable to better than C. I like fast languages as it avoids headaches that come from slow languages. If rust wasn't fast, I'd probably just stick to a polyglot language portfolio and pass it by. EDIT: I also just clicked through to lunatic, that does look very promising!