Is it possible to make a program that runs off of more than one language?
Printable View
Is it possible to make a program that runs off of more than one language?
Yes. The .NET framework can do it. I'm afraid I only know how to do it using Visual Studio.NET - I'm not sure how you could do this using the SDK. You create one project for each language you intend to use. Put the components for your program from each language in the appropriate project, then add references in each project to all the other projects. If you're not using the .NET framework, I know of no such possibility.
You can write inline assembler in C or C++ or pascal. You can write DLL's in most languages and call them from a c/c++ app. The DLL gets loaded into your programs address space and can be part of the same solution if that counts.
You can write a program that parses the source code for other languages and either inteprets it or uses just in time compiling to run it. ...
Hey, you asked if it was possible. You said nothing about easy.
going along in that thread, you might even be tempted to make your own language, and have something to parse that into any other language, then send that to it's own compiler/interpreter/whatever...
now that is cool how would you do something like that?
with alot of work and in-depth knowledge of all the languages you're going to be using.
What would you use to write a language?
your brain. and probably a computer.
But how would it work.. the way I see it is you need a language to make a program.. so what makes a language?
people make languages.
at this point, I highly doubt you'd be ready to create your own language... at least not from scratch... for, example, one could make a language like this:then have a program translates that into C++ and compile the C++, or to have a true language, you'd compile that directly into a binary (if that's the route you take with your language... i.e. not interpreted)Code:bringIn :iostream:
typeInteger mainFunction()
{
consoleOut("Hello World");
sendBack(0);
}
the easiest way to "create your own language" is to map all the keywords in one language to keywords in another language... you wouldn't really be creating a new language, but unless you know how to create a compiler, you won't be able to build a language from the ground up.
I know, I have no interest in my own language I was just curious what it took to create one.
basically, to truly create your own language, you need to be able to create a compiler.
you need to know how to translate human-readable text into a series of 1's and 0's that the computer can read... or at the very least assembly...
then wouldnt you have to differentiate between little endian and big endian systems? $#@! that would be so hard...
you'd have to take the whole platform into consideration: AMD or Intel? 32 or 64? windows or linux? etc. etc. etc.