perennial icon indicating copy to clipboard operation
perennial copied to clipboard

Write a new typed slice library with a clean abstraction

Open tchajed opened this issue 4 years ago • 0 comments

The slice library is rather large, which makes it painful to shadow and re-export everything with types.

I think perhaps a better design is to think of a slice as naming a set of locations, without owning pointers for those locations. Then, we can instantiate a predicate per location; this subsumes the current is_slice_small and updates_slice, and similar notions. Subslicing just changes the set of locations. If this turns out to be difficult or not useful, we can revert to essentially the untyped slice library but ported to have types.

This involves doing the following:

  • [ ] try out a new is_slice predicate that does not consume space but can be combined with a predicate per location
  • [ ] implement the current API using the new predicate
  • [ ] port all users of the untyped library to the typed version
  • [ ] rename is_slice_small to is_slice and is_slice to is_slice_append
  • [ ] use slice_cap separately where possible

tchajed avatar Jul 14 '20 00:07 tchajed