Skip to content

Conversation

ggreif
Copy link
Contributor

@ggreif ggreif commented Oct 21, 2022

This is a re-submit of #416, which didn't got squashed to master. All individual commits by Kento.


Base Library Extension Doc: https://docs.google.com/document/d/1uKouujLL3KueLpqjjFV2gd4dqu_6GYD107WBb6_GSVE/edit

  • Complete unit tests
  • Consider making initCapacity an optional value with a default initial capacity
  • While loop iterations over Arrays may be faster with an iterator due to a compiler optimization
  • In functions where a new buffer is being constructed, have some consistent scheme for how to determine the new buffer's capacity. Should the new buffer have just enough space to hold its element, or be given some insertion leeway?
  • Some class methods can be moved outside of the class since they don't need access to the underlying array
  • Consider behavior of transpose on empty Buffers
  • sort() can be optimized by hoisting helper functions
  • Restore broken methods in Array.mo and Hash.mo
  • Compare with original Buffer class and try to keep some level of backwards compatibility / deprecate old functions
  • Fix naming to be consistent with user friendliness, other classes, and style / interface guide
  • Add user friendly error messages / error checking
  • Cleanup tests
  • Add documentation for each function
  • Add examples for each function (put up as a separate PR)
  • A primitive array tabulate for var arrays would allow some nice optimizations (put up as a separate PR)
  • Profile this class to see if a more scalable dynamic sequence is necessary and to resolve ambiguous design decisions

This last point is related to the RRB Trees, Rope, and Finger Trees data structures that I was discussing before. For various reasons, I am leaning towards an RRB Tree implementation of a scalable sequence structure, if it is necessary. See a talk on this data structure here: https://www.youtube.com/watch?v=sPhpelUfu8Q

@ggreif ggreif requested a review from crusso October 21, 2022 11:37
@ggreif ggreif enabled auto-merge (squash) October 21, 2022 11:42
@ggreif ggreif disabled auto-merge October 21, 2022 11:42
@ggreif ggreif merged commit 96dff73 into master Oct 21, 2022
@ggreif ggreif deleted the extensions branch October 21, 2022 11:43
ggreif added a commit that referenced this pull request Oct 21, 2022
Base Library Extension Doc: https://docs.google.com/document/d/1uKouujLL3KueLpqjjFV2gd4dqu_6GYD107WBb6_GSVE/edit

- [x] Complete unit tests
- [x] Consider making initCapacity an optional value with a default initial capacity
- [x] While loop iterations over Arrays may be faster with an iterator due to a compiler optimization
- [x] In functions where a new buffer is being constructed, have some consistent scheme for how to determine the new buffer's capacity. Should the new buffer have just enough space to hold its element, or be given some insertion leeway?
- [x] Some class methods can be moved outside of the class since they don't need access to the underlying array
- [x] Consider behavior of transpose on empty Buffers
- [x] sort() can be optimized by hoisting helper functions
- [x] Restore broken methods in Array.mo and Hash.mo
- [x] Compare with original Buffer class and try to keep some level of backwards compatibility / deprecate old functions
- [x] Fix naming to be consistent with user friendliness, other classes, and style / interface guide
- [x] Add user friendly error messages / error checking
- [x] Cleanup tests
- [x] Add documentation for each function
- [ ] Add examples for each function (put up as a separate PR)
- [ ] A primitive array tabulate for var arrays would allow some nice optimizations (put up as a separate PR)
- [x] Profile this class to see if a more scalable dynamic sequence is necessary and to resolve ambiguous design decisions


This last point is related to the RRB Trees, Rope, and Finger Trees data structures that I was discussing before. For various reasons, I am leaning towards an RRB Tree implementation of a scalable sequence structure, if it is necessary. See a talk on this data structure here: https://www.youtube.com/watch?v=sPhpelUfu8Q

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kento Sugama <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants