Live data from Hacker News

Microsoft seeks Rust developers to rewrite core C# code

theregister.com

71–80 of 256 posts

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

#71
post #44
post #37

Earlier quoted context omitted.

The trick is to introduce Rust wherever you're at, assuming it's a good fit for the task. This may be harder to do if you don't have enough influence.

Quick way to be annoying and unlikeable at work. The times I've seen rust introduced, and tried it my self, it introduces a whole bunch of related tech debt. Like hacks to make builds work

If it's a good fit then it's a good fit. Of course you'll need to ensure the CI is set up properly, just like everything else.

If it's not a good fit, then you're just forcing it, and yeah...

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

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

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

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

#73

Earlier quoted context omitted.

Yup, we were hiring C++ devs recently and it was quite common for candidates to mention Rust. Did they not read the job description??? Immediate red flag.

I've been a C++ dev for most of my career. Not looking to change jobs at the moment, and I like C++ a lot. We still occasionally start new projects in C++ where I work. I've tinkered with rust in my spare time, but never introduced it at work. I think the borrow checker is a fantastic tool, but Rust has just never been the right tool for the domain we're in. But I'm a bit confused by your statement. There's a lot of…

It’s a red flag because you’re going to get people bring in random languages just because, then they fuck off to another job and you’re left supporting code that nobody knows.

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

#74

Earlier quoted context omitted.

Are you not a developer? Being proficient in one means that it will take very little time to transfer to the other. C++ and Rust have a great deal of overlap in that way.

It only works one way though (at least in this case). If you know C++ you can quickly become proficient in Rust. But not the other way around.

Yeah C++ have steep learning curve compared to Rust.

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

#75

Earlier quoted context omitted.

Agree, I am still looking for a Rust position, although I have more than 3 years of experience with it. And yes, it is very hard. It seems Rust is in a chicken/egg position: employers avoid it because "there are few developers", developers avoid it because "there are few jobs". Until recently the majority of Rust jobs were blockchain stuff. Now I see a rise in network infrastructure and security.

Seems like RUST needs work to become easier to learn. Hard for a business to take a risk on using it (outside of a use case absolutely needing a memory safe language) if the talent pool is shallow.

Learning Rust to the point of being productive is 100x easier than C or C++. It's not even funny.

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

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

GC _is_ the pain. Lots of use-cases where precise memory management is critical, or real-time guarantees are needed that are difficult with GC.

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

#77

Earlier quoted context omitted.

Not really. There's the IDisposable interface you can implement, and some language features around making it easy to use[2], however there's nothing preventing you from not using those language features and forgetting to call Dispose. In case you forget the GC will call Dispose but it's entirely up to the GC when that happens, so personally I wouldn't say it's similar. [1]: https://learn.microsoft.com/en-us/dotnet/fu…

>In case you forget the GC will call Dispose but it's entirely up to the GC when that happens, so personally I wouldn't say it's similar. This actually has to be implement in the classes finalizer its not done automatically. The finalizer is called by the GC which if the designer chooses can call Dispose. This is usually done in well designed classes that use unmanaged resources. Dispose and using give you the determ…

Good point, I forgot about that little, but crucial, detail.

So it's flexible, but there are footguns about, especially if you're wrapping a handle to something external.

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

#78
post #68

Earlier quoted context omitted.

Seems like RUST needs work to become easier to learn. Hard for a business to take a risk on using it (outside of a use case absolutely needing a memory safe language) if the talent pool is shallow.

Honestly. Rust is not all that “difficult”. There’s just SO MUCH that you MUST know to be effective. You need to know all of the rustisms. Plus you need to have a general knowledge of memory. You need to understand how memory is being abstracted and how to work within those constraints so as not to be slow. You need to know all of the monads, what they mean, why each exists, what the nuance is, and why you might use…

> A “being effective at rust” book would probably dwarf a “being effective at C++” book in pages assuming similar prose. And we all know how much of a beast C++ is.

I've written C++ for close to a decade before switching to Rust, and this is categorically untrue.

> Plus you need to have a general knowledge of memory. You need to understand how memory is being abstracted and how to work within those constraints so as not to be slow.

If anything, this is more true so of C++.

> You need to know all of the monads, what they mean, why each exists, what the nuance is, and why you might use one over another in a specific situation

You can use a lot of stuff before needing to know their full history. You don't need to know the history behind 0, null, pointer, numbers and addresses before, how hardware works, etc to use Option, for example. You also don't need to know the (inconsistent and arcane) history of errno and magic numbers to use Result. Etc, etc.

This vastly over-exaggerates Rust's complexity.

Yes, it borrows concepts from functional programming, but a lot of these concepts are simpler than stuff you deal with in imperative programming.

I think the issues here is that people don't tend to like to change their way of thinking, even if it's for the better. Also, Rust has ample in common with imperative/traditional language, so it's not a huge leap into some alien mental model, as you make it sound.

Further, C++ makes you think way more than Rust; in Rust the compiler does a lot of the thinking for you. Not to mention, the type system is easiest to reason about than C++'s old (and mentally inefficient) template system.

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

#79
post #73

Earlier quoted context omitted.

I've been a C++ dev for most of my career. Not looking to change jobs at the moment, and I like C++ a lot. We still occasionally start new projects in C++ where I work. I've tinkered with rust in my spare time, but never introduced it at work. I think the borrow checker is a fantastic tool, but Rust has just never been the right tool for the domain we're in. But I'm a bit confused by your statement. There's a lot of…

It’s a red flag because you’re going to get people bring in random languages just because, then they fuck off to another job and you’re left supporting code that nobody knows.

People _mentioning_ Rust means they will bring a random language into your stack if they are hired?

This red flag cultural trend is blinding people to nuanced thought.

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

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

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 (horizontally or vertically).

Almost always the answer was, this might need to be reworked in C++ entirely or JNI. In same cases it even got funded and was a tremendous success (like 10x fewer resources). However, then you’re dealing with C++ and all of its issues.

I’m looking forward to more value types in Java but managing the heap will always be a bottleneck eventually.

Post reply on HN