One minor advantage of Byte Ptr over Int is that even if the value itself is the same, it makes it clearer to both the compiler and any human readers (especially yourself, if you wrote something "clever" six months ago) what your intentions are for the value. A Byte Ptr can be added and subtracted and nothing else, without either manual casting, or passing it to an external function.
It's a little hollow to talk of "safety" when the language lets you use unrestricted casts, but it is a small bonus and it does help when the pointer-play starts getting complicated (e.g. if you need to cast through two or more layers of indirection, it's really handy to have the compiler telling you "actually you need one more layer before you get the Int you want", or similar).
|