5 ms·
The only reason Clojure is viable for production use is because it relies on the really good JVM GCs. How will Jank try to solve the the GC problem?
by ithrow 4y ago
The only reason Clojure is viable for production use is because it relies on the really good JVM GCs. How will Jank try to solve the the GC problem?
- slowmovintarget 4y agoThe question is answered in Clojurian Slack: "Reference counting is the current design. This is something I'll be digging more into, but I really don't think a GC would be ideal."
- abc_lisper 4y agoHow is that. I thought GC pressure was less of a issue after transducers came into being. Are there benchmark/measurements on memory churn?
- eatonphil 4y agoPython, Ruby, Go all seem to do ok with much worse GCs than Java.
- reitzensteinm 4y agoThe difference is Clojure's persistent data structures. You don't add an element to an array, you create a new copy of the array with the element attached, and the old array is accessible. Internally this is done with structural sharing, so it's way faster than copy on write, but it's still potentially allocating a half dozen objects for what would usually be a trivial operation that does not involve allocation. On the plus side, Clojure in theory has some pretty nice guarantees that older objects can't point to newer objects. From memory Haskell takes advantage of these guarantees to accelerate its version of eden. There may be a way to get a fast GC that's not nearly as complex as the full JVM GC.
- eatonphil 4y agoDoes Clojure really compete closely in overall performance with other immutable-first languages like OCaml/Standard ML?
- eatonphil 4y agoThis is all a bit of a distraction though. > The only reason Clojure is viable for production use is because it relies on the really good JVM GCs. How will Jank try to solve the the GC problem? I think this original statement is wrong because people are fine with poor performance (see Python, Ruby) if the language (ecosystem) is effective. And Clojure is effective (IMO) moreso because of the JVM ecosystem not the JVM's performance.
- reitzensteinm 4y agoI think you're underestimating how slow a naive implementation would be. The only Clojure implementations that have gained traction are built on top of both great JITs and GCs.