Live data from Hacker News

Microsoft seeks Rust developers to rewrite core C# code

theregister.com

101–110 of 256 posts

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

#101
post #82

Earlier quoted context omitted.

That hasn’t been my experience with it. I found rust significantly harder to learn than C; and this is after I already knew C. (At least - learn rust to the point of feeling productive, and like I wasn’t fighting the borrow checker constantly). Arguably becoming an expert in C means you need to understand all the nuances of undefined behaviour. And that’s a much harder process. But it can happen slowly. Rust preloads…

> I found rust significantly harder to learn than C language itself maybe, but you also need to learn ecosystem, libs, build systems, testing. Benchmark could be: how fast you can learn and bootstrap some type of app of your choice: high performance DB or torrent server, etc. > You essentially can’t write rust at all until you understand rust references, lifetimes (implicit and explicit) and the borrowchecker why is…

> but you also need to learn ecosystem, libs, build systems, testing.

That’s a really good point that I hadn’t thought of. If we include header files, compiling and linking, makefiles and CMake and the mess of dealing with 3rd party libraries in C - well, yeah. All that stuff is probably worse than learning the rust borrow checker. I think I’ve forgotten how horrific that mountain is for beginners because I learned most of it decades ago, while the pain of learning rust is still fresh.

> why is that? You can write rust the same way you write C

Because I use pointers everywhere in my C code. Rust’s borrow checker simply won’t compile my code if I transliterate it directly from C. There are software patterns which work well in rust with the borrow checker in mind - but they take time to learn and get used to. Until you do, you simply aren’t productive.

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

#102
post #68

Earlier quoted context omitted.

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…

"Dwarf"? "Dwarf"?! I may be biased (because I am very effective at Rust and terrible at C++) but I can't believe this seems probable. std::optional, move semantics, boost, template templates, SFINAE(!!) C++ has all the expressivity of Rust and more, with far less regulation to assist the programmer in using it effectively.

you don't have to know _any_ of what you just listed in order to be effective with C++.

the closest thing to required would be move semantics.

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

#104
post #95

I find this very strange, Microsoft has a lot of big internal high-performance services written in C#. You have to be intentional about some things - largely making sure objects are very short-lived or very long-lived, to avoid long GX pauses. But .NET performs much better than it did 10-15 years ago and I can't think of a fundamental reason why you'd rewrite in Rust.

The Rust folks are working on experimental codegen for the CLR https://fractalfir.github.io/generated_html/rustc_codegen_cl... leveraging the existing CIL/CLR support for "unsafe" languages. Once that work is complete, you should be able to rewrite C# code to Rust on a very fine-grained basis (a single function at a time or thereabouts), just like you can when porting C to Rust. Of course, you'll also be able to remove the CIL/CLR dependency altogether if you're left with 100% Rust code, and compile to a binary just like in ordinary C/C++.

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

#105

Earlier quoted context omitted.

> I found rust significantly harder to learn than C language itself maybe, but you also need to learn ecosystem, libs, build systems, testing. Benchmark could be: how fast you can learn and bootstrap some type of app of your choice: high performance DB or torrent server, etc. > You essentially can’t write rust at all until you understand rust references, lifetimes (implicit and explicit) and the borrowchecker why is…

> but you also need to learn ecosystem, libs, build systems, testing. That’s a really good point that I hadn’t thought of. If we include header files, compiling and linking, makefiles and CMake and the mess of dealing with 3rd party libraries in C - well, yeah. All that stuff is probably worse than learning the rust borrow checker. I think I’ve forgotten how horrific that mountain is for beginners because I learned m…

> Because I use pointers everywhere in my C code. Rust’s borrow checker simply won’t compile my code if I transliterate it directly from C.

borrow checker is more relevant to C references I think.

For pointers you can use Arc or Rc and don't worry about borrow checker.

Disclaimer, I am not a rust or c coder, so my opinion has a high chance to be wrong..

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

#106
post #2

I upvote almost any post "in Rust" here (yeah that's me) but this story went bit too far. It was just one job posting and so many sites acts like MS is going to ditch C#.

That’s funny because I downvote almost any “in Rust” post here! C# — and garbage collected languages in general — aren’t going anywhere. With the shift to Arm, languages compiled for a runtime interpreter will get even more important for Microsoft.

Interpreters such as wasm :P

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

#108
post #99
post #84

Earlier quoted context omitted.

Given the number of CVEs that can be directly attributed to C and C++ you only need to be half-joking to argue that approximately nobody has managed to learn the languages sufficiently to write production code in them.

As uncomfortable as this is to say, the existence of latent security vulnerabilities doesn’t seem to stop people from shipping a lot of apparently working code in C and C++. And I don’t think a lot of those CVEs come from people misunderstanding the languages. As I understand it they mostly come from honest software bugs. C++ makes it easy for honest mistakes by experts to become security nightmares. This is a contro…

Which is why some people push for no longer using C and C++ as much as possible. It's just not feasible to expect the average programmer to avoid all the security pitfalls. Of course, whether Rust is the best option isn't a given.

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

#109

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.

I don't care that it's hard to learn. What turns me off rust is that if I ever make a change that requires a lifetime annotation, I now have to go back through all my code potentially adding lifetime annotations to everything it touches.

I was making a little toy compiler in rust and basically gave up when I wanted to make a change that would have amount to string -> string_view in c++ because in rust I now need to tell the compiler that the String to my &String is going to outlive the struct. Now I understand why it's good but Id rather just let c++ blow my feet off. Maybe once I nail down all the data structures I'll rewrite it in rust.

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

#110

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.

I don't care that it's hard to learn. What turns me off rust is that if I ever make a change that requires a lifetime annotation, I now have to go back through all my code potentially adding lifetime annotations to everything it touches. I was making a little toy compiler in rust and basically gave up when I wanted to make a change that would have amount to string -> string_view in c++ because in rust I now need to t…

Isn't that why Rc and Arc exist in Rust? So that you can deal with situations where you don't know the object lifecycle at compile time?
Post reply on HN