Re: [Scheme-reports] Bitwise operations on bytes
Per Bothner 29 Mar 2012 19:11 UTC
On 03/29/2012 10:40 AM, John Cowan wrote:
> Alan Watson scripsit:
>
>> That is my specific question: did you consider including bitwise
>> operation on bytes only?
>
> We did not. Feel free to make a small WG1-ish proposal for them, though
> I doubt it will pass at this point.
>
> I'll note that in Java and C#, boolean arrays are represented with one
> (logical) bit per byte; on modern systems, the cost of setting bits is
> high enough (read-modify-write) that a factor of 8 in space is well
> worth paying. This would not be true of embedded systems.
I would expect the opposite: On modern systems arithmetic (including
bitwise operations) is effectively free, but cache misses are expensive,
so compact data structures are what counts.
You wouldn't use a read-modify-write instruction except for "volatile"
accesses.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports