News for hackers. Stuff that matters.
Re:Julia's Arraypocalypse Release by JulianMorrison on Sunday September 27, 2015 @04:34PM (#10287869)
Zero based indexing counts offsets. Literally in C, you are saying "add n times sizeof(T) to the base pointer and dereference it". It rather implies arrays are contiguous in storage and lack any "holes". It's a crude but close-to-the-metal approach. C arrays are not general, they are one specific structure. An array could be implemented as a tree, but C doesn't have built-in support for that.

One based indexing counts, or labels boxes. Counting implies no "holes", but abandons any implication about how they are laid out in storage. Labelling allows treating numerical arrays as sparse hash tables, with as many "holes" as needed. It's a high level view, suited to mathy ways of thinking about data.

Re:Julia's Arraypocalypse Release by gct on Sunday September 27, 2015 @09:52PM (#10288593)
You can "label" by just agreeing that zero is in the set of counting numbers and labelling with those. Just because it's zero based doesn't mean it has to be an offset.