Hi Pelangi,
As Shohei mentioned, there are some drawbacks to your suggestion that may not be immediately obvious. First, any conversions of data types from larger to smaller types runs the risk of data loss. Even if you are only simulating the appearance of an int32
variable when it is actually an int64
variable, when that variable gets passed into Engine functions it will need to be converted to an int32
in order to work since the variable types in the Engine would not have been changed.
There would also be an additional cost in terms of performance whenever a variable is passed into, or returned from, an Engine function as the conversion takes place.
Unfortunately there would not be a feasible way to have the compiler convert the data types during compile time. Doing so would require that the Engine be rebuilt every time a project is rebuilt, and trying to automatically change data types for a program as complex as the Engine would be incredibly risky. The only way to minimize the risk of data loss and performance cost would be to completely replace the variable types in the Engine source code.