How were they able to write in three different languages and come up with one product? What is the method used to merge programming languages to create software?
There are many ways in Python to make calls to C++ libraries and in C++ you can inline assembly. It's been a while since I used Python, but I remember SWIG being one option: swig.org
SWIG is an interface compiler that connects programs written in C and C++ with scripting languages such as Perl, Python, Ruby, and Tcl. It works by taking the declarations found in C/C++ header files and using them to generate the wrapper code that scripting languages need to access the underlying C/C++ code. In addition, SWIG provides a variety of customization features that let you tailor the wrapping process to suit your application.
C++ I'm even more rusty on, but I do remember writing inline assembler directly in C and C++ files.
In Java you would use JNI to make calls to C++ libraries, typically this is used where a highly optimised C++ library exists which is critical to the performance of the Java application.
How you package it is a different story, a Chrome application typically consists of many files, so you can have compiled or interpreted Python (probably compiled) making calls to compiled C++ libraries that are running separately on their own kernel threads. The Chrome window could be Python while the rendering engine is C++, so each Chrome process you see is potentially one thread running the rendering engine while another thread contains the UI which might be in Python. (This is just speculation from my side and might not be how they actually do it)
One could think of a browser as a bunch of mini-applications bundled together. There is one which is responsible for the networking, one for the javascript, one for the painting the layout, one for storage, one for user-preferences, etc. Theoretically each component could be built in a different language. It's like how a website can be made with a combination of java, node, mysql, etc.
Wrapper library en.wikipedia.org/wiki/Wrapper_library is the first thing that comes to my mind.
Writing programs using different languages are quite common practice. The characteristics of a program or a system to use different languages in called interoperability. Java for example has a mechanism for interoperability and can call C functions. In the same fashion, we can define a C# method and call it in Python (using IronPython).
In a simple case, different languages are compiled to the same code. C and C++ are typically compiled into machine assembler,while C# and VB.NET is compiled to IL (the language understood by the .NET runtime).
It gets more complicated if the languages or compilers use different type system. There can be different ways of representing basic data types like integers and doubles. When passing these types between different languages, you need to make sure that the two sides interpret the type the same way.
In many cases, when we talk about interoperability, we will find that the one language is a compiled one and the other is a interpreted. Chrome is a great example of this practice. The compiled language (C++) is used for the base application. The base provides an interface to the operating system and acts as a foundation for the work to be done by the application.
The interpreted language is used to provide customization for the application. It can provide useful functions and high level interface specific for the application, making custamizations way more easier.
Many languages allow for a secondary language to be embedded into the syntax of the first. This is called Syntax Embedding. C and C++ for example allow assembly code to be embedded in the syntax using
asm:asm("<assembly code>");Assembly code is mostly used for short, highly used, performance critical routines or when one have to access features a high-level language does not expose. In most cases, a compiled C++ code will be times faster than a hand-written assembly code. This is because compilers can do opimizations we can't even imagine.
Of couse there are other ways to integrate multiple language with one another like:
and the list goes on...