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
View all comments
Show parent comment
1
u/tobiasvl Nov 10 '25
Anyone can rewrite a small Python script in Rust. You don't need AI for that. I guess we're not allowed to import any Python libraries either?