Is it possible to create an in game compiler for a programming language such as c++ or python? I mean import the language and use it in a way that the player can interact with objects

I’d like to caution you that python can be a real pain in the ■■■ to build content with.

It’s a weakly typed, interpreted language without explicit variable declaration. While for some reason people have gotten it into their heads that that means it’s “easy for designers to use,” what that means is that it’s a pain in the butt to test.

For example, let’s say you misspell or miscapitalize a variable somewhere in your script. In a C-like language, you’d discover that at compile time.

In Python, you discover that when you build your content, launch the game, play to that part of the level where the content is used, and then repeat doing that over and over until your misspelled variable causes a problem which is obvious enough to see in the content. And then you have to figure out why by examining all of the script, rather than being pointed to the problematic line.

Think, as a coder, of how many compiler errors you get even doing something simple. Woops, mispelled that. Woops, that’s a member of this child of such and such object. How productive would you be if every one of those took 5-10 minutes of testing and careful attention to see that it was even a problem? Would you want to ship code that you’d never even tried to compile?