News for hackers. Stuff that matters.
Re:Handles Are the Better Pointers (2018) by jagger27 on Thursday August 13, 2020 @08:33AM (#24142680)
> you can stripe the data for one object into multiple arrays and use the same handle to index each of them which can improve locality.

I wish programming languages made it easy to structure arrays of objects like this. I think Johnathan Blows’s JAI has some kind of transparent support for SoA.

Re:Handles Are the Better Pointers (2018) by yiyus on Thursday August 13, 2020 @09:54AM (#24143335)
This basically is how tables work in k. Tables are defined as a list of dictionaries, but in fact stored as an array for each element (ie. each column of the table is an array, but each row can be read as a dictionary).
Re:Handles Are the Better Pointers (2018) by gumby on Thursday August 13, 2020 @01:02PM (#24145533)
It’s trivial to do this in C++ and often the caller doesn’t even realize.
Re:Handles Are the Better Pointers (2018) by aks_tldr on Thursday August 13, 2020 @07:40PM (#24151242)
do you have any pointers of such implementation ?
Re:Handles Are the Better Pointers (2018) by gumby on Saturday August 15, 2020 @05:50PM (#24172730)
We have a mixin class that will allocate a subclass with its own array of handles (the handles overload * and -> so they act like pointers). If you have an instance variable you can choose to give it a different allocator, where that instance variable of object with handle `n` is the nth object in the new area. Then your instance method `barf& foo();`, instead of getting the instance variable `barf m_foo` Instead does some inlined arithmetic and gives the caller a reference to the object.