6 ms·
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 th
by thesuperbigfrog 2y ago
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.
- bilekas 2y agoDon't say that to the linux kernel devs..
- DrillShopper 2y agoThe 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"
- dralley 2y agoInertia 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.
- hu3 2y agoAnd until then someone might create a more ergonomic evolution of Rust.
- vitorsr 2y agoAda?
- mustache_kimono 2y ago>> 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.
- renewedrebecca 2y agoAda has a more traditional syntax compared to Rust, for good or for bad.
- mustache_kimono 2y ago> 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?
- weinzierl 2y agoI 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.
- misswaterfairy 2y agoIn 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.
- mustache_kimono 2y ago> 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 https://github.com/rust-lang/polonius, and NLL, https://rust-lang.github.io/rfcs/2094-nll.html https://rust-lang.github.io/rfcs/2094-nll.html
- AlotOfReading 2y agoBy 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.
- tonfa 2y agoYeah 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).
- dralley 2y agoPenetration 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.
- AlotOfReading 2y agoI'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.
- mywittyname 2y agoI 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.
- solarkraft 2y ago
- deleted 2y ago[deleted]
- faitswulff 2y agoIt’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.
- pan69 2y agoThe 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.
- deleted 2y ago[deleted]
- faitswulff 2y agoThat’s fair, I think I might have been interpreting it as a call to “rewrite it in rust.”
- p_ing 2y agoIn 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.
- jcranmer 2y agoThere 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.
- 2y ago
- voidfunc 2y agoI think folks said the same thing about Java in the 90s...
- agarren 2y ago[flagged]
- speed_spread 2y agoUnlike Java, Rust does not threaten Microsoft's hegemony. There's no need for them to extinguish.
- woodruffw 2y agoGiven 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.)
- jayd16 2y agoI look forward to Rust# and then eventually all the good stuff hitting C#.
- pjmlp 2y agoJust 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.
- epage 2y agoIt 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.
- no_wizard 2y agoIs Rust itself 100% written in Rust yet?
- ramon156 2y agoClose! Depends what you call 100% I suppose. Even C isnt 100% C
- estebank 2y agoI 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.
- no_wizard 2y agoThe real contention is how do you know it’s memory safe if Rust itself isn’t pure safe Rust?
- steveklabnik 2y agoBecause 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.
- no_wizard 2y agoBoth of those have had memory related exploits, as I recall
- steveklabnik 2y ago