-2

We see that certain huge projects are written in more than one language For example facebook is written in php and c++, and android operating system is written in c,c++ and java. In the following links on the right side more than one languages are written in front of "written in"

Android=http://en.wikipedia.org/wiki/Android_(operating_system)

Facebook=http://en.wikipedia.org/wiki/Facebook

Are there any compilers for doing this?

Taimour
  • 129
  • 1
  • 1
  • 9
  • I am not sure about compilers but there are lot of language experts involved in writing those projects/products. – Juned Ahsan Jul 11 '13 at 03:49
  • This is a separate issue for every pair of languages. See here for an example: http://stackoverflow.com/questions/1843205/are-there-tools-to-integrate-java-and-c – jogojapan Jul 11 '13 at 03:49
  • 1
    Usually, it'd be your build system (using tools like CMake or similar) which will call the relevant compilers/packagers/etc. – sje397 Jul 11 '13 at 03:49
  • I believe that facebook is using hiphop which transforms PHP to C++ to improve performance. – Jm Verastigue Jul 11 '13 at 03:50
  • You need to have a good reason for using multiple technologies. Doing it just for the sake of it is a little counter-productive. This is worded like a homework question. – paddy Jul 11 '13 at 03:51
  • Your question is far too broad. In one instance you mention an operating system (Android), another you mention a social media platform (facebook). In the later is has a backend and multiple front ends (web client for web browsers, iOS client, Android client). Even the backend may be separate components to manage support for different front ends and interfaces. – Metalskin Jul 11 '13 at 03:54
  • I suspect Facebook would see their IT as being multiple projects not one uber project. – Peter Lawrey Jul 11 '13 at 04:22

1 Answers1

1

Sometimes (Facebook) you have a system of many different interacting programs, each of which can be written in a different language, and even be running on different machines. I am sure that a complex website like Facebook involves many pieces written in many different mainstream and homespun "languages".

Other times (Android) you have a single entity in which pieces written in different languages are combined. I'm over simplifying a bit, but if you think about it, compilers ultimately compile down to machine code, and a linker can simply combine the pieces.

In reality, it's often more complex, and many languages are interpreted rather than compiled. To combine languages that have complex runtime systems like Java, Python, Ruby, etc into one program, there will be specific, point-to-point solutions for each case. For example, the Java Native Interface (JNI) is a standard mechanism for embedding Java into C and C++ programs.

Ernest Friedman-Hill
  • 80,601
  • 10
  • 150
  • 186