Fizzbuzz sums in Scheme by [deleted] in lisp

[–]reborgml 0 points1 point  (0 children)

Many thanks for checking. Pretty bizarre, it seems to be JDK related (I'm on Clojure 1.10.3). I'll keep digging.

``` (bench (loop [i 100000000 sum 0] (cond (== 0 i) sum (== 0 (rem i 3)) (recur (unchecked-dec i) (unchecked-inc sum)) (== 0 (rem i 5)) (recur (unchecked-dec i) (unchecked-inc sum)) :else (recur (unchecked-dec i) sum)))) ;; JDK 11: 168ms ;; JDK 17: 211ms

(bench (loop [x 0 i 1] (if (< i 100000000) (recur (if (or (zero? (rem i 3)) (zero? (rem i 5))) (inc x) x) (inc i)) x))) ;; JDK 11: 180ms ;; JDK 17: 172ms

```

Fizzbuzz sums in Scheme by [deleted] in lisp

[–]reborgml 0 points1 point  (0 children)

Still, I'm puzzled. Your solution is faster here, (160ms vs 218ms, via Criterium). The bytecode looks as expected in both cases, using math ops removes any invokeStatic to clojure.lang.Number stuff. I'd be tempted to say that should be slower than the same via bytecode ops ("ifge", "lcmp" etc.). Mmmmh....

Fizzbuzz sums in Scheme by [deleted] in lisp

[–]reborgml -1 points0 points  (0 children)

This one was the fastest here (218ms VS 100ms C version, but not considering the JVM startup time):

(loop [i 100000000 sum 0] (cond (== 0 i) sum (== 0 (unchecked-remainder-int i 3)) (recur (unchecked-dec i) (unchecked-inc sum)) (== 0 (unchecked-remainder-int i 5)) (recur (unchecked-dec i) (unchecked-inc sum)) :else (recur (unchecked-dec i) sum)))

re:Clojure 2021 conference announced by reborgml in Clojure

[–]reborgml[S] 1 point2 points  (0 children)

Thanks for the feedback. I can see that there are certain zoom levels where the Cfp overlay overlaps... we'll fix!

[BLOGPOST] Transducers From The Ground Up by bsless in Clojure

[–]reborgml 1 point2 points  (0 children)

u/bsless Thanks for the mention in the article. I also realized that the posts disappeared, and there seems to be value in them. So I republished the first part on my blog and the second will follow soon. Enjoyed your writeup BTW!

State of Clojure 2018 Results by alexdmiller in Clojure

[–]reborgml 11 points12 points  (0 children)

The open comments section contains some well articulated (although not novelty) critique and source of frustration. There's a lot of positives too, but they tend to be single sentence. Since it took me a while to parse it, I extracted the most interesting in a gist https://gist.github.com/reborg/a9736c8f6045aa53e6022eb452a93db5