DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C (http://www.daniweb.com/forums/forum118.html)
-   -   An implementation idea requied in Compiler Interface (http://www.daniweb.com/forums/thread167538.html)

abhi_marichi Jan 10th, 2009 2:15 pm
An implementation idea requied in Compiler Interface
 
I want to know how can we interface compilers so that we can mix up many languages together but still the code should work.
One of my thoughts is, if there is any code in C allthose codes must be taken apart and must be compiled by C compiler and if there is any code in Java it must be taken apart and must be compiled separately. The laguages must be able to pass the result between them and output screen must be same for all.
So code like this must work:
[code]
#include<stdio.h>
void main()
{
system.out.println("HAI");
}
[\code]

It looks crazy but if possible answer it...

Salem Jan 10th, 2009 2:33 pm
Re: An implementation idea requied in Compiler Interface
 
Whilst you can create programs from multiple programming languages, the "interface" tends to be at the DLL or program executable level.

You're not going to be able to mix/match several languages in the same source file.

abhi_marichi Jan 10th, 2009 2:37 pm
Re: An implementation idea requied in Compiler Interface
 
Can anybody tell which language could be useful for this interfacing DLL or executables

ddanbe Jan 10th, 2009 5:02 pm
Re: An implementation idea requied in Compiler Interface
 
I don't know if it's any help but it won't hurt :
http://www.amazon.com/Expert-NET-2-0...d=L6872TYA346B
Most compilers under Visual Studio compile to this intermediate language, be it Java, C++, C or C# or other.

death_oclock Jan 13th, 2009 8:21 pm
Re: An implementation idea requied in Compiler Interface
 
If you really want to, you could write C libraries that mimic java code, as well as many other languages. It would work best in C++ however, which provides a lot of functionality for class-based designs. Most important here, i would think, is operator overloading.


All times are GMT -4. The time now is 6:08 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC