From: Thomas Lord <[email protected]>
Subject: Re: [r6rs-discuss] Proposed NON-features for small Scheme, part 8: 
string-set! must die
Date: Sat, 19 Sep 2009 15:49:47 -0700

> It is the case that a tiny implementation of small
> Scheme - one small in footprint and simple in implementation - 
> is unlikely to have much by the way of sophisticated
> optimizations.   
> 
> If we're going to talk about optimizations for a 
> small dialect of Scheme, I think we have to talk about
> an implementation class that is somewhere in the middle:
> it might not (except through libraries) offer a "big Scheme"
> environment but aims to provide a rich environment with a
> sophisticated implementation.

RnRS abandoning mutable strings does *not* prevent such
tiny Scheme from having mutable strings as an implementation's
extention.   Such tiny Scheme can still use all portable
RnRS (immutable) string library.  Code written specifically
for the tiny Scheme, implementing optimizations specific to it,
is by definition non-portable.  Such code can freely take
advantage of tiny Scheme's mutable strings.

Requiring string ports (string builder) shouldn't be much
burden to the tiny Scheme; it is trivial to implement it
on top of mutable strings, especially if the tiny Scheme
uses only ASCII or ISO-8859 characters.

> Those considerations lead me to the conclusion we
> should really have both mutable and immutable strings.

I feel that your discussion explains why mutable
string benefits tiny Scheme, but doesn't support why
mutable strings should be in the standard.

> > 2) Algorithms where you want to modify strings in the middle are rare,
> 
> Claims like this always make the hairs on the back of my 
> neck stand up.  There are two problems with them.
> First, there isn't a really good empirical way to establish
> such claims.   Second, rarity per se, is not the most 
> important consideration.
[...]
> Rarity is not an especially compelling argument.  More 
> important is *importance*.   The question is less "how often
> do I need to reach for string mutation?" so much as the
> question is "how painful is it if when I want string mutation
> I can't have it?".

It is plausible, but could you support your opinion with
some concrete observation, experience, or algorithms?
The counter observation of that 9 years of experience in
Gauche community.

> In the absence of mutation, when people want to implement
> "a string like thing whose contents and length can 
> change over time" 

string-set! and string-fill! aren't length-chaning operation,
so discussing length changing case is somewhat irrelevant.

Surely length changing operation is useful.  Mutable strings
via string-set! doesn't give it to you, though.

--shiro

_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to