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/