replikativ / hitchhiker-tree

Functional, persistent, off-heap, high performance data structure
Eclipse Public License 1.0
44 stars 19 forks source link

Cleanup and factorize code base #4

Open whilo opened 5 years ago

whilo commented 5 years ago

The code base is currently not very accessible and badly factorized. We should go through all the comments and documentation of the codebase and collect it. We should also move all IO related code (including serialization) into separate namespaces and ideally break this out into separate repositories.

mpenet commented 5 years ago

A proposal for this:

I was thinking about something like that:

../hitchhiker-tree/src/hitchhiker/tree/protocols.clj
../hitchhiker-tree/src/hitchhiker/tree/impl/messaging.clj 
../hitchhiker-tree/src/hitchhiker/tree/impl/tree.clj 
../hitchhiker-tree/src/hitchhiker/tree.clj* ;; default api surface using using proto+impl/*, so a single requires brings both read/write interfaces 

Then we can imagine having subprojects (with their own project.clj), potentially in the same repo but with different deploy targets (artifacts), a bit like I did here: https://github.com/mpenet/alia/tree/master/modules (or https://github.com/arrdem/katamari or even ring https://github.com/ring-clojure/ring): basically it adds up to the same namespace hierarchy with new functionality but via multiple dependencies.

../codec/src/...
../redis/src/hitchhiker/tree/redis.clj /redis/src/hitchhiker/tree/redis/*.clj... 
../konserve/src/hitchhiker/tree/konserve.clj /konserve/src/hitchhiker/tree/konserve/*.clj

few other things:

whilo commented 5 years ago

I like the refactoring proposal. I would 1. collect all the comments that are documentation (e.g. in core.cljc) and move them to some document, e.g. wiki or into the doc folder. 2. Do your proposed refactoring for protocols and 3. factor out the IO backends. I like the idea of keeping them in the same repo for now, but I have not a very strong opinion on that.