logoalt Hacker News

andai • today at 4:27 PM • 1 reply • view on HN

Article says pointers and its are both just bitvectors, but doesn't explain what a bitvector is.

It seems to be a vector of bits? Except in practice, a bitvector is just an int where you're using the binary digits to store stuff? And you gotta use these awkward bitwise operators to actually use it? (Popular in 90s video games, to save RAM!)

Or was it another way of saying "ultimately it's the same pattern of ones and zeroes so you can do whatever you want with it as long as you know what you're doing" ?


Replies

amavect • today at 5:29 PM

>ultimately it's the same pattern of ones and zeroes

Exactly. Much equivocation happens when talking about concepts and representation of those concepts. Numbers, bitvectors, pointers, ones-and-zeros, colors, characters, indices, enum values, and whatever all share the same representation. The author thought "bitvector" best represented the commonality (though it doesn't).