I know that many large-scale applications, such as video games, are created using several languages. For example, it is likely that the game / physical engines are written in C ++, while the tasks of the gameplay, the graphical interface is written in the form of Python or Lua.
I understand why this separation of roles is performed; use lower-level languages ββfor tasks requiring extreme optimization, tuning, efficiency and speed, when using higher-level languages ββto speed up production time, reduce unpleasant errors, etc.
Recently, I decided to take on a larger personal project and would like to separate parts of the project like the ones above. At the moment, I am very confused about how this compatibility between languages ββ(especially compiled and interpreted) works.
I am well acquainted with the details of moving from an ANSCII code test to loading an executable file when it is written as something like C / C ++. I am very curious about how a video game built in different languages ββworks. This is a big / wide question, but I'm particularly interested in:
- How does code level logic work? That is, how can I name Python code from a C ++ program? Moreover, they do not support the same built-in types?
- What does the program image look like? From what I can say, a video game works in one process, and what does the image look like at runtime when starting a C / C ++ program that calls a Python function?
- If you call code from an interpreted language from a compiled program, what is the sequence of events that occur? Ie If I am inside my compiled executable and for some reason called the interpreted language inside the loop, do I need to wait for the interpreter to be at each iteration?
I find it difficult to find information about what is happening at the machine level, so any help would be appreciated. Although I am generally curious about the interaction of software, I am particularly interested in the interaction of C ++ and Python.
Thank you for your understanding, even if it just tells me where I can find more information.
source share