[Haskell-cafe] Batteries included (Was: GHC is a monopoly compiler)

Joachim Durchholz jo at durchholz.org
Fri Sep 30 06:17:38 UTC 2016


Am 30.09.2016 um 04:16 schrieb Richard A. O'Keefe:
>
> On 30/09/16 4:18 AM, Joachim Durchholz wrote:
>> Each language does define its preferred string representation.
>
> Java again:  it has *two* string representations baked into the
> language.

There is a single standard representation.
I'm not even aware of a second one, and I've been programming Java for 
quite a while now.

Unless you mean StringBuilder/StringBuffer (that would be three String 
types then). However, these classes are by no means "preferred" in 
practice: the vast majority of APIs demands and returns String objects.

Even then, Java has its preferred string representation nailed down 
pretty strongly: a hidden array of 16-bit Unicode code points, 
referenced by a descriptor object (the actual String), immutable.

> The Smalltalk system I use most has
>  - read-only strings (preferred)
>  - unique read-only strings
>  - mutable strings
>  - substrings (positionable read-only slices)
>  - extensible strings
>  - streams over strings
>  - lazy concatenations of strings
>  - read-only byte arrays viewed as strings
>  - mutable byte arrays viewed as strings

Ah, Smalltalk. I haven't looked at that in ages.
I'll give you that these classes all exist, but I am not sure whether a 
Smalltalk programmer would consider them all equivalent or not.


More information about the Haskell-Cafe mailing list