4 ms·
I 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 ol
by yazzku 4y ago
I 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