5 ms·
I seriously doubt there are 5 orders of magnitude more C++ open source contributors actively participating in projects on GitHub than Rust, which is the relevan
by __jem 4y ago
I seriously doubt there are 5 orders of magnitude more C++ open source contributors actively participating in projects on GitHub than Rust, which is the relevant question. Enthusiasm counts for projects like this that are looking to stay relevant.
- fbdab103 4y agoAt this point, I would love solid numbers on the number of new C++ projects (open source or otherwise) vs Rust. Google just came out indicating how well the transition was working for them with respect to memory vulnerabilities.
- zozbot234 4y agoC++ is simply not intended for new projects in this day and age; even Carbon and cppnew are specifically designed for projects that must interoperate heavily with C++ libraries, and are thus not entirely greenfield in that sense. The Carbon developers have explicitly made it clear that new projects should be written in a safe language if at all viable.
- yazzku 4y agoI am watching the Carbon talk now. Successful language transitions have happened in the past when the new language is fully and easily interoperable with the old one. How easy is it to add Rust to a C++ code base? If the answer is 'not at all', then the transition is unlikely to happen anytime soon (it hasn't happened in the decade that Rust has been around). "New projects should be written in a safe language" -- what about the existing ones? Your memory safe web server isn't very useful when it's sitting on top of a kernel tcp/ip stack RCE vulnerability.
- steveklabnik 4y agoEarly on, Rust’s goal was to improve Firefox, a large C++ codebase. A bunch of language design decisions were made to ensure this could work well. However, that doesn’t mean it’s always super easy. C++ interoperated with C even more easily: just compile your code with the new compiler! With Rust, it’s more like FFI. https://cxx.rs/ https://cxx.rs/ is at the forefront here. > it hasn't happened in the decade that Rust has been around This seems to imply that no C++ codebase has had Rust added to it. This is not true, just to be clear, there are. Firefox, for example. Chrome soon. All kinds of things. I also may have misunderstood you!
- zozbot234 4y agoIf cxx.rs is at the forefront, I'd describe autocxx and crubit as being at the bleeding edge. But they hold the promise of significant improvements in interop between Rust and C++.
- steveklabnik 4y agoYeah, they’re very exciting too! I should start including them as well when I talk about this, thanks :)
- lmm 4y ago> "New projects should be written in a safe language" -- what about the existing ones? Your memory safe web server isn't very useful when it's sitting on top of a kernel tcp/ip stack RCE vulnerability. The best time to start rewriting everything in an ML-family language was 20 years ago; the second-best time is today.
- mlindner 4y agoI'm highly skeptical that ML will take over everything. ML is great for cases where being "sometimes wrong" or "approximately correct" is acceptable. It's not acceptable for the vast majority of computer science problems however. If there are many correct answers then ML is a good use case. If there is only one correct answer then ML will never be used there. Edit: I assumed that "ML" here stood for Machine Learning, it appears that was not the case.
- lmm 4y agoML the programming language family, not machine learning.
- yazaddaruvala 4y ago> How easy is it to add Rust to a C++ code base? If the answer is 'not at all', Its not clear that you even read the linked post on GitHub before commenting. The first post in that GitHub thread says: "This should be thought of as a "port" instead of a "rewrite" because we would not start from scratch; instead we would translate C++ to Rust, incrementally, module by module" > then the transition is unlikely to happen anytime soon (it hasn't happened in the decade that Rust has been around) As of a year ago, 10% of FireFox had been ported over (https://news.ycombinator.com/item?id=30744057 https://news.ycombinator.com/item?id=30744057). This is the overall effort started in 2014 https://wiki.mozilla.org/Oxidation https://wiki.mozilla.org/Oxidation
- steveklabnik 4y agohttps://madnight.github.io/githut/#/pull_requests/2022/4 https://madnight.github.io/githut/#/pull_requests/2022/4 This can show you certain data. I’ve linked to Q4 2022, specifically PRs opened. You can see C++ at #4 with 9.7% of PRs, and Rust at 14 with 1.6%. Rust users are also going to be biased towards GitHub over other places.
- mlindner 4y agoThe tremendous drop in javascript over 2021 is very interesting.
- steveklabnik 4y agoI'd assume that's a massive shift to TypeScript, but yep!
- legends2k 4y agoRespect for providing data and being centered despite being a core Rust dev.
- steveklabnik 4y agoThank you. To be clear, I am not involved with the development of Rust anymore.