From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: subbytevectors Date: Sat, 09 Jun 2012 13:07:15 +0200 Message-ID: <878vfwg2vw.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1339246331 19445 80.91.229.3 (9 Jun 2012 12:52:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Jun 2012 12:52:11 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jun 09 14:52:09 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SdL9F-0002Un-67 for guile-devel@m.gmane.org; Sat, 09 Jun 2012 14:52:09 +0200 Original-Received: from localhost ([::1]:33861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdL9F-00070p-3A for guile-devel@m.gmane.org; Sat, 09 Jun 2012 08:52:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdL9A-0006zz-PD for guile-devel@gnu.org; Sat, 09 Jun 2012 08:52:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SdL98-0002nm-V4 for guile-devel@gnu.org; Sat, 09 Jun 2012 08:52:04 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:56293 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SdL98-0002nZ-MH for guile-devel@gnu.org; Sat, 09 Jun 2012 08:52:02 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 15F168B87 for ; Sat, 9 Jun 2012 08:52:00 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-type; s=sasl; bh=N V09emZBgZZwt1WkdaSYmm7+1Ts=; b=QVoiYKFEKTUG86Yw5OUptaXmE4KgMUh1F VuKKi7oHZzXyfHaalsjjyj9jKTsGshcrjva/xDKjD7jcSaGJKAYrDr8gJYbMr6pG lFqWvN0ZzzjlzqRJB0qWgo0aycMlCgaQ1OSXkSju5AyZvO80q9zkycb6G+yTNtSe Msf7BAoZFg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :date:message-id:mime-version:content-type; q=dns; s=sasl; b=xXd /xV0QqbaSdkx9+60bvKdQapgN/9LrVDjf9oy4fM1WIC4bySRwhbCA6xtrxNG7BmK nnfErv1/0TH0jT7p3+pYKCZQUTlUHn+i9zI53ZLOcHkAL1437JxuwI3MGER9DklL 75o06rhSQfh609UqOTLzkCpU6vrntAC8ikRVqRAY= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 0EA838B86 for ; Sat, 9 Jun 2012 08:52:00 -0400 (EDT) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 6D5E38B85 for ; Sat, 9 Jun 2012 08:51:59 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) X-Pobox-Relay-ID: E6FBF614-B231-11E1-8F7F-8DF2579FE65A-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14569 Archived-At: 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/