[r6rs-discuss] Re: [Formal] bytevector aliasing severely impedes optimizations (Sam TH)
Hi,
Bradley Lucier <lucier_at_math.purdue.edu> writes:
> If, instead of bytevectors, R6RS had homogenous vectors as in SRFI 4,
> this could be inferred from the text of the program.
However, SRFI-4 vectors are not handy for binary I/O, precisely because
they are homogeneous. FWIW, I recently implemented ONC RPC and XDR
using the bytevector API and found it very convenient.
The interesting thing is that either type can be implemented in terms of
the other. Implementing SRFI-4 on top of bytevectors raises aliasing
issues. Implementing bytevectors on top of SRFI-4 vectors may be
inefficient (except for accesses of the type of the underlying SRFI-4
vector) because the representation conversion code would need to operate
on regular (boxed) numbers (e.g., assuming a u8vector is used,
`bytevector-u32-ref' needs to fetch 4 numbers, and then perform the
appropriate arithmetic and bitwise operations).
Maybe that's a sign that both abstractions are useful on their own?
Thanks,
Ludovic.
Received on Mon Mar 05 2007 - 13:13:21 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC