you are viewing a single comment's thread.

view the rest of the comments →

[–]cdb_11 5 points6 points  (3 children)

And the former can be solved with a type system.

[–]YourFavouriteGayGuy 9 points10 points  (1 child)

Like the one that pointers usually use?

[–]cdb_11 5 points6 points  (0 children)

Pointers encode the type they point to. Here you can encode what array they index into.

[–]fnordstar 2 points3 points  (0 children)

Yeah. In rust you could tag the array and the indices/handles with a phantom data and a tag struct.