Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write a new typed slice library with a clean abstraction #10

Open
5 tasks
tchajed opened this issue Jul 14, 2020 · 0 comments
Open
5 tasks

Write a new typed slice library with a clean abstraction #10

tchajed opened this issue Jul 14, 2020 · 0 comments

Comments

@tchajed
Copy link
Member

tchajed commented Jul 14, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant