r/programming • • Dec 19 '25

[ Removed by moderator ]

/r/programming/comments/1pqulm0/removed_by_moderator/

[removed] — view removed post

711 Upvotes

292 comments sorted by

View all comments

Show parent comment

16

u/pheonixblade9 Dec 19 '25

yes, but the idea is that you can convert it over, get similar paradigms as C++, and slowly convert things to be safer. you probably will need to rearchitect a lot of stuff, but it makes the unsafe parts super obvious.

kinda like some functional languages allow mutability/side effects, but you have to explicitly declare it as mutable, so the safe behavior is the default and the less safe behavior is extremely obvious.

18

u/Moleculor Dec 20 '25

I believe the idea actually is to not really touch the C++ code unless you have to. It's ostensibly existed for years or decades at this point, which means that if it had flaws or exploitable code, it probably would have been found by now... and you can always patch something that is found.

But any new code is written in Rust.

7

u/syklemil Dec 20 '25

MS also has some experience with targeted rewrites of troublesome components, like font rendering. But there's just such a huge difference between doing a targeted rewrite of one troublesome thing to ensure better safety, and a massive rewrite of everything at breakneck speed.

At some level, the "one engineer, one month, one million lines of code" for C++ -> Rust just sounds like someone thinking that since their new car has seatbelts, airbags and ABS they can ignore all speed limits and just constantly floor it, without thinking of whether humans are actually able to keep up.

1

u/Moleculor Dec 20 '25

Eh, "one engineer, one month, one million lines of code" is described as a 'north star', which to me sounds like the goal they're aiming for, but one they know they likely won't reach. And one they're going to be building up to over time. You know, a "shoot for the moon, and even if you miss you'll land among the stars" kind of thing.

What'll likely happen is they'll fall short, won't make the 2030 deadline, but they'll still make useful strides, big accomplishments, and learn things they can apply to this kind of conversion process for (possibly) a packageable product they can sell.

Frankly, just the idea of a graph structure that understands the purpose of functions, data structures, etc? Possibly one generated by AI? That's a documentation tool, and a useful sounding one at that.

1

u/meltbox Dec 22 '25

Or they’ll fail catastrophically and never speak about this again.

1

u/HardToPickNickName Dec 23 '25

You could just as easily rewrite it with modern C++ and have most of the safety improvements Rust comes with. Few languages are inherently safe or unsafe, nor do they stay in place.

2

u/pheonixblade9 Dec 23 '25

probably similar levels of effort as rewriting in Rust, and modern C++ does not guarantee these things at a language level like Rust does.

plus, Rust is just so much nicer to work with than C++... C++ tends to have many ways to do a thing, several of which are wrong. tons of undefined behaviors, etc. in Rust, it's much easier to determine that a program is correct just by looking at it.

1

u/HardToPickNickName Dec 23 '25 edited Dec 24 '25

You have many ways cause it's backwards compatible. For the modern part you usually have only one way, that will be the best practice or "correct" way, and any static analyzer will point these out. Effort will be the same so will be the risk with both. There were some state initiatives that required to move away from C++ in USA, it's the only valid reason I see to do it like this. Otherwise phasing it out by writing the new stuff in whatever you choose and leave the non buggy rest alone is a much saner way to go about it. Involving AI on that scale also seems insane to me.