Live data from Hacker News

Microsoft seeks Rust developers to rewrite core C# code

theregister.com

181–190 of 256 posts

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

#181
post #39

Earlier quoted context omitted.

Given your username I suspect you're quite a bit older. I've mentored several grey beards on Rust and they weren't at all happy about it, at first. After a few months though, they were some of its strongest advocates. It's hard to not love Rust when you realize just how much pain it saves you from.

What pain does it save most folks from that are using GC languages (as GP alluded to)? Genuinely curious.

Depends on the language and platform/Runtime...

For C# a single executable over a directory of files. For that and Java, a massive runtime, generally slow cold starts, high initial memory use, reduced relative effectiveness for smaller platforms (RPi and similar).

For JavaScript and Python, slow introp, in addition to the negatives above.

It's also possible to leak memory like a sieve in any language.

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

#182
post #88

Earlier quoted context omitted.

What pain does it save most folks from that are using GC languages (as GP alluded to)? Genuinely curious.

Weirdly enough, some of the worst memory leaks I’ve debugged in my career were in GCed languages. Because any object can reference anything, retaining references can hide anywhere in the code. (Including via closures and other exotic things you forget about). And because in GC languages we don’t often have a destructor (or anything like it), it’s very common for people to forget to clean up resources. (Eg filesystem…

In IE6 it was really easy to lay memory with long lived apps. Any HTML object could have a JS event attached and give versa for object references in JS. Done it was across the COM boundary, if you removed an element from the DOM it would stick around if referenced in JS and give versa for inline JS on* attributes...

I worked on an application with extjs that the workers had to close and reopen at least once a day. Or unofficial instructions were portable Firefox.

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

#183

Earlier quoted context omitted.

What pain does it save most folks from that are using GC languages (as GP alluded to)? Genuinely curious.

Oh man, GC is amazingly nice but when it fails sure does it fail. It also typically fails when your biggest task is reducing overall resource spend, or getting that extra 9 after 3+ 9s of latency reduced. On multiple teams of FAANG engineers, Ive seen the GC be a big part of some meltdown and none of us knew a good way around it. Tuning only goes so far. Otherwise, you just have to give it more memory and CPUs (horiz…

Nothing like a game server engine in C# that would freeze for 15-30 seconds now and then for garbage collection...

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

#184

Earlier quoted context omitted.

What pain does it save most folks from that are using GC languages (as GP alluded to)? Genuinely curious.

Depends on the language and platform/Runtime... For C# a single executable over a directory of files. For that and Java, a massive runtime, generally slow cold starts, high initial memory use, reduced relative effectiveness for smaller platforms (RPi and similar). For JavaScript and Python, slow introp, in addition to the negatives above. It's also possible to leak memory like a sieve in any language.

- Native interop in Java is surprisingly slow and very clunky (C# interop with C/C++ can be as cheap as direct calls nowadays)

- .NET had been able to produce single-file (and self-contained when needed) executables way before NativeAOT was introduced

- RPi is a fairly large platform compared to e.g. Arduino (for which Rust should be awesome) and can be well-served by NativeAOT (today). I might still use Rust for that one in the long run but using C# wouldn't be an issue both in terms of resource usage and OS since it's just an arm64 musl flavour of Linux usually with 1GB of RAM or more which is a lot for .NET (for context ~256MiB containers with ASP.NET Core image is a popular target for back-ends)

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

#185
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?

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

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

#186
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?

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

There's a difference in resources on client machines and resources on thousands of servers in server farms.

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

#187

I'm not totally sold on rust as a language but I have to admit the tooling and ecosystem is really nice. I'm noticing that I'm increasingly using more stuff built with it. I'm also not sold on zig either for many of the same reasons. I prefer my low level languages to be smaller like c. I think that might be true for languages higher level languages too. I just don't like to have to down a lot of documentation on hun…

The tooling/ecosystem looks probably great for developers actively creating with it, but for developers ‘consuming’ it (downloading some foss from github and changing a couple of lines) it leaves a lot to be desired. Not being able to ‘apt install’ a working toolchain on Debian for example - it’s already too outdated after just a year

That's pretty true of a lot of development tools on Debian.

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

#190

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

In 2007 they were .NET zealots and now .NET is old guard

There plenty of ongoing development and support for .Net, it's much less likely a matter of age, as it is handling more requests per server.
Post reply on HN