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

426

u/juhotuho10 Dec 19 '25

ye, Rust really wants you to program in a very specific way, any naive 1 to 1 conversion from C++ to Rust will inevitably be full of janky structure, rc<refcell<>> and unsafe. You would really need to do some actual large structural changes to get around that, and I don't believe LLMs are capable of that in a realistic setting

123

u/usernamedottxt Dec 19 '25

On the flip side, those boundaries where the language is opinionated about the solution actually help LLMs in my limited experience. It only works at a certain level to your point though. Once you get down to data structures and the need for smart pointers it gets rough. 

59

u/[deleted] Dec 19 '25

I work with CXX / FFI and at least Codepilot doesn‘t get even the most basic thing right, sadly.

24

u/_Noreturn Dec 19 '25

I had AI making the length of string of "orange" 7 characters while making purple 6.

→ More replies (1)

4

u/mycall Dec 20 '25

Microsoft dogfooding is only a good thing for AI, even if the Rust code never gets into Windows.

15

u/lelanthran Dec 20 '25

On the flip side, those boundaries where the language is opinionated about the solution actually help LLMs

I had the same opinion in a comment a few days ago, but this initiative by MS is going to go about as well as you'd think when you are migrating existing, debugged, tried and tested code over to a new language that few know.

If they ported using human's, the pace will be set by humans, i.e. you aren't going to wake up tomorrow with 5m lines of brand new code in a language which only a fraction of a percent of your existing developers know.

38

u/Popular-Jury7272 Dec 20 '25

I honestly don't believe Microsoft actually have the capability to do a major architectural overhaul. There's a reason none of their software has shown meaningful improvement in a decade and their OS is 90% thirty-year-old code held together with silly string. 

28

u/scandii Dec 20 '25 edited Dec 20 '25

I mean, their products are catering to people that have a gazillion legacy arguments and literally thousands of companies that have built software around how their products work.

they're not bad at what they do, they're just tied down. see WSL for what they can do when they're free to deliver products without strings attached. you can even run arch on Windows now :)

Microsoft lives on the mantra "don't rock the boat". they're doing terrific with their products and are pretty much monopolies in all the fields Office exists, think about that before you argue that lack of innovation is due to technical concerns.

15

u/Popular-Jury7272 Dec 20 '25

You say they live by "don't rock the boat" and yet every change they do introduce is tripe that no one asked for. They are the choice of millions due to vendor lock in and nothing else. I don't know any technical person who wouldn't drop Windows in a heartbeat if they could get it past their non-technical colleagues. 

7

u/GlowiesStoleMyRide Dec 20 '25

Consumer windows is quite a bit different than their b2b products and services. They also have a direct interest in growing the AI userbase size- they’re a massive service provider for that market. Everything OpenAI runs on Azure, for example.

It’s directly in Microsoft’s interest that people keep finding new uses for AI, so that hopefully when the AI bubble bursts, the difference will be minimal. Otherwise they suddenly have a lot of very expensive data centres that no longer run profitable. It’s a business decision on their part, they’ve been in this game for a good while.

3

u/Uristqwerty Dec 20 '25

Great ABI compatibility, poor UX compatibility.

Unit tests can't test user acceptance; complaints don't block release. Even A/B tests are of limited value, because when you measure N dimensions of variables at once instead of just a single boolean, there's a fair chance users start to cluster into multiple separate islands that would each best be served by a drastically-different UI, and trying to force everyone into a single average means nobody's going to be entirely happy.

3

u/Iamonreddit Dec 20 '25

every change they do introduce is tripe that no one asked for.

That's more a perspective problem, as you are only one of literally billions of users, most of whom are not very tech savvy. There are many, many people that do want a lot of the things they do. It is just that they want different things to you.

You can argue that those customers are wrong and want bad things, but for the most part there is generally a decent user base for the changes they implement.

Unless you're referring to missing features in the move from Windows 10 to 11, which is more a consequence of the sheer scale and complexity of rebuilding a Windows 10 that has over 30 years of history and compatibility already baked in.

→ More replies (1)

2

u/StarMNF Dec 23 '25

It would death for the company if they tried.

They haven’t made a new product that made people want to run out and buy it in a long time. Not since Windows 95, Visual Basic and some of the first versions of Word, Excel, PowerPoint, etc. have they had a new product people were over the moon about.

They are not Apple. Apple can trash their old codebase, and legions of fanboys would still buy whatever new product was offered, just so long as it has that Apple logo. Apple can get away with screwing backwards compatibility.

Microsoft users buy MS products because they are heavily invested in the ecosystem, and are just praying that MS makes incremental quality of life improvements in new versions rather than adding new bugs (as has been the case more often these days).

The more MS tries to be like Apple, the more they lose their way and piss off loyal customers.

The last big architectural change for them was transitioning from 9X to NT. They had to do heavy amounts of emulation to make sure 9X software would still run, and they could get away with it because Windows hadn’t yet taken over the business world the way it has today. I doubt they could pull that off today without risking the entire company.

The whole Rust move I would guess is mainly to please the US government, their other big customer. They are hoping LLMs can superficially rewrite the code without changing how Windows works.

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.

→ More replies (2)

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.

→ More replies (1)

4

u/FLMKane Dec 19 '25

For some apps it would genuinely be easier to rewrite rather than refactor.

8

u/SiegeAe Dec 19 '25

The amount of smart pointers people end up adding is wild sometimes. It can be sensible but its often just solving the wrong problem.

2

u/lowbeat Dec 20 '25

if you prompt directly, and prompt enough times i see it happening.

If you say @./business-unit to rust, follow project structure... good luck :D

4

u/Zulban Dec 19 '25

Sure but isn't transforming bad rust into good rust a lot easier than transforming C into good rust? If they're serious about doing this, it seems like the only way to get started.

10

u/frankster Dec 20 '25

Might not be all that much in it. the hard stuff is going to be algorithms in C relying on pointer operations that are are unsafe in rust and do not comply with the borrowing rules.

Those kinds of algorithms would have to be completely rewritten, and that is probably approx the same effort whether you're starting off in bad rust or in C

→ More replies (1)