News for hackers. Stuff that matters.
Re:The Next Steps for Single Ownership and RAII by verdagon on Friday July 17, 2020 @01:44AM (#23867455)
That's interesting! I'm fairly certain Vale avoids the problem with its lambda approach, but I can see a partially initialized array being very useful for Rust. In fact, I think Cone [1] does exactly that; you can designate a certain field to be the size for another an array field.

I haven't looked at google's sparse hash table yet, I'll have to codesearch that =)

[1] https://cone.jondgoodwin.com/

Re:The Next Steps for Single Ownership and RAII by Animats on Friday July 17, 2020 @05:53PM (#23876354)
In fact, I think Cone does exactly that;

Interesting. Cone has every known approach to memory management. GC, refcounts, arenas, pools, single ownership, thread local... Worth an experiment, but you probably don't want to go there for a widely used language. Think of the library compatibility problems.

For locking purposes, there's an argument for thread-local, shared, and transferable objects. Transferable objects are what you put in a queue between two threads. They're single-thread and don't need locking when in use, but can be handed off to another thread.

It's useful if transferable objects are transferable by copy. This is useful for machines where not all memory is shared. We're headed there; cache management gets harder and harder as the number of cores starts to approach 3 digits. So think ahead here.