On Mon, Apr 17, 2006 at 01:52:43PM +0200, Leopold Toetsch wrote:
: 
: On Apr 17, 2006, at 0:02, Nicholas Clark wrote:
: 
: >I think Dan was thinking that internally everything should be fixed 
: >width,
: >and for practical reasons pick the smallest of 8 bit, UCS-16 and UCS-32
: >internally. Convert variable width to fixed width (losslessly) the 
: >first time
: >you need to do anything to it, and leave it that way.
: 
: Not really. He had the model of not converting a string at all, based 
: on an example, where a string was just passed through parrot. I'd 
: prefer the fixed width encoding scheme.

We actually discussed this several times early in the design of
Perl 6.  One other point that hasn't been (re)made yet is that the
fixed-width approach scales quite well when combined with abstract
strings represented as fragments, since different fragments can be
stored in different sizes but can present a unified abstract interface.
And often one can just get away with upgrading the current fragment
rather than the whole string.  The fragment approach also tends to
have nicer COW properties.  It's not so nice for substr(), of course,
but you probably shouldn't be doing that on character strings anyway.
That's what buffers and arrays are for.

Whether Parrot wants to do fragmentary strings is another matter.
If we stick with fixed uniform strings then languages such as Perl 6
could certainly build something more flexible on top of that, though
perhaps not as efficiently.

Larry

Reply via email to