5 ms·
I think this is probably the most important reason you list: interacting with existing C++ code, including templates. I wonder if we could ever get direct Rust
by bluejekyll 6y ago
I think this is probably the most important reason you list: interacting with existing C++ code, including templates.
I wonder if we could ever get direct Rust to C++ FFI. There are ways around it of course, by dropping down to C FFI in both languages.
- cptroot 6y agoIt's important to remember that C++ doesn't define an ABI, so you'd have to focus on specific compilers' ABIs.
- bluejekyll 6y agoFor some reason I thought C++ had gotten a stable ABI? Not sure why (I’ve been out of C++ dev for years).
- pornel 6y agoC++ has a policy of not making changes that would break anyone's ABI, but still doesn't have an official one. https://cor3ntin.github.io/posts/abi/ https://cor3ntin.github.io/posts/abi/
- d1zzy 6y agoThere isn't any standard C++ ABI but there is a de-facto standard ABI that many compiler writers have agreed upon (icc, clang, gcc), funny enough it was developed for Itanium originally: https://itanium-cxx-abi.github.io/cxx-abi/abi.html https://itanium-cxx-abi.github.io/cxx-abi/abi.html
- nindalf 6y ago> I wonder if we could ever get direct Rust to C++ FFI https://github.com/dtolnay/cxx/ https://github.com/dtolnay/cxx/ exists and works well AFAIK. That's what Chromium (https://chromium-review.googlesource.com/q/project:experimental/chromium/src+branch:refs/wip/rust-experimental-branch https://chromium-review.googlesource.com/q/project:experimen...) and others use.