Live data from Hacker News

Microsoft seeks Rust developers to rewrite core C# code

theregister.com

231–240 of 256 posts

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

#231
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…

You are spreading a common misconception. The borrow checker takes care of exactly nothing when it comes to cleaning up resources. The borrow checker is "just" type checking, like a built-in static analysis. But it doesn't affect code generation at all! There is an alternative implementation of the Rust compiler (`mrustc`) which doesn't implement the borrow checker at all! But if your code passes the `rustc` borrow checker, then `mrustc` should compile it correctly (* if you don't use too many new features, afaik it is a bit behind the official compiler).

I think the borrow checker has an unfair reputation of being complicated and magical. Its rules aren't always obvious to a beginner, but at the end of the day it's just type checking / static analysis. People often imagine it also does things at runtime, or affects code semantics in some way. It does not. And it's only scary because because it's so stern :)

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

#232
post #191
post #3

There is a reddit post where a dotnet developer on the MSFT team details why they are moving certain processes to Rust. TLDR, it is all about performance that scale.

Does anybody have a link?

Here is the reddit link, https://www.reddit.com/r/dotnet/comments/1aezqmg/comment/ko8...

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

#234
post #215

Earlier quoted context omitted.

Why not just learn rust? It really is not that exotic to learn. I doubt it is faster to rewrite it.

Trash build times and slow iteration cycle as a result

Build times are pretty good in rust compared to most languages. Where do you get they are trash?

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

#235

Earlier quoted context omitted.

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.

Depends on what you're trying to do. The same can be said of Rust. You can write massive web services serializing days from RDBMS databases quite a bit easier in Rust than with C++ as an example.

> Depends on what you're trying to do.

No it doesn't.

people were effective with C++ before std::optional existed, before compiler assisted move semantics existed, and SFINAE is not something anyone has ever needed to understand in order to use something like the STL or any other template based library, such as Boost.

You don't know what you're talking about, this isn't up for debate.

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

#236
post #220

Earlier quoted context omitted.

I agree. My point is that I just feel like "but someone please think of the ̶ ̶c̶h̶i̶l̶d̶r̶e̶n̶ memory safety" argument is over blown. There are ways to eliminate majority of those issues in cpp as well, but people simply don't care. If You want to use Rust because it's just better language - go for it, I do it as well. But let's actually use that as an argument, instead of hiding behind superficial ones

> There are ways to eliminate majority of those issues in cpp as well, but people simply don't care. If its that easy, why do Google, Apple, Microsoft and basically everyone else keep making memory safety related bugs? Are they all just idiots? Do you think they just don't care about security? Carmack found C++ static analysis tools found mountains of latent bugs in the quake source code - despite the game running gr…

>Do You think people just don't care about security

Yes, people don't care nearly as much as we like to pretend in online debates

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

#237

Earlier quoted context omitted.

- 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 t…

In the onterop issue I was referring to JavaScript and Python. As others mentioned, z Java is pretty bad there too. On the single executable, my understanding is it sad kind of like a self extracting archive that extracted and ran... Meaning slower start times and the need for write access to the file system... Not to mention the framework still needed to be installed. And only more recently was true single executabl…

What? No. Self-contained means the runtime is packaged in the binary, and then trimmed. Self-extract feature is if you want to package third-party native libraries (think tensorflow) inside your binary instead of separate DLL, it is a separate thing.

You just give the users an exe or unix binary and it runs.

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

#238
Below some background from a Microsoft employee (https://www.reddit.com/r/dotnet/comments/1aezqmg/comment/ko8...):

Makes perfectly sense. Rust is a replacement for ultra performance sensitive parts that might have been written in C/C++ before, but not a replacement for C#.

---------------------------------------------------------------------------------------------------------

Hey there!

I work at Microsoft. I can shed a bit of light here.

We use .NET for TONS of things. Absolutely tons of different products and services. I'm on the Office 365 side of the business, currently managing Deployment for all of the hundreds of services that roll out across the world... And we use .NET extensively.

I'm starting my new position managing a team that does routing next week. They have some things that are extremely performance critical. As others have pointed out, we're talking about supporting services and traffic literally across the planet. When it comes to optimizing, they will find ways to squeeze out what they can.

There are languages like C and C++ that get used for some extreme use cases like I mentioned. Reducing as much overhead as possible in certain situations even leads to .NET apps with unmanaged pieces included with them.

There's been a lot of hype around Rust, and for good reason. But it's a system language. It's not like Microsoft is about to go rewrite millions and millions of lines of code and toss out C# (for anyone getting nervous ). They're just being pragmatic and using an effective tool for the job.

Hope that offers some clarity.

---------------------------------------------------------------------------------------------------------

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

#239
post #236

Earlier quoted context omitted.

> There are ways to eliminate majority of those issues in cpp as well, but people simply don't care. If its that easy, why do Google, Apple, Microsoft and basically everyone else keep making memory safety related bugs? Are they all just idiots? Do you think they just don't care about security? Carmack found C++ static analysis tools found mountains of latent bugs in the quake source code - despite the game running gr…

>Do You think people just don't care about security Yes, people don't care nearly as much as we like to pretend in online debates

I partially agree with you. I think most security compromises are due to misconfigured mongodb databases, bad passwords and unpatched software staying unpatched for months or years. Things like that. Lots of B tier engineering companies get done by this stuff every year because they’re sloppy.

But memory bugs in C++ seem genuinely hard even if you do care about the problem. Google and Apple have never (as far as I know) had customer data stolen by some trivial misconfiguration problem. They pay out a lot of money in bug bounties. Google recruits some of the world’s smartest people to look for security problems in their products. And I’m sure they pay a bomb for access to proprietary C++ static analysis tools. And yet, they apparently still can’t consistently write memory safe C++ code. So yeah, I think that writing bug free c++ at scale is hard even if you do care about it.

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

#240
post #10

Earlier quoted context omitted.

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

Those are still huge though, for some reason.
Post reply on HN