1. A method of cross-language inlining comprising: receiving source code of a multiple language program, the source code comprising a main language and a first access of a first foreign object in a first additional language; translating the main language to obtain a main language intermediate representation (IR); translating the first access of the first foreign object to obtain a first IR snippet; composing, before performing a compilation, the main language IR and the first IR snippet to obtain a cross-language IR, wherein composing the main language IR and the first IR snippet comprises: encountering, during execution of the main language IR, a foreign object access site for performing the first access of the first foreign object; and adding a first language check element to the first IR snippet at the foreign object access site, wherein the first language check element determines that the first access of the first foreign object is in the first additional language; and performing the compilation of the cross-language IR to obtain machine code corresponding to the multiple language program.
1. A method of cross-language inlining comprising: receiving source code of a multiple language program, the source code comprising a main language and a first access of a first foreign object in a first additional language; translating the main language to obtain a main language intermediate representation (IR); translating the first access of the first foreign object to obtain a first IR snippet; composing, before performing a compilation, the main language IR and the first IR snippet to obtain a cross-language IR, wherein composing the main language IR and the first IR snippet comprises: encountering, during execution of the main language IR, a foreign object access site for performing the first access of the first foreign object; and adding a first language check element to the first IR snippet at the foreign object access site, wherein the first language check element determines that the first access of the first foreign object is in the first additional language; and performing the compilation of the cross-language IR to obtain machine code corresponding to the multiple language program. 2. The method of claim 1 , wherein composing the main language IR and the first IR snippet further comprises: mapping the first access of the first foreign object to a first message; inserting into the main language IR, at the foreign object access site, a first message element corresponding to the first message to obtain a first intermediate IR; sending the first message to a first receiver corresponding to the first foreign object; receiving, from the first receiver in response to sending the first message, the first IR snippet; and inserting the first IR snippet into the first intermediate IR to obtain the cross-language IR, wherein the first language check element is executed before the first IR snippet.