In languages ​​that can reference C ++

As I reflected on this issue, it seemed to me that if a language is implemented in C ++, it may well have a mechanism for linking with C ++. As far as I remember, Java is the way through the JNI, although I don’t remember whether it goes through C ++ or plain C.

However, it seems that, in general, languages ​​do not reference C ++ and are available for C ++ only through C for various reasons.

So out of curiosity

What languages ​​exist that can reference C ++ and how and to what extent?

(No credit for the aforementioned C bridge, unless done in an elegant or interesting way, e.g. Boost.Python)

+3
source share
3 answers

: ABI , , .. EABI ( ) , ( ) EABI ( ). ABI .

++ , ABI undefined. , . , GCC , MS. ABI ( GCC).

++ . ++ ++ (, , , ABI). ABI , , ++, ++.

C . , C ABI , ++ ABI . C ++. ++ C, ++ ABI, , ++ C, ++ , . ++ C ++.

++, C. , C-. ( , DRY ), ( , !). , ++, C. ( ..)

+11

, , ++ , - -, ++ .

, C, , C . foo foo . , Fortran, foo foo, foo, foo_ foo__.

- ++ (SWIG, Boost.Python, SIP ..). C, .

- , ++. . , C- , ++ OO, . , ++ , , , vptrs, , , ++.

, , ++ , , , .

+6
+3

Source: https://habr.com/ru/post/1704371/


All Articles