this post was submitted on 27 Oct 2024
56 points (96.7% liked)
Rust
6005 readers
4 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
That is interesting and I didn't know C# had anything like that. I saw another article recently saying at some point we were likely to see Rust get garbage collection.
The reason is the vast majority of places use c# to avoid this stuff. So performance is often not the first priority
The complexity it adds takes away from the readability and maintainability. Which is often the priority.
But in a hot path where you need optimization these are a good send as previously you had to use raw pointers and completely side step all the safety of the language.
I would say 90% of c# developers will never touch these. It's more for library and framework writers.
I believe most of these features are driven by what the Microsoft Devs need to write asp.net and EF.
Yeah I had thought that C# was basically Microsoft's version of Java, GC'd throughout. But it's fine, I'm not particularly more excited by it now than I was before (i.e. unexcited). I'm not even excited by Rust, but maybe I'm missing something. I think it's fine to use GC for most things, and program carefully in a non-allocating style when you have to, using verification tools as well.
A classic: http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html
It has always had structs. They are often used for interop but can be used to avoid allocations and they are memory safe out the box, which nice.
Both languages are really great in my opinion. But very different use cases generally.