core.cache

Porting core.cache to ClojureScript

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

How would you like to proceed with porting core.cache to ClojureScript?

Most of the code could be shared between CLJ and CLJS, but there are differences

a) different use of macros
b) weak references - only available in some JS environments

How to proceed?

1) use reader conditionals (CLJC) to share code between CLJ and CLJS
2) have two different implementations in same codebase (like core.async does)

Option 1 would limit new core.cache version to Clojure 1.7. Second option means to maintain two different implementations.

What do you think?

Activity

Hide
Jeroen van Dijk added a comment -

I would like to see this a cljs port as well. I did a quick check and saw this:

Depends on internal java interop:

lirs-cache
soft-cache

Depend on clojure/data.priority-map map which has java interop:

lru-cache
lu-cache

No specific java deps (for all interop there is a js equivalent):

ttl-cache
fifo-cache

Show
Jeroen van Dijk added a comment - I would like to see this a cljs port as well. I did a quick check and saw this: Depends on internal java interop: lirs-cache soft-cache Depend on clojure/data.priority-map map which has java interop: lru-cache lu-cache No specific java deps (for all interop there is a js equivalent): ttl-cache fifo-cache
Hide
Matt Burbidge added a comment - - edited

I needed this feature so I searched around and found this. It seemed to be unmaintained so I forked it and gave it an update which can be found here. I've reached out to timgalebach (via an issue on his cljs-cache) to see if he wants to continue maintain or if I should take over, no response yet. All this happened before I found this thread. My implementation is following option 2 listed above, however only basic, ttl, and lru are implemented so far. Let me know if I can help.

Show
Matt Burbidge added a comment - - edited I needed this feature so I searched around and found this. It seemed to be unmaintained so I forked it and gave it an update which can be found here. I've reached out to timgalebach (via an issue on his cljs-cache) to see if he wants to continue maintain or if I should take over, no response yet. All this happened before I found this thread. My implementation is following option 2 listed above, however only basic, ttl, and lru are implemented so far. Let me know if I can help.
Hide
Sean Corfield added a comment -

Given the number of caches in the library that depend directly or indirectly on Java interop, I don't think have a CLJS version of core.cache as it stands is realistic.

I think CLJS could have a different core.cache library that contains ports of the caches that have no Java interop and could later add implementations of the other caches as desired, but whoever takes that on needs to decide whether they want a Clojure CA-based process in Contrib or a PR-based process on GitHub outside of Contrib.

Show
Sean Corfield added a comment - Given the number of caches in the library that depend directly or indirectly on Java interop, I don't think have a CLJS version of core.cache as it stands is realistic. I think CLJS could have a different core.cache library that contains ports of the caches that have no Java interop and could later add implementations of the other caches as desired, but whoever takes that on needs to decide whether they want a Clojure CA-based process in Contrib or a PR-based process on GitHub outside of Contrib.
Hide
Sean Corfield added a comment -

Release 0.7.0

Show
Sean Corfield added a comment - Release 0.7.0

People

Vote (6)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: