i don't think optimization comes after translation.. it is a very small subset of translation and hence can be done easier, even per particular spot (or aspect), keeping more levels of abstraction intact - i.e. no need to change language, or, change (functional/containment) border-breaks, whatever.
Of course if there are semantically correct ways of translation, optimization might be easier than without it.. For the defined semantics. But can still be hard on (or including) all other not-well-defined fronts.
Well, depends on what "translation", and "optimization", means. If even shuffling a few things around counts as translation, then yes.. But then (near?) every change is translation, so it becomes meaningless as a notion. Better keep it more substantial, for changing some essential expressive ingredient of the code without changing functionality (and structure/architecture?) , much. Like language.
Sometimes translation may bring (speed) optimization, sometimes not (like python<->C) - some redundant loop in C will be faster than same loop in python, but removing it entirely would be even faster.. and no need for a translation just for that.
You probably think of "transformation" as general term, but that is much more primitive than "translation".
Of course if there are semantically correct ways of translation, optimization might be easier than without it.. For the defined semantics. But can still be hard on (or including) all other not-well-defined fronts.
reply