Live data from Hacker News

Microsoft seeks Rust developers to rewrite core C# code

theregister.com

11–20 of 256 posts

Re: Microsoft seeks Rust developers to rewrite core C# code

#11
post #6

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?

C# 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.

> 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.

Re: Microsoft seeks Rust developers to rewrite core C# code

#12
post #7
post #6

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?

I suspect this is the .NET runtime + libraries, not applications written in C#.

No, 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/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).

Re: Microsoft seeks Rust developers to rewrite core C# code

#13
post #11

Earlier quoted context omitted.

C# 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.

> 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.

I think the parent post is wrong. This rewrite probably has more to do with performance, "fearless concurrency", and/or developer happiness. C# is safe.

Re: Microsoft seeks Rust developers to rewrite core C# code

#14
post #10

Earlier quoted context omitted.

Is that needed because the compiler accesses some higher privileged APIs?

The MSVC-based compiler doesn't come with a linker, so you need the MSVC build tools to get it. One of the ways to get the build tools is to install Visual Studio, which is fairly large.

You don't need the whole Visual Studio installation, only MSVC build tools and Windows SDK. See here: https://rust-lang.github.io/rustup/installation/windows-msvc...

Re: Microsoft seeks Rust developers to rewrite core C# code

#15
post #6

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?

C# 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.

> C# doesn't have ownership/lifetimes and the kind of safety that comes with them.

That's not really true.

Like rust, C# is memory safe, although it comes at it in a very different way.

"safe" rust does inherently prevent a certain kind of race condition in multi-threaded code that C# does not, thought that's more of a nice incremental improvement, not a fundamental one -- i.e. it doesn't make your multi-threaded code thread-safe, but it does prevent a one type of thread safety violation.

Re: Microsoft seeks Rust developers to rewrite core C# code

#17
post #11

Earlier quoted context omitted.

C# 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.

> 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.

I think GP is talking about concurrency issues that arise even in single-threaded code when simultaneous mutation from multiple sources is permitted.

Re: Microsoft seeks Rust developers to rewrite core C# code

#18

Why is MS so hyped on Rust? It’s good but doesn’t it have its caveats? It seems they’ve become Rust zealots.

> It’s good but doesn’t it have its caveats?

Compared to C#, it's a low level language, where you have to be concerned with a lot of details.

But then, I'd bet this is for replacing bad C# that does low level tasks, that nobody sane would write but MS pushed for anyway because they were hyping C#.

Re: Microsoft seeks Rust developers to rewrite core C# code

#20
I love writing Rust, but I was really surprised by how difficult it was to find a job _actually_ writing Rust.

I'm happy to see the increased activity in the space, but searching for a job in Rust is probably still 10x harder than C or C++.

It worked out in the end, and I'm happy to be getting paid to be writing Rust every day, but I hope that the market for Rust jobs continues to grow -- ideally even faster than it has been.

Post reply on HN