andrewthad / linear-containers

Containers supporting in-place modification
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Add basic info to README #9

Closed sidagrawal closed 5 years ago

chessai commented 5 years ago

It does a lot more than that. Though this does bring up the issue that there should be a README about the motivation of linear-containers, not yet the implementation, since it's so unstable.

sidagrawal commented 5 years ago

Whats is the motivated behind creating Linear Containers? I can update the README accordingly.

andrewthad commented 5 years ago

The most important module is Linear.Reference. This exposes an API for using malloc and free in a way that cannot leak memory. On top of this API, we can build linked lists (like the implementation in Linear.List), maps, heaps, etc. For small values, these don’t provide much benefit. For for something huge (like, a 1GB map), these should severely cut down on GC pauses.

andrewthad commented 5 years ago

This looks good. Thanks!

chessai commented 5 years ago
  1. "in-line" is a strange wording. Do you mean "in-place"?

  2. "which has functions that use malloc and free without causing memory leaks": I would prefer the wording: "which implements a malloc/free interface that cannot leak memory" The distinction between "cannot cause" and "without causing" to the end user is pretty important: "cannot cause" is more like "an illegal state is not representable", and "without causing" sounds like the internals are at least careful not to allow ill-behaved usages of the interface, but that nothing in the API guarantees it by construction.

  3. In the statement about when these containers are beneficial over their functional counterparts ala containers, there's no mention of why it's beneficial, just that it is. I guess a reader could infer, but it might be clearer to explicitly state that the approach in this library is better when you have larger structures, because GC pauses are cut down severely.

sidagrawal commented 5 years ago

Created a new PR with those changes Chessai. The cannot vs without wording is a great catch, I didn't think about the difference. Thanks!