News for hackers. Stuff that matters.
Re:Microsoft seeks Rust developers to rewrite core C# code by mmastrac on Saturday February 03, 2024 @11:43AM (#39242008)
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.

Re:Microsoft seeks Rust developers to rewrite core C# code by diego_moita on Saturday February 03, 2024 @12:13PM (#39242387)
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.

Re:Microsoft seeks Rust developers to rewrite core C# code by godzillabrennus on Saturday February 03, 2024 @12:48PM (#39242791)
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.
Re:Microsoft seeks Rust developers to rewrite core C# code by unclad5968 on Saturday February 03, 2024 @02:35PM (#39243920)
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 by miniupuchaty on Saturday February 03, 2024 @04:06PM (#39244745)
If you're fine with dropping safety you can just make a wrapper around a raw pointer. I wouldn't do it in public library but if it's fine for your cpp code then it's fine for your rust code. You can always drop to the "blow my feet off" level.
Re:Microsoft seeks Rust developers to rewrite core C# code by zozbot234 on Saturday February 03, 2024 @02:38PM (#39243957)
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?
Re:Microsoft seeks Rust developers to rewrite core C# code by merb on Saturday February 03, 2024 @04:36PM (#39244981)
The last few versions made a lot of the lifetimes elided so you can drop them.
Re:Microsoft seeks Rust developers to rewrite core C# code by pdimitar on Saturday February 03, 2024 @08:04PM (#39246458)
Do you have a direct link? I'd love to read more.
Re:Microsoft seeks Rust developers to rewrite core C# code by merb on Sunday February 04, 2024 @06:18AM (#39249371)
Sadly not. But between 1.5x and 1.7x a lit of things changed, especially around traits and there is clippy which actually helps. So our functions barely need lifetimes anymore.
Re:Microsoft seeks Rust developers to rewrite core C# code by winrid on Sunday February 04, 2024 @04:17AM (#39248781)
I feel like this has been this way for at least two years, too?
Re:Microsoft seeks Rust developers to rewrite core C# code by merb on Sunday February 04, 2024 @06:15AM (#39249353)
Well maybe we started with 1.5x or so and especially impl trait‘s made a lot of things easier. We barely have lifetimes in our rust code.
Re:Microsoft seeks Rust developers to rewrite core C# code by pornel on Saturday February 03, 2024 @04:40PM (#39245017)
This effect of <'a> spreading everywhere is very frequently a novice mistake of putting temporary scope-bound loans (AKA references) in structs that aren't temporary views themselves.

People used to C or C++ perspective tend to reflexively (over)use references to avoid copying, but references in Rust are to avoid owning, and not-copying is handled in different ways.

BTW, apart from edgiest of edge cases, &String is a useless type in Rust, because String already stores data "by reference" and is never implicitly copied. For loans it's generally better to deref to &str.

Re:Microsoft seeks Rust developers to rewrite core C# code by imetatroll on Saturday February 03, 2024 @08:03PM (#39246457)
I am a novice when it comes to rust but as I recall the instant you put anything that isn't a scalar type you need lifetimes. Is that what the person you are replying to frustrated with?

How would not copying be handled?

Sorry for the basic questions. Your comment tickles something in my brain that suggests I need to know.

Re:Microsoft seeks Rust developers to rewrite core C# code by telios on Sunday February 04, 2024 @05:48AM (#39249187)
Very rarely do you need to pass around a lifetime-bound struct or enum that isn't _also_ meant to be temporary. (One database pool has database connections lifetime bound, for example, but the pool still owns the connection.) When I do, I generally eat the cost and put it behind a Rc/Arc, where cloning is cheap.

It is 'borrowing' because you don't own it, not because you don't want to clone/copy it. Sometimes it is cheaper to borrow than it is to clone/copy; sometimes it is not.

Re:Microsoft seeks Rust developers to rewrite core C# code by pdimitar on Saturday February 03, 2024 @08:03PM (#39246447)
> and not-copying is handled in different ways

Can you give a few examples?

Re:Microsoft seeks Rust developers to rewrite core C# code by frfl on Saturday February 03, 2024 @09:38PM (#39247015)
I feel like this could be a great in depth blog post...unless such a blog post already exists? It would greatly benefit novices and those who haven't gotten to that stage where this mentality kicks in.
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @12:58AM (#39247984)
There's a pretty good YouTube video I saw pulling all the types of strings in rust.

I find it confusing still... Been wanting to do a few things that would mean dealing with it streams that could be cp437 or utt8, generally and haven't been quite sure how I want to deal with it.

Re:Microsoft seeks Rust developers to rewrite core C# code by iknowstuff on Sunday February 04, 2024 @07:17AM (#39249659)
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @03:10PM (#39253878)
I'm thinking I want to convert to/from utf8 at the edges even for the encoding... Namely web/terminal, then the internal interfaces and relay in utf8, then back to co437 for door game interaction.

Basically a BBS door running service, with some extra niceties internally.

Re:Microsoft seeks Rust developers to rewrite core C# code by rightbyte on Sunday February 04, 2024 @05:55AM (#39249228)
This is more or less the reason I don't like adding "const" to member functions in C++, or setting any method or field to anything but public.

Working with the code base gets so annoying if you suddenly want to change something you didn't plan for.

Such changes can have a domino effect through the code.

Re:Microsoft seeks Rust developers to rewrite core C# code by wredue on Saturday February 03, 2024 @01:03PM (#39242979)
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 one over another in a specific situation.

It’s not difficult so much as it just takes so much time and challenging-yourself practice to try to memorize everything.

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.

Re:Microsoft seeks Rust developers to rewrite core C# code by spoiler on Saturday February 03, 2024 @01:17PM (#39243114)
> 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 by withoutboats3 on Saturday February 03, 2024 @01:20PM (#39243144)
"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.
Re:Microsoft seeks Rust developers to rewrite core C# code by PH95VuimJjqBqy on Saturday February 03, 2024 @02:05PM (#39243589)
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 by tracker1 on Sunday February 04, 2024 @01:05AM (#39248010)
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.
Re:Microsoft seeks Rust developers to rewrite core C# code by PH95VuimJjqBqy on Sunday February 04, 2024 @05:57PM (#39255393)
> 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 by thfuran on Saturday February 03, 2024 @05:18PM (#39245335)
>It’s not difficult so much as it just takes so much time and challenging-yourself

What's the difference?

Re:Microsoft seeks Rust developers to rewrite core C# code by adamnemecek on Saturday February 03, 2024 @01:12PM (#39243069)
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 by josephg on Saturday February 03, 2024 @01:20PM (#39243147)
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 all the pain. You essentially can’t write rust at all until you understand rust references, lifetimes (implicit and explicit) and the borrowchecker. The payoff is huge, but I found climbing that mountain to be no joke.

Re:Microsoft seeks Rust developers to rewrite core C# code by zozbot234 on Saturday February 03, 2024 @01:48PM (#39243415)
> You essentially can’t write rust at all until you understand rust references, lifetimes (implicit and explicit) and the borrowchecker.

You can if you're willing to use stuff like .clone() and the interior mutability types. In Rust, you can tell when code has been written to be a bit sloppy because it has that kind of boilerplate. And the compiler checks are a huge help when it comes to refactoring the code and making it cleaner and better-performing.

Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Saturday February 03, 2024 @04:04PM (#39244733)
Eh. If you don’t know how references work in rust, you’ll struggle to use most of the standard library or any 3rd party crates. And if you can’t pass mutable references to functions or iterators there’s a lot of programs that will be hard to write at all. Performance will be pretty rubbish too.

You might be able to write some simple programs, but I wouldn’t say you know rust yet, or could really be productive with the language.

Re:Microsoft seeks Rust developers to rewrite core C# code by riku_iki on Saturday February 03, 2024 @01:49PM (#39243423)
> 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 that? You can write rust the same way you write C but with nicer syntax, standard lib and build system and more potential to future expansion.

Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Saturday February 03, 2024 @02:04PM (#39243572)
> 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 by adamnemecek on Saturday February 03, 2024 @03:00PM (#39244166)
Yeah, that's what I meant by productive. Not like learn the language but like build stuff.
Re:Microsoft seeks Rust developers to rewrite core C# code by riku_iki on Saturday February 03, 2024 @02:09PM (#39243639)
> 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 by josephg on Saturday February 03, 2024 @06:35PM (#39245876)
If you want to learn rust, there really isn’t a way to avoid learning lifetimes and the borrow checker. It’s a core part of how the language works. You can probably get partway there with Rc and by cloning stuff everywhere but you’ll still run into borrowck problems. Rc doesn’t turn off the borrow checker. (Nor does unsafe). But then you won’t have the tools to solve your problems. And you also won’t know how to use most of the standard library or any crates. That’s no way to write rust.

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

I’ll take a step back. I hope this is helpful to someone and not patronising.

Go and similar languages are memory safe because no matter what go code you write, go runs your program with a GC that makes sure your variables are freed correctly only when it’s safe to do so. Rust’s safety is very different. It comes from checking at compile time that your program is written in a way that obeys a bunch of complex rules. For that to work, you have to write your code very carefully. If you mess up, the compiler doesn’t fix it for you. It just refuses to compile. So you have to write your code with those invariants in mind, or your program won’t build at all.

C code generally doesn’t obey any of rust’s rules - for obvious reasons. If you were to just blithely translate C to rust code, the rust compiler will refuse to compile your program because the rules aren’t being followed. To write rust code that the compiler accepts, you need to first learn the borrow checker’s way of seeing the world. Then you need to restructure your code to work in accordance to rust’s rules. And sometimes that’s a super obscure and tricky problem.

Weirdly, I think it’d be much easier to go the other way. Any compiling rust program could be translated into a memory safe C program if we had a compiler that did that. (I think). And lots of C programmers say learning rust made them better at C - because rust’s rules genuinely teach you to be more disciplined with memory and show you some clear rules for making C code that’s much less error prone.

Not learning the borrow checker is like not learning how objects work in Python. You could write some simple programs. But you’re going to have a bad time, especially if you try to do anything nontrivial, use library code or read anyone else’s programs.

Re:Microsoft seeks Rust developers to rewrite core C# code by adrianN on Saturday February 03, 2024 @01:22PM (#39243173)
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.
Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Saturday February 03, 2024 @01:56PM (#39243486)
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 controversial opinion - but I think the fault is in C and C++ themselves. Not the programmers who need to work even harder such that they stop ever making mistakes.

Re:Microsoft seeks Rust developers to rewrite core C# code by vacuity on Saturday February 03, 2024 @02:29PM (#39243865)
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 by josephg on Saturday February 03, 2024 @06:40PM (#39245902)
There aren’t a lot of memory safe options if you want the kind of performance rust offers. Rust is fine, but it’s far from perfect. It’s hard to learn, complex, and the macro and async systems are honestly a bit of a mess. I’m really looking forward to whatever comes after rust. I’m hoping some bright sparks out there manage to make a language with rust’s memory safety but that cleans up some of rust’s rough edges.
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @01:15AM (#39248047)
To be fair, how many applications really need Rust's level of performance? I mean operating system code and drivers... But, many apps are getting the job done in electron with a browser engine.

I like rust, I like the sensibilities. Maybe my experience is too limited to higher level problems though. There's plenty of room for the likes of Go, Java and C# is all I'm getting at.

Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Sunday February 04, 2024 @11:03AM (#39251318)
Yeah I think I broadly agree with you. Not many applications need rust's performance. Go, Java, C#, nodejs, python, etc are all great languages.

But the software which does need or want "native performance" is incredibly important software. I'd use rust for things like databases, operating systems, web browsers, high performance web servers, network services (samba, ssh), and other "systems" software like that.

Most of the lines of code ever written are probably in application code. If you're making a company website, python or C# or whatever is totally fine. But a remarkable proportion of the lines of code your computer actually runs were written in C or C++. Your web server might be in python, but if you use nginx as a proxy - well, thats C++ (I think). Use postgres? C++. Running your software in linux? C. Testing with Chrome? C++. What is python itself written in? I dunno, but I bet its either C or C++. You get the picture.

Whether or not rust is a big deal is largely a matter of focus.

Re:Microsoft seeks Rust developers to rewrite core C# code by LtWorf on Saturday February 03, 2024 @04:33PM (#39244961)
So you're saying there is no CVE in php, java, go, js, and python?
Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Saturday February 03, 2024 @06:07PM (#39245697)
In their defence, there are entire classes of security bugs that memory safe languages protect you from. A large percentage of the security bugs in Chrome, OpenSSL, iMessage and lots of other apps wouldn’t have happened in any of the languages you listed. Or, almost certainly, in Rust.
Re:Microsoft seeks Rust developers to rewrite core C# code by Xeamek on Saturday February 03, 2024 @08:33PM (#39246637)
And how many of such bugs could be prevented with compiler warnings and flags?
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @01:18AM (#39248056)
If you're going to start writing it testing or C++ like Rust or follow certain guidelines, a lot of them. But if you're going to constrain how you do things, why not use a language that also gives you higher level functionality along the way?
Re:Microsoft seeks Rust developers to rewrite core C# code by Xeamek on Sunday February 04, 2024 @10:13AM (#39250786)
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

Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Sunday February 04, 2024 @11:10AM (#39251413)
> 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 great.

Personally I find it a very arrogant statement to claim that memory safety in C++ is easy. If google finds it hard, despite throwing millions each year into the problem, I'm of a mind to believe them.

Re:Microsoft seeks Rust developers to rewrite core C# code by Xeamek on Sunday February 04, 2024 @08:07PM (#39256189)
>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 by josephg on Monday February 05, 2024 @02:58AM (#39258451)
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 by LtWorf on Monday February 05, 2024 @02:36PM (#39265931)
Apple? The same company that forked the JVM and then was taking months to fix vulnerabilities for which exploits were readily available on the internet, and that had been fixed immediately on linux and windows?

The same company that has had a stream of no click 0days in imessage, because they parse the messages outside of a sandbox, and patch the issue but not the larger issue of the no-sandbox?

Yeah they don't care about security at all. It's mostly just a thing their marketing department talks about. I'm sure their R&D budget for it is quite limited given their size.

Re:Microsoft seeks Rust developers to rewrite core C# code by LtWorf on Monday February 05, 2024 @02:25PM (#39265773)
Fun fact: working at a large company doesn't make you smarter.

In fact all the laid off people probably feel less smart then average for accepting to work somewhere that treated them like that.

Re:Microsoft seeks Rust developers to rewrite core C# code by josephg on Sunday February 04, 2024 @04:00AM (#39248706)
I suspect fewer than you think. At least in FAANG code.

Google chrome has had a fair few CVEs over the years despite having a lot of the worlds best security researchers working full time looking for security vulnerabilities.

I think someone has tried reading the compiler warnings.

There’s an old story about John carmack running a new static analysis tool on the quake3 source code. The code worked well. The tool apparently found a huge list of issues in the code - including a massive pile of real bugs. Then he tried another static analysis tool and it found more real bugs. And so on.

The story is well worth a read. This is a great takeaway:

> This seems to imply that if you have a large enough codebase, any class of error that is syntactically legal probably exists there.

C++ is really hard to do “right”, at any scale in a real team.

http://www.sevangelatos.com/john-carmack-on-static-code-anal...

Re:Microsoft seeks Rust developers to rewrite core C# code by edgyquant on Saturday February 03, 2024 @03:13PM (#39244274)
Objectively false
Re:Microsoft seeks Rust developers to rewrite core C# code by pjmlp on Sunday February 04, 2024 @06:09AM (#39249324)
As someone that speaks legalese, and knows C and C++ relatively well to be productive, if nothing else by knowing them since 1993 and 1994 respectively, also have already written a couple of interesting stuff in Rust, that 100x easier is a bit too much.

Specially if we are talking about anything related to graphics programming, or asynchronous programming.

Re:Microsoft seeks Rust developers to rewrite core C# code by PartiallyTyped on Saturday February 03, 2024 @07:43PM (#39246313)
Rust is very easy to learn. Just read what the compiler says. The compiler is there to help you, it has a holistic view of what's going on, and it knows what it needs for your code to be fixed.
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @12:54AM (#39247967)
It's not that hard for relatively easy work... I've written a few basic web services, as an example, using a few of the more popular web frameworks for Rust, it hasn't been much harder than say C# or Node.

Now some of the more complex things, have been far more complex to do by hand.. Shared data, channels, Arc, etc. Those have been a bit more cumbersome and still not sure I've done the right thing at times.

Re:Microsoft seeks Rust developers to rewrite core C# code by FlyingSnake on Saturday February 03, 2024 @05:05PM (#39245226)
I know some teams that are hiring Rust devs. Please feel free to ping me if you would like to know more.
Re:Microsoft seeks Rust developers to rewrite core C# code by diego_moita on Saturday February 03, 2024 @11:38PM (#39247667)
I sent you an email from diego.moita69 at gmail.

Thanks for reaching out!

Re:Microsoft seeks Rust developers to rewrite core C# code by xedrac on Saturday February 03, 2024 @12:18PM (#39242447)
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.
Re:Microsoft seeks Rust developers to rewrite core C# code by jonnytran on Saturday February 03, 2024 @01:45PM (#39243386)
Yes, I did this at my startup. Fast forward a few years, and now the company has more Rust code than Python, and the majority of the company's IP is in Rust.

I suggest beginning with small, one-off things that don't have much impact. People, even developers, tend to shy away from things that aren't familiar. By introducing Rust in a small, low-risk way, it helps people get familiar with it. They get to build familiarity with building Rust projects, navigating the project structure, and reading docs. I submit pull requests that get people to read Rust code, even if it's just to say "looks good". Their familiarity builds slowly over time, meaning they'll be less triggered by seeing Rust in a larger, more impactful project down the road.

How do you boil a software developer? Slowly.

If they give Rust a chance and your team has a champion to guide them, they'll see its merits. I think a lot of people come to Rust for the performance, but that's not why they stay.

Re:Microsoft seeks Rust developers to rewrite core C# code by Capricorn2481 on Saturday February 03, 2024 @07:09PM (#39246085)
What domain are you working in where Rust is the replacement for Python?
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @01:30AM (#39248097)
Performance, portability, reduced memory use.. even containerization which can benefit from all of the above.
Re:Microsoft seeks Rust developers to rewrite core C# code by Capricorn2481 on Tuesday February 06, 2024 @03:23AM (#39272151)
Those aren't really domains. Chances are if portability was a concern to you, you didn't start your project in Python.
Re:Microsoft seeks Rust developers to rewrite core C# code by PartiallyTyped on Saturday February 03, 2024 @07:52PM (#39246382)
I am in the process of oxidizing some stuff at work with Rust. I too am starting from small pieces, things that I can incorporate and call off python directly. Also relying a bit on codegen to blend the two languages and slowly remove all python code.
Re:Microsoft seeks Rust developers to rewrite core C# code by tayo42 on Saturday February 03, 2024 @12:34PM (#39242640)
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

Re:Microsoft seeks Rust developers to rewrite core C# code by beeboobaa on Saturday February 03, 2024 @01:04PM (#39242986)
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 by xedrac on Saturday February 03, 2024 @06:24PM (#39245818)
When I see people on my team (myself included) shoot themselves in the foot over and over with C++, sometimes causing very costly production bugs, and yet I know of a tool that could have prevented nearly all of that pain at compile time, I am going to risk being disliked in order to help lift everyone up. Most people that I mentor on Rust have become completely sold on it after some initial resistance. I don't like change for change's sake, or rewriting things in a new language unless there is some really big payoff.
Re:Microsoft seeks Rust developers to rewrite core C# code by tayo42 on Saturday February 03, 2024 @10:06PM (#39247150)
I think that argument makes sense in a vacuum. Like considering nothing else, yes, 100%, rusts compiler prevents more bugs then c++ would. I don't think bugs are the only way to waste time or break things. In a large company or complex project your never talking about one small code base. There are inter-dependencies within code and outside code. Rewriting all of anything significant is a huge undertaking. In reality your introducing a new language in addition to cpp/java/go. Its another support task. Its another thing to context switch between when your working on "the legacy" repo and the new stuff. You need to be skilled in both languages.

Its like any team that starts writing automation and support projects in python, when their main language is something else. You get trash python scripts and programs. Its another language where technically the domain is right, but the skill is lacking.

Re:Microsoft seeks Rust developers to rewrite core C# code by xedrac on Sunday February 04, 2024 @10:34AM (#39251006)
Yes, there's definitely a cost of introducing Rust to an existing project. But there are a ton of projects that could also benefit greatly from it, such that it'd be a net benefit even in the short term, and a huge benefit in the long term. I'm not advocating for people to blindly add it to their project.
Re:Microsoft seeks Rust developers to rewrite core C# code by rockwotj on Saturday February 03, 2024 @12:10PM (#39242349)
On the reverse side of things, trying to find a C++ dev is usually harder than finding people who want to write Rust.
Re:Microsoft seeks Rust developers to rewrite core C# code by mmastrac on Saturday February 03, 2024 @12:34PM (#39242646)
I suppose C++ devs are on the correct side of the demand curve, unlike myself. :D

I was _really_ tempted to take a C++ job at some point but I held out.

Re:Microsoft seeks Rust developers to rewrite core C# code by secondcoming on Saturday February 03, 2024 @12:37PM (#39242670)
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.
Re:Microsoft seeks Rust developers to rewrite core C# code by StewardMcOy on Saturday February 03, 2024 @12:58PM (#39242914)
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 overlap in the domains that C++ and Rust serve. Isn't it a good thing for job candidates to have an interest in learning about other approaches to their work? To understand what makes C++ better or worse than Rust in difference circumstances?

Why would a mere mention of Rust be a red flag?

Re:Microsoft seeks Rust developers to rewrite core C# code by wredue on Saturday February 03, 2024 @01:06PM (#39243007)
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 by namaria on Saturday February 03, 2024 @01:19PM (#39243130)
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 by 01HNNWZ0MV43FF on Saturday February 03, 2024 @01:59PM (#39243518)
n=1 but I did bring Rust to my C++ job. I needed a web server, and I didn't want to put in an order with the web server team, and writing a web server in C++ looked like a recipe for pain.
Re:Microsoft seeks Rust developers to rewrite core C# code by zaphirplane on Saturday February 03, 2024 @03:32PM (#39244454)
Really people write a web server from scratch? What industry? Don’t tell me it’s some CRUD
Re:Microsoft seeks Rust developers to rewrite core C# code by 01HNNWZ0MV43FF on Sunday February 04, 2024 @12:15PM (#39252130)
I learned a lot from it
Re:Microsoft seeks Rust developers to rewrite core C# code by EVa5I7bHFq9mnYK on Saturday February 03, 2024 @05:27PM (#39245401)
What pain? Just include mongoose.h and .c in your project. It's in C, but C is C++.
Re:Microsoft seeks Rust developers to rewrite core C# code by 01HNNWZ0MV43FF on Sunday February 04, 2024 @12:14PM (#39252121)
I did try both Civet and Mongoose. We didn't have a good build / dependency system for C++ at the time, just CMake, so when I considered all the little libraries I'd have to learn and pull in like HTML templating, SQL, etc., while making sure my code was thread-safe, it looked like too much work.
Re:Microsoft seeks Rust developers to rewrite core C# code by quickthrower2 on Sunday February 04, 2024 @04:42AM (#39248877)

    docker run --name docker-nginx -p 80:80 nginx
Re:Microsoft seeks Rust developers to rewrite core C# code by 01HNNWZ0MV43FF on Sunday February 04, 2024 @12:15PM (#39252125)
Yes I suppose I could have written it as a Lua plugin for Nginx. Or CGI.
Re:Microsoft seeks Rust developers to rewrite core C# code by quickthrower2 on Sunday February 04, 2024 @03:41PM (#39254219)
A bit of greenfield NIH is damn fun through sometimes :-)
Re:Microsoft seeks Rust developers to rewrite core C# code by wredue on Saturday February 03, 2024 @02:54PM (#39244119)
I feel like you’re giving rust a pass here.

It would be a red flag if you were interviewing for react and decided to bring up vue or svelte or angular or whatever else as well.

It’s not like it’s only this C++/Rust type deal that is being picked on. Although I would suggest that rust fans tend to be particularly ardent and loud at the current moment, so interviewers may be far more turned off of you as a person just for bringing it up. Interviewers probably felt this way about people bringing up Python 20 years ago (Python devs of yore were WAY WAY worse about their “HAVE YOU HEARD THE WORD?!” Than rust devs are today), blockchain 7 years ago, etc.

Anyway. As an interviewee, I’d probably try to avoid being the one to bring up alternative technologies.

Re:Microsoft seeks Rust developers to rewrite core C# code by namaria on Saturday February 03, 2024 @04:55PM (#39245151)
I'm sorry but I'm having a hard time understanding why a person bringing up a tool in conversation during an interview is seen as such a clear and strong signal containing so much information about their professional performance.

But nowadays it seems like one has to 'turn on' an interviewer and avoid a minefield of forbidden words to get a job. If a workplace is to become a toxic cult-like environment being policed against such thoughtcrimes as being curious and interested in technology for its own sake I think one would be fortunate to be passed on after an interview to enter such a place.

Re:Microsoft seeks Rust developers to rewrite core C# code by theon144 on Saturday February 03, 2024 @06:27PM (#39245839)
>It would be a red flag if you were interviewing for react and decided to bring up vue or svelte or angular or whatever else as well.

...why?

Seriously, why on earth? I don't follow this train of thought at all; if they demonstrate proficiency within the scope of the position, why does it matter if they also happen to know other technologies?

"Oh, Alice? Yeah, she was a great candidate, unfortunately she also had experience in Vue, so there's nothing we could do. We decided to hire Bob, who has 3 years less experience with React, but fortunately that's the only stack he's ever heard of."

If anything, it's a sign the person is interested in learning, most great devs I've met were not proficient only with a single technology. This sounds completely alien to me.

Re:Microsoft seeks Rust developers to rewrite core C# code by wredue on Tuesday February 06, 2024 @01:21PM (#39278218)
Nice strawman bro.

Nobody is saying to not expand your knowledge. You’re assuming it of this because it’s literally your only argument, but it’s an unfortunately shitty one, as most logical fallacies tend to be.

Nobody said “don’t have wide experience” but you. What I did say was “I’d probably avoid being an ardent fanboy toward an irrelevant to the interview tech stack”. And that “it’s most often best to leave irrelevant digressions to the interviewer”

Again, you go ahead and give out all the shit tier interview advice you like. For people that actually want jobs, probably try to stick to what’s relevant.

Re:Microsoft seeks Rust developers to rewrite core C# code by Capricorn2481 on Wednesday February 07, 2024 @03:13AM (#39285885)
You said if someone brought up something like Svelte when interviewing for a React job it would be a red flag. That just sounds silly to people that know how naturally someone could connect Svelte to a discussion about React.

Could I imagine a scenario where it's a non-sequitur? Sure. Not really "don't hire this person" worthy, though.

Re:Microsoft seeks Rust developers to rewrite core C# code by UK-Al05 on Saturday February 03, 2024 @07:19PM (#39246158)
You should value wide knowledge. Not be scared of it.
Re:Microsoft seeks Rust developers to rewrite core C# code by fl0ki on Saturday February 03, 2024 @02:48PM (#39244067)
> bring in random languages

Rust is hardly a random choice. You can debate its merits for some domains, but replacing C++ in most of the places that C++ is used is exactly what Rust was built for and is widely recognized as doing well at.

> just because

If your engineers are pitching a technology with no more basis than "just because", I can understand dismissing them out of hand. But ask yourself if that's actually what happened, or if they gave specific reasons justifying their proposal and you dismissed them out of hand anyway.

Even if you disagree with the reasons, or agree with them but conclude they are outweighed by other arguments, either of those is totally fine, but dismissing them as "just because" is not an effective way to make technical decisions as a team.

Re:Microsoft seeks Rust developers to rewrite core C# code by wredue on Saturday February 03, 2024 @02:59PM (#39244159)
They’re not “your engineers”. This is an interview for a position listing the job requirements.

You go ahead an interview however you like, but generally, giving your interviewer a feeling that you plan to shake up their tech stack because you feel like it isn’t going to go well.

Re:Microsoft seeks Rust developers to rewrite core C# code by Capricorn2481 on Saturday February 03, 2024 @06:58PM (#39245998)
What is this job where the position is so high up that it can make unilateral decisions on the tech stack but also needs to be punished if they know about Rust? Would you hire a team leader that didn't know what Rust was?
Re:Microsoft seeks Rust developers to rewrite core C# code by jimbob45 on Saturday February 03, 2024 @12:53PM (#39242857)
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.
Re:Microsoft seeks Rust developers to rewrite core C# code by risyachka on Saturday February 03, 2024 @01:00PM (#39242930)
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.

Re:Microsoft seeks Rust developers to rewrite core C# code by timeon on Saturday February 03, 2024 @01:08PM (#39243025)
Yeah C++ have steep learning curve compared to Rust.
Re:Microsoft seeks Rust developers to rewrite core C# code by PartiallyTyped on Saturday February 03, 2024 @07:50PM (#39246366)
If you know rust, you can carry the same ideas to C++. My C and C++ skills greatly improved as I got better with rust. The compiler forces you to learn proper memory management and that carries over.

Smart pointers? Just Box, Rc, Arc and Refcel.

Move semantics? It's just another name for ownership.

Sure, the OOP stuff are different, but okay, that in and of itself shouldn't hinder you.

Re:Microsoft seeks Rust developers to rewrite core C# code by nambit on Sunday February 04, 2024 @03:08AM (#39248515)
If it's an experienced C++ job and you don't know the difference between rvalue/lvalue/etc, you're gonna have a tough time.
Re:Microsoft seeks Rust developers to rewrite core C# code by rcxdude on Sunday February 04, 2024 @04:43AM (#39248880)
Are you sure? Many C++ programmers who have learned rust report that it has also made them better C++ programmers.
Re:Microsoft seeks Rust developers to rewrite core C# code by secondcoming on Saturday February 03, 2024 @02:39PM (#39243963)
It's not about proficiency, it's about not getting bogged down in programming language bikeshedding.
Re:Microsoft seeks Rust developers to rewrite core C# code by fl0ki on Saturday February 03, 2024 @02:53PM (#39244109)
Sigh. People don't even know what bikeshed means any more.

https://en.wiktionary.org/wiki/bikeshedding

If you think the differences between C++ and Rust are "unimportant but easy-to-grasp issues" then you may not know enough about either/both to contribute to the discussion.

We're talking about differences so impactful and well-recognized that everyone from Google[1] to the NSA[2] is advocating for using Rust to reduce the unsafety compared to C++. Are you saying all of them are bogged down in bikeshedding?

[1] https://security.googleblog.com/2022/12/memory-safe-language...

[2] https://www.nsa.gov/Press-Room/News-Highlights/Article/Artic...

Re:Microsoft seeks Rust developers to rewrite core C# code by ClimaxGravely on Saturday February 03, 2024 @06:02PM (#39245662)
It's been pretty great having one of my primary languages c++ lately wrt job opportunities.
Re:Microsoft seeks Rust developers to rewrite core C# code by TrackerFF on Saturday February 03, 2024 @12:53PM (#39242856)
We acquired a product last year, where the entire back-end was written in Rust.

Unfortunately, Rust developers were hard to get by, and we didn't have any internally that could maintain the Rust code at such scale.

The entire back-end ended up being re-written.

Re:Microsoft seeks Rust developers to rewrite core C# code by beeboobaa on Saturday February 03, 2024 @01:01PM (#39242946)
What happened to the developers who wrote the back-end in the first place?
Re:Microsoft seeks Rust developers to rewrite core C# code by cerved on Saturday February 03, 2024 @05:47PM (#39245562)
maybe the borrow checker determined their lifetime was up
Re:Microsoft seeks Rust developers to rewrite core C# code by ducktective on Saturday February 03, 2024 @01:01PM (#39242951)
>The entire back-end ended up being re-written.

In Go, I presume?

Re:Microsoft seeks Rust developers to rewrite core C# code by rowanG077 on Saturday February 03, 2024 @01:04PM (#39242980)
Why not just learn rust? It really is not that exotic to learn. I doubt it is faster to rewrite it.
Re:Microsoft seeks Rust developers to rewrite core C# code by jonnytran on Saturday February 03, 2024 @01:27PM (#39243213)
Yeah, this is just baffling. A team can be so averse to learning new tools, good ones too, that they would rather dump their time into rewriting. Instead of getting paid to level up their skills, they'd rather block forward movement of the company's goals to maintain the status quo.
Re:Microsoft seeks Rust developers to rewrite core C# code by kasajian on Saturday February 03, 2024 @01:52PM (#39243447)
I'm a bit surprised at this, too.
Re:Microsoft seeks Rust developers to rewrite core C# code by shdh on Sunday February 04, 2024 @08:03AM (#39249867)
Trash build times and slow iteration cycle as a result
Re:Microsoft seeks Rust developers to rewrite core C# code by rowanG077 on Sunday February 04, 2024 @05:51PM (#39255354)
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 by codetrotter on Saturday February 03, 2024 @12:58PM (#39242904)
Nooo :'(
Re:Microsoft seeks Rust developers to rewrite core C# code by imetatroll on Saturday February 03, 2024 @08:07PM (#39246473)
I honestly wish I could have been in that boat because I crave the opportunity to use rust on the job.
Re:Microsoft seeks Rust developers to rewrite core C# code by tracker1 on Sunday February 04, 2024 @01:20AM (#39248060)
Same here... Job hunting right now and would love to bridge the gap to primarily using Rust
Re:Microsoft seeks Rust developers to rewrite core C# code by davidmurdoch on Saturday February 03, 2024 @01:25PM (#39243194)
There are tons of Rust jobs in blockchain.
Re:Microsoft seeks Rust developers to rewrite core C# code by kaycey2022 on Sunday February 04, 2024 @03:51AM (#39248672)
I’m interested. Can you tell me what do rust developers build or work on in this space? Where do you start networking and build the demonstrable skills to get into blockchain?
Re:Microsoft seeks Rust developers to rewrite core C# code by davidmurdoch on Sunday February 04, 2024 @08:51AM (#39250177)
I don't know Rust, but I've worked in blockchain for 6 years. Recruiters are always reaching out to me and most list Rust as a language.

In Ethereum (the domain I work in) there are lots of developer tools being written in Rust (Foundry, Build Bear). There is a new Eth node/client being developed in Rust, as well as a "wallet" browser extension. In Bitcoin I know Hiro, a Bitcoin L2, has lots of Rust, but I don't know which parts.

Re:Microsoft seeks Rust developers to rewrite core C# code by bmoxb on Sunday February 04, 2024 @06:57AM (#39249553)
Yes, that's the issue.
Re:Microsoft seeks Rust developers to rewrite core C# code by davidmurdoch on Sunday February 04, 2024 @08:46AM (#39250144)
What's the issue? Elaborate.
Re:Microsoft seeks Rust developers to rewrite core C# code by surajrmal on Saturday February 03, 2024 @02:58PM (#39244155)
It's equally difficult to try and hire a team of folks who know rust. There is also a lot of legacy code which doesn't cleanly interop with rust (cxx and the like are not sufficiently easy to bridge the gap). It would be much easier to convince your existing team to start using rust where it makes sense than it would be to switch jobs in search of one which primarily uses that. Over time both of these problems will diminish, but that'll likely take another decade.
Re:Microsoft seeks Rust developers to rewrite core C# code by summerlight on Saturday February 03, 2024 @07:54PM (#39246397)
One thing is that a large fraction of C/C++ devs are hired by big companies. And those tend to have a large amount of legacy code and in-house tooling. Adding one more language to such big ecosystem can be a significant investment than kicking off a new project from scratch, so they need a good transition story to convince stakeholders and get actual funding(=more headcount/jobs).

I think Rust has reached to the level where many of us agree on that it's probably a good idea to move on, but probably not many of us have a good idea on how to do that. Hopefully some teams are eager to do that, so we will see some success story soon then more and more teams will explore such possibility.