Hacker News new | ask | show | jobs
by Dylan16807 479 days ago
Let me put it this way: 16 bit indices are already rarely worth it. 16 bit pointers are 10x the trouble for 20% more situational coverage. It's not worth it. They are not similar levels of useful/terrible.
1 comments

Relative pointers and indices are pretty much the same, it's just the ergonomics which differ a bit (depending on your language or library).

I agree that for most people in most situations neither of them are worth it.

Indices all go in the same allocation, which makes a big difference. You're just putting a max size on your arrays, instead of making your memory allocations a lot more complicated. And if you need bigger, you'll know in a much more straightforward and deterministic way. It also doesn't require the same support from the language, whether that's explicit small pointer support or support for turning integers into pointers.