0
Multiple-language programs
Hello guys. This is my second day learning coding, so I am sorry if my question seems basic. Since every language has its own platform, how do you write a program that requires multiple languages?
3 ответов
+ 4
Usually facilitated by a language-specific construct.
Using your keywords:
C++:
asm(string) declaration (Assembly)
etc...
Python: add a C function and appropriate module links (https://docs.python.org/3/extending)
Java:
- Haxe can treat Java native code as if it were a C-type "external" : http://old.haxe.org/doc/java/externs
...it's the same idea for Windows DLL's and Linux/Android so's.
- SoloLearn would have bridges from Java to Javascript, especially because they're intercepting the console object.
- Rhino is a Javascript implementation written in Java...for embedding.
- Android interfaces Java and C++, CocoonJS, etc for native games.
etc.
SQL:
I embedded a SQL database library in Javascript in my codes. SQL stored procedures can also 'extern' using OS-specific features.
All but HTML can shell/fork and then 'depend' on any language it starts from there; this app behaves that way at the appropriate times.
+ 3
Kamil's answer is another approach (mine's mostly in-process).
+ 2
When you write a program it is written in one language. Unless it is divided into many projects communicating with each other. Then each of it can be written with different languages, doesnt have to though.