From: Tom Lord <lord@emf.net>
Cc: guile-user@gnu.org, guile-devel@gnu.org
Subject: Re: Worrying development
Date: Fri, 23 Jan 2004 14:18:25 -0800 (PST) [thread overview]
Message-ID: <200401232218.OAA27477@morrowfield.regexps.com> (raw)
In-Reply-To: <87oesus7kg.fsf@zagadka.ping.de> (message from Marius Vollmer on Fri, 23 Jan 2004 22:01:35 +0100)
> From: Marius Vollmer <mvo@zagadka.de>
> Tom Lord <lord@emf.net> writes:
> > Mutation-sharing shared substrings are an upwards compatible extension
> > to the Scheme standard. They break no correct programs. They enable
> > new kinds of programs.
> I'd say that the real 'trouble' is that strings are mutable at
> all.
Worried mostly about variable-length character encodings in string?
Or you'd just rather be programming in an ML-family language? :-)
If it's variable-length encodings that irk you: if strings were
read-only you'd want to optimize the heck out of STRING-APPEND and
SUBSTRING and, once you did that, you'd have essentially enough
machinery to do mutations efficiently.
> Also, I still like the idea of using mutation-sharing substrings as
> markers that allow O(1) access into variable-width encoded strings.
Interesting. The interaction with STRING-SET! will be tricky. I
think you'll either have to "timestamp" strings (one tick per mutation
-- and you'll likely have to use a GC'ed value rather than an inline
integer for timestamps) or wind up with O(K) for mutations where K is
the number of shared substrings.
The same problem comes up if you add STRING-RESIZE!. I keep going
back and forth on whether or not strings should be the same things as
or a subset buffers vs. making buffers a completely separate type.
(The latter certainly seems to be easier to implement.)
> Also, there is the possibility on the horizon that we turn
> string-ref etc into 'primitive generics' which means that people
> could implement new kinds of strings using GOOPS.
Well, heck. In that case, maybe consider what I'm planning for Pika
(at least initially). Purely ASCII strings are stored 1-byte per
character. Most other strings 2-bytes per character. Strings using
characters outside the Basic Multilingual Plane, 4 bytes per
character.
You want some fancier-than-libc string functions in C for that -- but
it gives you an expected-case O(1) for STRING-REF and STRING-SET! and
pretty good space efficiency. It also gives you some performance
glitches as when you store a U+0100 character in an otherwise purely
ASCII 10MB string. (We're working on providing such fancier-than-libc
functions in libhackerlab -- so they'd be available independently of
Pika if you went this route.)
-t
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user
next prev parent reply other threads:[~2004-01-23 22:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-16 9:41 Worrying development Roland Orre
2004-01-16 11:59 ` tomas
2004-01-18 21:05 ` Marius Vollmer
2004-01-18 21:58 ` Tom Lord
2004-01-22 21:47 ` Tom Lord
2004-01-22 16:11 ` Dirk Herrmann
2004-01-22 18:42 ` Tom Lord
2004-01-23 11:45 ` Dirk Herrmann
2004-01-23 17:16 ` Tom Lord
2004-01-23 21:01 ` Marius Vollmer
2004-01-23 22:18 ` Tom Lord [this message]
2004-01-24 0:27 ` Marius Vollmer
2004-01-24 0:53 ` Tom Lord
2004-01-23 22:28 ` Paul Jarc
2004-01-24 12:09 ` rm
2004-01-24 13:29 ` Marius Vollmer
2004-01-26 2:42 ` overriding car/cdr (was: Worrying development) Paul Jarc
2004-02-08 16:21 ` overriding car/cdr Dirk Herrmann
2004-02-08 18:09 ` Marius Vollmer
2004-02-08 20:56 ` Paul Jarc
2004-03-20 22:28 ` Marius Vollmer
2004-03-22 17:05 ` David Van Horn
2004-03-22 21:03 ` Marius Vollmer
2004-03-22 17:24 ` Paul Jarc
2004-01-23 22:37 ` Worrying development Dirk Herrmann
2004-01-23 23:25 ` Tom Lord
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200401232218.OAA27477@morrowfield.regexps.com \
--to=lord@emf.net \
--cc=guile-devel@gnu.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).