unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* subbytevectors
@ 2012-06-09 11:07 Andy Wingo
  2012-06-09 15:16 ` subbytevectors Thien-Thi Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Wingo @ 2012-06-09 11:07 UTC (permalink / raw)
  To: guile-devel

Hi,

It would be very convenient to offer bytevectors that give a view on
some other data structure, possibly another bytevector.  We already have
that, to an extent, with pointer->bytevector.  We can consecrate that
with some subbytevector facility.

I think it's a good idea but it has some costs.  One is that currently,
in the R6RS bytevector specification, one bytevector cannot alias
another.  This knowledge can allow the optimizer to do more things.
Another point is that since Guile can control the allocation of
bytevectors, it can ensure their alignments, and so compile e.g. a
(bytevector-u32-ref bv 12 (native-endianness)) to an efficient access,
knowing that it is aligned.  If we offer subbytevectors, this won't be
possible in general.

Again, the gain in expressiveness is probably worth it, but I wanted to
put the question out there to see if anyone has an opinion.

Regards,

Andy
-- 
http://wingolog.org/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-06-11 15:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09 11:07 subbytevectors Andy Wingo
2012-06-09 15:16 ` subbytevectors Thien-Thi Nguyen
2012-06-09 17:07   ` subbytevectors Andy Wingo
2012-06-11 11:55     ` subbytevectors Ludovic Courtès
2012-06-11 14:01       ` subbytevectors Andy Wingo
2012-06-11 15:35         ` subbytevectors Ludovic Courtès

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).