News for hackers. Stuff that matters.
Re:Microsoft is Getting Rusty [video] by thesuperbigfrog on Wednesday February 26, 2025 @02:26PM (#43187185)
It's probably just a matter of time before Rust replaces C and C++ for most use cases.

Rust continues to make in-roads in the Linux kernel and userland.

As this video shows, Microsoft is adopting Rust to improve reliability and security.

Re:Microsoft is Getting Rusty [video] by faitswulff on Wednesday February 26, 2025 @02:49PM (#43187418)
It’s nuanced. Google has shown that legacy C/C++ code is fairly stable in terms of memory safety bugs. That and the effort and risks involved means that existing C/C++ code is unlikely to be replaced wholesale. But that also means that switching new development to Rust has an outsized effect on preventing new bugs. So expect old code to stick around, but new code to be written in Rust with interoperability with the old code.
Re:Microsoft is Getting Rusty [video] by pan69 on Wednesday February 26, 2025 @02:53PM (#43187456)
The way I read the parent comment was as in; replacing C/C++ with Rust as a choice for language going forward, not replacing existing C/C++ code bases with Rust.
Re:Microsoft is Getting Rusty [video] by jcranmer on Wednesday February 26, 2025 @03:17PM (#43187726)
There are definitely some regions of existing code where legitimately replacing the existing C/C++ functions with Rust is justifiable on its own. The big one I can think of is parsing code--things like parsing fonts (as sibling mentions) or A/V codecs are things that have historically been replete with exploitable memory safety issues and are reliably untrusted data.
Re:Microsoft is Getting Rusty [video] by csdreamer7 on Wednesday February 26, 2025 @04:16PM (#43188321)
Threading is another case. The Asahi's gpu Tust driver was able to avoid a lot of threading issues because of Rust.
Re:Microsoft is Getting Rusty [video] by p_ing on Wednesday February 26, 2025 @02:59PM (#43187528)
In the video, Mark talks about Microsoft investing in replacing certain portions of Windows/Office/Azure going C/C++/C# [eliminate GC, SharePoint being mentioned] with Rust. Primarily in security-critical areas, but one of the first points in Windows was font handling, a huge security issue for Windows historically.
Re:Microsoft is Getting Rusty [video] by faitswulff on Wednesday February 26, 2025 @02:56PM (#43187495)
That’s fair, I think I might have been interpreting it as a call to “rewrite it in rust.”
Re:Microsoft is Getting Rusty [video] by dralley on Wednesday February 26, 2025 @02:33PM (#43187254)
Inertia is going to keep C and C++ going for a while. The ship takes a long time to turn and it just started turning in the past couple of years. It's probably more accurate to say that individual ecosystems might become Rust-dominated in the coming years but "most" is maybe a tough call.

Like: I wouldn't be surprised at all if most (new) linux drivers were written in Rust 5 years from now, and software like git and systemd and pipewire and LLVM and maybe even Postgresql had started to adopt it. And I basically expect that Rust will be completely dominating internet-facing software like servers, browsers, media parsers and the like within 10 years.

But I'd be pretty surprised if Rust had more than 20% penetration in automotive / aerospace firmware, or gamedev, even 10 years from now.

Re:Microsoft is Getting Rusty [video] by AlotOfReading on Wednesday February 26, 2025 @03:13PM (#43187689)
By total LoC owned, sure. I would be completely unsurprised if 20% of major companies in those industries have significant components written in Rust within a decade. It's been a long time since there was this much language interest within the embedded/safety critical domains.
Re:Microsoft is Getting Rusty [video] by dralley on Wednesday February 26, 2025 @03:22PM (#43187781)
Penetration into those domains has still been pretty brutally slow. AFAIK only Volvo is shipping Rust code, in 2 models of car, and not for anything safety-critical yet.

That's not a demerit to Rust, just a testament to the conservatism of those industries.

Re:Microsoft is Getting Rusty [video] by AlotOfReading on Wednesday February 26, 2025 @03:41PM (#43187970)
I'm aware of Rust code in various states of "development/experimentation" within GM and Toyota, as well as rust applications that might already be in your home if you've purchased any expensive, brand name appliances recently. It's slow, but happening.
Re:Microsoft is Getting Rusty [video] by mywittyname on Wednesday February 26, 2025 @03:43PM (#43187991)
I worked in the automotive space (CAD/CAE/CAM) and there was tons of code that had commit headers starting in 1996 - the year they moved the previous code base into that particular VCS. Plenty of files had less than 10 commits to them since.

They still had some FORTRAN in the code base. According to my coworker who worked there for 25 years, his first project at the company involved the initiative to replace FORTRAN with C.

So yeah, there's plenty of C code hanging around that's not going anywhere.

Re:Microsoft is Getting Rusty [video] by solarkraft on Wednesday February 26, 2025 @05:18PM (#43188895)
I wonder whether Rust will stick similarly because that's just how things go, less because now the migration process has been tested and the system is more flexible as a while or more because it's really pretty good enough this time.
Re:Microsoft is Getting Rusty [video] by tonfa on Wednesday February 26, 2025 @03:17PM (#43187730)
Yeah embedded software strikes me as one of those areas where rust can really shine (and where the cost of a crash can be high esp. if you run close to bare metal).
Re:Microsoft is Getting Rusty [video] by hu3 on Wednesday February 26, 2025 @02:37PM (#43187297)
And until then someone might create a more ergonomic evolution of Rust.
Re:Microsoft is Getting Rusty [video] by runevault on Wednesday February 26, 2025 @03:34PM (#43187903)
This is a thing I've been wondering about for a while. How many people are exploring the general design space of safety, but from the ground up, so that they aren't tied to the set of design decisions Rust made? At one point MS had Verona but I have not heard anything about it in years so no clue if it is still actively being worked on/explored.

Rust is a good language IMO, but the industry cannot just stop there and decide this is good enough. Even with ideas like editions, there's a level of breakage Rust isn't going to do.

Re:Microsoft is Getting Rusty [video] by mustache_kimono on Wednesday February 26, 2025 @03:34PM (#43187892)
> And until then someone might create a more ergonomic evolution of Rust.

I wouldn't discount Rust's ability to create a more ergonomic evolution of Rust, because they already have. A few times. See: Polonius, https://github.com/rust-lang/polonius, and NLL, https://rust-lang.github.io/rfcs/2094-nll.html

Re:Microsoft is Getting Rusty [video] by vitorsr on Wednesday February 26, 2025 @02:48PM (#43187411)
Ada?
Re:Microsoft is Getting Rusty [video] by misswaterfairy on Wednesday February 26, 2025 @03:15PM (#43187706)
In my opinion, Ada needs some better tooling to become accessible.

Though I'll have to give the Ada LSP a go again, hoping that it plays nicely with JetBrains' suite.

Re:Microsoft is Getting Rusty [video] by mustache_kimono on Wednesday February 26, 2025 @03:00PM (#43187550)
>> And until then someone might create a more ergonomic evolution of Rust. > Ada?

Um what? Which is to say -- how is Ada more ergonomic, if ergonomic means "relating to or designed for efficiency and comfort in the working environment"? I'm curious about what advantages Ada has there.

Re:Microsoft is Getting Rusty [video] by renewedrebecca on Wednesday February 26, 2025 @04:54PM (#43188666)
Ada has a more traditional syntax compared to Rust, for good or for bad.
Re:Microsoft is Getting Rusty [video] by mustache_kimono on Wednesday February 26, 2025 @05:04PM (#43188772)
> Ada has a more traditional syntax compared to Rust, for good or for bad.

How do you mean? "Traditional" in the sense that Pascal and Ada are old, and Rust is not? Rust may be ML in C's clothing, but isn't C's clothing more ergonomic for most C/C++ types?

Re:Microsoft is Getting Rusty [video] by weinzierl on Thursday February 27, 2025 @12:35AM (#43191656)
I wished Rust had developed as an ML in Pascal/Ada's clothing but as you said it would not have been ergonomic for C/C++ folks and probably not as successful as it is.
Re:Microsoft is Getting Rusty [video] by voidfunc on Wednesday February 26, 2025 @03:04PM (#43187597)
I think folks said the same thing about Java in the 90s...
Re:Microsoft is Getting Rusty [video] by epage on Wednesday February 26, 2025 @03:36PM (#43187916)
It did to a degree but still left a sizeable amount of use cases as they were ill suited for Java. I feel like this is repeatedly happened since where each new or newly hyper language has peeled off parts of C++'s use cases but never gone for the core. I feel like Rust is the first that can do it and significantly improve on it. While it does lack specialization and some template tricks, it has memory safety, core/alloc/std, first and third party libraries focusing on `Result` rather than exceptions, etc. This is much better suited for kernel, embedded, and framework development while also being able to scale up into the use cases that went to Java and other languages previously.
Re:Microsoft is Getting Rusty [video] by agarren on Wednesday February 26, 2025 @03:14PM (#43187703)
Like Java in the 90s, MS have embraced rust, next comes extend. I can’t imagine there’s too much preventing them from forking the entire project as MS-Rust Enterprise Edition Release 1 (tm) and running with it. Vscode will replace rust_analyzer with some preferred MS variant that’s closed source…
Re:Microsoft is Getting Rusty [video] by woodruffw on Wednesday February 26, 2025 @04:01PM (#43188157)
Given that MSFT seemingly failed to extend-and-then-extinguish Java, what is the applicability of this analogy?

(I don't have any particular faith in MSFT. I just don't think EEE even remotely works as a strategy in cases like this, and I think MSFT is not stupid enough to think that it does.)

Re:Microsoft is Getting Rusty [video] by jayd16 on Wednesday February 26, 2025 @04:09PM (#43188238)
I look forward to Rust# and then eventually all the good stuff hitting C#.
Re:Microsoft is Getting Rusty [video] by speed_spread on Wednesday February 26, 2025 @03:59PM (#43188143)
Unlike Java, Rust does not threaten Microsoft's hegemony. There's no need for them to extinguish.
Re:Microsoft is Getting Rusty [video] by pjmlp on Thursday February 27, 2025 @02:09AM (#43192064)
Just like Google did with Android, which apparently gets celebrated in FOSS circles, big bad Oracle, what they think they are playing the Sun lawsuit card.
Re:Microsoft is Getting Rusty [video] by aiono on Wednesday February 26, 2025 @03:55PM (#43188102)
Nobody wrote systems software in Java and been successful. But Rust did.
Re:Microsoft is Getting Rusty [video] by lostmsu on Wednesday February 26, 2025 @07:57PM (#43190170)
Arguably, Android is a systems software large chunks of which are written in Java.
Re:Microsoft is Getting Rusty [video] by aiono on Thursday February 27, 2025 @05:55AM (#43193201)
The places that Java is used are mostly higher level parts AFAIK. Java is more for the API of Android for app developers.
Re:Microsoft is Getting Rusty [video] by outside1234 on Wednesday February 26, 2025 @03:56PM (#43188120)
Java completely replaced C++ in business software
Re:Microsoft is Getting Rusty [video] by pjmlp on Thursday February 27, 2025 @02:13AM (#43192092)
C++ is almost nowhere to be seen in modern day distributed computing and business software, outside OS, language runtimes, databases and networking stacks, also known as low level infrastructure code.

All relevant application software is written mainly in a mix of Java and .NET languages, complemented with a mix Go, Rust, Python, Ruby, and SQL dialects.

Likewise Apple, Google and Microsoft no longer have C++ based GUI frameworks, like it was common in the 1990's, and one of them ships a whole OS where Java rules the userspace.

Re:Microsoft is Getting Rusty [video] by no_wizard on Wednesday February 26, 2025 @03:57PM (#43188124)
Is Rust itself 100% written in Rust yet?
Re:Microsoft is Getting Rusty [video] by ramon156 on Wednesday February 26, 2025 @06:09PM (#43189334)
Close! Depends what you call 100% I suppose. Even C isnt 100% C
Re:Microsoft is Getting Rusty [video] by estebank on Thursday February 27, 2025 @11:44AM (#43196024)
I suspect they are arguing that it is not because the default codegen backend produces LLVM IR, which C++ code turns into the final executable. The Cranelift backend which is pure Rust exists, but because it is not the default some people discount it. I personally believe that leveraging existing codegen infrastructure is sound engineering. Having a "pure" implementation is not a goal of the project, having solid tooling is. That might translate in the future to tackling codegen more directly, but it isn't a huge pain point today.
Re:Microsoft is Getting Rusty [video] by no_wizard on Thursday February 27, 2025 @07:36PM (#43200291)
The real contention is how do you know it’s memory safe if Rust itself isn’t pure safe Rust?
Re:Microsoft is Getting Rusty [video] by steveklabnik on Thursday February 27, 2025 @07:42PM (#43200322)
Because that’s not really relevant; Java is a memory safe language and the JVM is written in C++, Ruby is a memory safe language and it’s written in C.
Re:Microsoft is Getting Rusty [video] by no_wizard on Friday February 28, 2025 @09:14AM (#43205811)
Both of those have had memory related exploits, as I recall
Re:Microsoft is Getting Rusty [video] by steveklabnik on Friday February 28, 2025 @11:28AM (#43207424)
Bugs happen. That’s true of any program.
Re:Microsoft is Getting Rusty [video] by LowLevelMahn on Thursday February 27, 2025 @03:43AM (#43192477)
rustc is written in Rust - for many years, start based on OCaml
Re:Microsoft is Getting Rusty [video] by bilekas on Wednesday February 26, 2025 @02:27PM (#43187188)
Don't say that to the linux kernel devs..
Re:Microsoft is Getting Rusty [video] by DrillShopper on Wednesday February 26, 2025 @02:59PM (#43187534)
The Linux Kernel development process is the quintessential "Ask 10 people for opinions on where to get lunch and you'll get half the Internet chiming in with their thoughts"