Make "field decomposition" a compilation step
Clarification and motivation
In Indigo we implement "field decomposition", currently implemented as a way to break down
storage into its components, in order to avoid the cost of repeated lookup of and re-building from its fields.
This is still an incomplete feature, with several issues open to improve on it, that is based on a different representation of variables as "decomposed objects" and many types and function to keep this in consideration (mainly in the backend.
However this feature could be implemented instead as part of the compilation process (possibly entirely from frontend to backend), by using a well known compiler optimization know as "Scalar Replacement of Aggregates".
Implementing this could possibly solve many of the issues and new features tied to the current approach.
It will require, however, splitting Indigo compilation in a multi-step one (at least a simple one).
A version of "Scalar Replacement of Aggregates" is implemented and used as part of Indigo's compilation process, replacing the current approach to "field decomposition".