How to cooperate one programming language to an other(eg. python with java or c++)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to cooperate one programming language to an other(eg. python with java or c++)?

29th Aug 2020, 10:01 PM
Eyob
3 Answers
+ 4
Sometimes large applications are built up of smaller programs or modules written in different programming languages.
29th Aug 2020, 10:31 PM
Sonic
Sonic - avatar
+ 4
Higher level languages are sometimes implemented via lower level ones. E.g. CPython is a Python implementation in C.
29th Aug 2020, 10:32 PM
Sonic
Sonic - avatar
+ 3
So sometimes it is easier/faster to temporarily "step" into another programming language in order to solve a particular problem. With regards to Python & Java there is Jython which is generated entirely in Java byte codes, so using them in your app is quite simple because it is now as portable as Java. It has an extremely clean interface with Java because Java can now call Python classes and Python can call Java classes. Now for C++ & Python there is Boost.Python. "The Boost Python Library is a framework for interfacing Python and C++. It allows you to quickly and seamlessly expose C++ classes functions and objects to Python, and vice-versa, using no special tools -- just your C++ compiler. It is designed to wrap C++ interfaces non-intrusively, so that you should not have to change the C++ code at all in order to wrap it, making Boost.Python ideal for exposing 3rd-party libraries to Python. The library's use of advanced metaprogramming techniques simplifies its syntax for users, so that wrapping code takes on the look of a kind of declarative interface definition language (IDL)." https://www.jython.org/ http://www.boost.org/doc/libs/1_49_0/libs/python/doc/
29th Aug 2020, 10:13 PM
Steven M
Steven M - avatar