19 comments
With the code side by side you get to learn what each language does, even if you know neither of them. That gives you a perspective which just the book on Rust might not, or the book on C# might not.
Also I found myself amused at the section on classes, where it literally just says Rust doesn't have classes, only structs. And then the next section is on records, and it says Rust doesn't have any of that either.
C# tooling for HTTP and gRPC web services is really, really good and very competitive performance wise. The large set of base class libraries and first party libraries that continuously get patched is a win, too.
Especially the "unfair" comparison of the document sticking as much to the BCL as possible and trying to avoid NuGet packages, but needing cargo packages for a lot of the side-by-sides, seems to favor C# for some types of programming.
It's great that C/C++ developers are finally starting to see the light and moving to Rust. Maybe Rust is finally the bridge from C/C++ to C# that Microsoft has historically been missing and has been the source of some internal wars at Microsoft.
C# is getting its memory model revisited, in a refactoring similar to how Swift 6 went through, both caused by Rust's adoption.
Apparently in both cases one of the reasons was Native AOT wasn't up for the job, which would have been good use cases to prioritise which tickets to care about.
Likewise, the reason for the Copilot SDK to move to Rust is that it compiles to native binaries with no runtime and the FFI can interface with all of the supported SDK languages cleanly. Don't just read the headline; ready the actual post as well.
> ...Porting that runtime layer to 100% Rust, resulting in a pure native binary exposing a C ABI for in-process consumption by all the language front-ends
C# AOT is relatively nascent and not yet propagated through all of the ecosystem and thus is not a great choice for scenarios where the goal is a native binary with no runtime. Hejlsberg also cited the same reason for the TypeScript runtime. IMO, this is not C#'s strong point and sweet spot; sweet spot is web API backends.Read my assertion carefully: web APIs are C#'s sweet spot. CLI apps, multi-platform SDKs -- makes total sense to use Rust.
I'm C# Dev that'd want to learn Rust at some point and such guide makes it very helpful
I think the tooling matters more than the language at this point.
https://learn.microsoft.com/en-us/windows/dev-environment/ru...
Read the full thread on Hacker News →
Related stories
- Rust for C#/.NET Developersmicrosoft.github.ioHacker News · 1 points · 4 days ago
- The Verge · 0 points · 6 days ago
- The Verge · 0 points · 6 days ago
- DEV Community · 0 points · 8 days ago
- Rust fact vs. fiction: 5 Insights from Google's Rust journey in 2022opensource.googleblog.comLobsters · 81 points · over 3 years ago
- Lobsters · 13 points · over 2 years ago