Closed sidagrawal closed 5 years ago
Whats is the motivated behind creating Linear Containers? I can update the README accordingly.
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.
This looks good. Thanks!
"in-line" is a strange wording. Do you mean "in-place"?
"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.
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.
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!
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.