I was thinking of doing this with C++, basically from an external editor or something the programmer can say: MyClass::dude = “hello” where ‘dude’ is a static integer in ‘MyClass’.
What the program does at runtime is it partitions the input to MyClass :: dude = “hello” and finds the class called ‘MyClass’ and assigns the dude variable in it as “hello”.
The idea behind it is for it to act as a sort of a runtime debugger.
Is this safe/sane?
Yes, this is a typical tool used during development to help fine-tune games. It’s not so often something you type in as much as a screen where you can adjust variables on the fly with a controller (that changes some class variable under the hood), but for pc games, there isn’t a reason why you couldn’t type in something, especially if it’s text. You would, of course, need to program your own system where a class notifies some part of your engine of it’s name and how to get at some of its variables.