4 ms·
* C++ adheres to Itanium C++ ABI [1] which in turn adheres to SystemV ABI [2].* Uh.. MSVC does not adhere to the Itanium C++ ABI. ISO C++ does not specify any
by SubjectToChange 2y ago
* C++ adheres to Itanium C++ ABI [1] which in turn adheres to SystemV ABI [2].*
Uh.. MSVC does not adhere to the Itanium C++ ABI. ISO C++ does not specify any name mangling scheme, in fact I doubt the standard even mentions name mangling.
I think you're conflating different terms. Carbon and other similar C++-like frontends are essentially transpilers from C++-like grammar to C++.
Carbon resembles Rust far more than C++, to say the least. In my experience C++ developers criticize its difference in syntax more than anything else.
Anyway, setting aside the differences in syntax, the point I was trying to convey is that C++ is especially difficult to call from other languages, largely due to templates and/or sheer complexity. For a language to take a C++ header and be able to understand something as basic as std::vector, it needs to have quite a sophisticated understanding of C++ and its implementation. By comparison, Java is readily available in other JVM languages like Kotlin and Clojure, albeit those are managed languages.
Being "compatible" requires no reverse engineering but as I said above it's just a matter of following the C++ ABI spec
Not at all. A C++ ABI does not make it possible to magically understand C++ code. If you disagree, then please explain how a platform’s C++ ABI is sufficient to understand a type like std::string from another language. In particular even a vocabulary type like std::string is not compatible between libc++ and libstdc++, i.e. the two most binary compatible C++ standard library implementations available today.