Is it possible to compile multiple languages together in order to get the best of the different languages.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s definitely possible to link them together (if suitably programmed) after compiling them separately, if the compilers and linkers are all compatible. For example:
this compiles a Fortran file, then a C file, then links them together in a single executable named
together(assuming they call each other properly;-) using the GCC suite of tools.Microsoft’s .NET is a popular way to use multiple languages together — C#, F#, IronPython, IronRuby, and so on. Visual Studio will handle the compilations into compatible codes and the joining together in assemblies, but you can also do it “by hand” if you wish.
If by “compiling together” you mean having multiple different languages within the same file, that’s also possible but rarer — for example some C compilers have extensions to let you express “inline” assembly language within the same file.