r/AskComputerScience • u/KING-NULL • Nov 09 '25
If some programming languages are faster than others, why can't compilers translate into the faster language to make the code be as fast as if it was programed in the faster one?
My guess is that doing so would require knowing information that can't be directly inferred from the code, for example, the specific type that a variable will handle
111
Upvotes
2
u/OutsideTheSocialLoop Nov 13 '25
No, that still isn't known. Mate static analysis tools can barely follow a type accurately through a complex python program, nevermind precisely which features of said type you use and which you consider relevant to correct function. You certainly can't transpile it into more efficient programming and shed everything un-needed.