I've spent a considerable amount of time now figuring out in which "direction" do memory addresses mentally increase. I'm trying to pick a convention for presenting memory in Automat that would make it easier to mentally picture what's happening. No direction is perfect and each one involves some friction when mentally manipulating order of things.
The established conventions that I know of are:
- Text goes right and down (when lines wrap). Text direction may be pretty much arbitrary when different scripts are involved.
- Bits increase towards left (because << shifts bits up) and then up (because of "higher" bytes). Computer science courses teach that "stacks grow down".
- Numbers increase towards left (more significant digits go towards left) but for a typical (little-endian) CPU more significant bytes are written towards right.
- Points on a cartesian system tend to increase first towards right and up.
- In nature things usually grow up.
I think we have no widely shared real-world experience of one-dimensional things other than maybe time. Can subsequent addresses be "later"? 😅
You can "grow up" and you can go "deeper", as you can say you can go "right" on latin text or "left" on arabic numbers or both. The only constant is "away".
The only universal answer: a spiral with zero in the middle. I kid, mostly.
For UI about memory, I would honestly go with the conventions for other UIs about memory like hexdumps, where smaller-numbered addresses are at the top of the page and proceed down, usually with a little bit of LTR or RTL within 16 byte blocks or so (possibly worth localizing?).
Unless you really want to innovate the UI, in which case do whatever. They're just numbers. You can use any consistent ordering, and they've all been used for something, so there's not a firm precedent. I think bringing in endianness, 2d cartesian coordinates, etc is a bit of a red herring. I'd only caution that trying to have numbers that grow up and sideways like a cartesian graph will be really confusing, just because if it's embedded in a UI that reads topdown/LTR like English, it'll be really hard to avoid applying that to the memory UI too.
If you want to do something weird, I guess there's also the good ol' space-filling curve visualization; that'll keep things compact without privileging any direction or even either end of the ordering too much, at the cost of, well, being weird.
binvis.io uses the last one for reverse engineering (and it works wonderfully there!). Memory in this view feels a little like a long noodle squeezed into a container 😂