Answer the question
In order to leave comments, you need to log in
What languages are compatible with C++?
Are there other languages that are compatible with C++ besides C?
Answer the question
In order to leave comments, you need to log in
Judging by the comments to the answers, your question wording does not meet your expectations.
Language compatibility is thin type marshaling and joint linking into one binary file.
These conditions are satisfied to varying degrees by: C, asm, D, C#, Java. Maybe some other languages. At the same time, each top-level language will have its own requirements for type marshaling and transfer of control.
You are interested in embedded languages.
Take D for example. It is fully compatible with C++. However, his requirements do not allowsimple linking of C++ and D object files into one binary file. In C++, either a D Runtime should be created (which is not so easy to do), or the C++ code should be linked into a D binary as Better C++. Those. it turns out the other way around, there will be D in the base, and C ++ only expands it.
With python and Java, everything is exactly the same. C# generally works with class libraries written in C++/Cx , i.e. in modified C++.
These languages are not embeddable. Their capabilities are extended through the use of C++.
A good answer to your question would be this list of embedded languages . From this list, you can take any language whose core is written in C or C ++.
My personal choice is AngelScript andLua / Terra .
Depending on what you mean.
You can use PINVOCE in C#.
In Java, Python, PHP, Perl, VBS, and others, you can call an exported function, which they do.
In the end, if there are no standard mechanisms, you can call Exec or Call and simply execute the code by catching the exit status of the process and parsing its logs.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question