architecture

john 2018-08-08T21:50:51.000321Z

have an aaaalmost working version of this integrated into tau.alpha, so SAB backed taus are automatically allocated and freed with usage. Pretty sweet.

john 2018-08-08T23:33:33.000249Z

yeah, it works

john 2018-08-08T23:36:07.000245Z

So there's really no compaction on the allocated state in this scheme. You just compact the references in the free index and allocate new stuff on the left-most free spaces available. Smallest free block that fits from the left wins.

john 2018-08-08T23:37:51.000142Z

And it assumes all allocations are read only. And any new writes to a datastructure will produce a new write over free space. So we can lean on this free index a little harder.

john 2018-08-08T23:41:59.000005Z

Could do a diff on the old-val and new-val on each swap!, then store only the new-diff on a new tau-block in mem, leaving the old val still there, then stitch it back together on read. Just leave the new address on the old block so they can be traced. But then we'd have to start tracking the old references and decide when to start free'ing them.

john 2018-08-08T23:42:39.000087Z

But rather than a diff, typed-array backed persistent datastructures for CLJS would be able to live right inside the arraybuffer.

john 2018-08-08T23:44:25.000020Z

It's own functional allocation scheme could probably make garbage collection pretty easy to track.

john 2018-08-08T23:48:24.000170Z

Also, keep in mind, SharedArrayBuffers are intended to be the interface between JS and WASM. I don't know as much about interoperating with C/C++ memory but we'll likely be talking to those libs in CLJS via SABs.