4 ms·
What's the point of rewriting from C# to Rust, as C# is performant enough and already has memory safety? What will offset the huge rewrite cost?
by rahen 3y ago
What's the point of rewriting from C# to Rust, as C# is performant enough and already has memory safety? What will offset the huge rewrite cost?
- chiph 3y agoI suspect this is the .NET runtime + libraries, not applications written in C#.
- Merad 3y agoNo, they're looking at migrating some core Office 365 services to Rust. This is the job posting: https://jobs.careers.microsoft.com/global/en/job/1633482/Principal-Software-Architect https://jobs.careers.microsoft.com/global/en/job/1633482/Pri... At the scale of O365 it totally makes sense to look at a high performance non-GC language for your core systems that see the most traffic (I say this as a .Net dev).
- cebert 3y agoToo bad you have to be in the office 50% of time for that role.
- solarkraft 3y agoThat surprises me since I'd expect that you could get really far with hot path optimisation.
- adrr 3y agoNot sure microsoft’s problem is the language. Their frontend JavaScript code is bloated and slow. It makes office365 feel slow and there are so many bugs in the azure management tools. I assume the backend code has the same low quality.
- Merad 3y agoI imagine the goal here is to optimize MS' compute and hosting costs. The core pieces of O365 probably handle many billions of requests per day. At that scale even small optimizations can be worth millions a year in cost savings.
- struant 3y agoSounds like a skill issue to me. Their code sucks and they want to blame the language.
- dragonwriter 3y agoC# doesn't have ownership/lifetimes and the kind of safety that comes with them. Also, at the scale of Microsoft’s core global services, when you are paying for the processing, fast enough (or “CPU efficient enough”) isn't the same as with common apps. Even small efficiency gains are going to yield sufficient savings to be worth a fair amount of developer time.
- hgs3 3y ago> C# doesn't have ownership/lifetimes and the kind of safety that comes with them. Could you elaborate? C# has a garbage collector for tracking resources.
- lucasyvas 3y agoI think the parent post is wrong. This rewrite probably has more to do with performance, "fearless concurrency", and/or developer happiness. C# is safe.
- whimsicalism 3y agothread safe?
- jmull 3y agoIt isn't, but neither is rust. Safe rust is safe from data races, but that's just one kind of potential thread safety issue -- one of the simpler kinds. It's not nothing, but not anywhere close to thread-safe.
- Kinrany 3y agoI think GP is talking about concurrency issues that arise even in single-threaded code when simultaneous mutation from multiple sources is permitted.
- deleted 3y ago[deleted]
- 3y ago
- packetlost 3y ago> C# is performant enough until it isn't. At Microsoft's scale, I imagine performance is actually a major concern for certain pieces of applications.
- fbdab103 3y agoConsidering the Microsoft consumer software that burns cycles to do trivial things (Teams, OneDrive, pick your favorite example). I do not think language performance should be a compelling argument.
- LeFantome 3y agoHow have you established that there is a “huge rewrite cost”? Despite other comments here, I see nothing in the post that says “we are moving away from C# and rewriting everything in Rust!” Microsoft is using Rust in Windows as well. They have given examples of how. In that case, they are not “rewriting Windows” but rather targeting specific components that benefit from the characteristics of Rust. Those components are just part of the larger application that is still primarily written in C. C# easily with C and therefore with Rust. They interoperate well. So it seems likely that MS is following the same plan and rewriting specific components of the larger system that would benefit from Rust.
- tracker1 3y agoWho says they are? Probably depends and varies by the application. One example I could think of is if it's currently a SaaS on Azure, but it needs to be portable enough for a version to run in a low end Arm IoT device. Or if it's deployed to thousands of servers and taking excessive memory or CPU resources for a monitoring agent. Or GC freezes affecting other adjustments systems. There are plenty of reasons to retire C# to Rust.