I don't think I've ever worked with a language where the compiler decides what data structure to use dynamically - are there any common/popular languages that do this?
@srb I doubt there are any popular languages that do this. The reason domain-specific languages are able to make such decisions better than the programmer is because they are designed for very specific applications. This allows them to make many more important assumptions about the nature of the code and its application. In the case of a popular languages, they are designed for a broad scope of applications and cannot make any such assumptions.