The mutable string situation
Since the first version, OCaml has mutable strings. With time and the hindsight provided by numerous languages with immutable strings, this design decision has begun to be seen by many developers as wrong. As pointed out by Xavier Leroy, however, it is now impossible to come back on that decision and fully root out mutable strings from the language. However, new data structures may be added, made comfortable for general use and documented as being the new standard.
We need to
- decide if we actually want this to happen
- decide on the necessary APIs and performance requirements for these new data structures (e.g. ropes)
- discuss and implement a nice Camlp4 syntax for these revised strings
- decide on whether/how to include these APIs in end-user distributions (e.g. GODI, Debian packages, Fedora packages)
- add new implementations of Pervasives / standard library functions for text strings instead of the string type
- document the use of these APIs for the most common situations, both for newbies and seasoned developers
- start patching our own applications to make use of these APIs, both as a way to test them and as a way to have bring the OCaml world one step further towards something that interacts more easily
- from the moment the debate is concluded, make it clear for new users of OCaml that, unless they have very specific needs, this is the One True Way of using text.
Express yourselves here