-1

Is it possible, for instance, to use functions of a C++ library in another language like Java or Ruby? Can a single application be programmed using separated languages? How?

Kara
  • 6,115
  • 16
  • 50
  • 57
WindScar
  • 165
  • 4

2 Answers2

2

Yes, it is quite possible to create a program that uses multiple languages. Here is a post for using C++ from Ruby. As for Java, you'll want to look at the Java Native Interface.

A program can be coded using different languages either by inline code (e.g., Assembly language in a C/C++ program, or MATLAB code inside of LabVIEW blocks). Or, by calling external library code (e.g., C# interoperability with C/C++ libraries).

Hope that's helpful!

Community
  • 1
  • 1
mevatron
  • 13,911
  • 4
  • 55
  • 72
2

Yes, it is possible to embed C/C++ code in another language. For example, take a look at SWIG:

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of target languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby.

haimg
  • 4,547
  • 35
  • 47