This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-23
Channels
- # announcements (5)
- # aws (9)
- # babashka (60)
- # beginners (561)
- # calva (8)
- # cider (17)
- # clj-kondo (1)
- # cljsrn (12)
- # clojure (36)
- # clojure-dev (3)
- # clojure-europe (3)
- # clojure-france (10)
- # clojure-greece (8)
- # clojure-italy (6)
- # clojure-spec (3)
- # clojure-uk (6)
- # clojurescript (30)
- # community-development (2)
- # conjure (15)
- # datascript (24)
- # figwheel-main (49)
- # fulcro (29)
- # helix (72)
- # off-topic (20)
- # pathom (7)
- # rum (7)
- # shadow-cljs (23)
- # spacemacs (6)
- # sql (8)
- # timbre (1)
- # xtdb (10)
(defn generate-ints []
(let [c (ArrayBlockingQueue. 1)
thread (Thread/startVirtualThread
(fn []
(loop [x 0]
(do (.put c x)
(recur (inc x))))))]
(iterator-seq
(reify Iterator
(hasNext [_]
true)
(next [_]
(.take c))
Object
(finalize [_]
(.interrupt thread))))))
That is interesting, are virtual threads gc roots? They say they are like normal threads which implies they are
Though yeah, I assume any non-daemon virtual thread (if they could even be daemons) would be a GC root
Well, for example if a go block is waiting on a channel, because of the inversion of control, the go block is actually a callback on the channel, so if nothing else references the channel (so nothing can unblock the go block away) the channel will be gced
@emccue There is no proper use of finalize. It’s been deprecated https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/Object.html#finalize().
This is pretty impressive. If you're into CLJS development, you might also find this interesting: https://www.youtube.com/watch?v=HGuTqsVh59w&list=PLA66mD-6yK8yjlJCI0Ay2f2IvvmB9Ktga&index=16
i think more is gained from async not being a macro thing than the loss of flexibility
Brian Goetz discussing Clojure https://www.twitch.tv/nipafx 🙂
https://www.twitch.tv/videos/629358245?t=14h13m17s is from the recording, right when Goetz started. Basically he really sees Clojure as added value, and he really likes it's not a 'better java' like Scala and Kotlin, with the tradeoffs that come with that from a language design point.
https://www.twitch.tv/videos/629358245?t=14h13m17s is from the recording, right when Goetz started. Basically he really sees Clojure as added value, and he really likes it's not a 'better java' like Scala and Kotlin, with the tradeoffs that come with that from a language design point.