3 ms·
Consider cross-platform -ness. For example, if you make a new app with domain logic in C++, you can build it on iOS through Swift/Objective-C++ >> C++, or on An
by gary17the 3y ago
Consider cross-platform -ness. For example, if you make a new app with domain logic in C++, you can build it on iOS through Swift/Objective-C++ >> C++, or on Android through Java JNI >> C++, or on React Native through JavaScript Interface (JSI) >> C++, or on Linux through wxWidgets >> C++, or... etc.
Other than that, Rust is a great language with a great compiler eliminating whole categories of bugs possible with C++.
- steveklabnik 3y agoI don't disagree that broader platform support is a reason to choose C++, but Rust is just as capable at integrating with the specific platforms you're talking about.
- jb1991 3y ago> Rust is just as capable at integrating with the specific platforms you're talking about. Maybe it’s possible but definitely not as straightforward to use rust on iOS. Compared to C++.
- steveklabnik 3y agoI have not personally used C++ or Rust in this context, so I can’t speak to the ease of either, so could you say more? The use-cases I know of basically build a library exposing the C ABI, which is slightly annoying but effective. I'm guessing you're referring to Swift <-> C++ interop?
- jb1991 3y agoWhat I mean is that adding C++ files to your iOS project and having them compile and work together without any new compilation steps or settings, and to have Swift code call a C api on your C++ implementation -- all of this is straightforward to do for iOS, and Xcode even creates the "bridging" headers for you and has built-in support for C++. Now, adding Rust into the mix? That will be much more involved and certainly not as simple; nor is it natively supported by the iOS toolset in Xcode. That's what I meant when pushing back on your notion that "Rust is just as capable at integrating with the specific platforms you're talking about."
- steveklabnik 3y agoThanks! I wasn't trying to claim that they're equivalently easy: just that they both have the same capabilities, there's nothing special that one can do that the other cannot.