Closed
Description
There is many sort of contener and choosing the best, can't be easy to do. For string, it's easy to always use String type (as in ocaml or java),but concatenation will be slow, very slow. It could be great if the compiler use Buffer instead. Or rope (a contener of string), if the string is udge.
To do that, i propose to autorise a virtual class to be declared, the compiler will choose a daughter class. The class invariant should help to avoid mistakes.
Compiler could choose with heuristics as loops presence, and frequency of use of methods.