clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
slipset 2020-11-28T08:38:04.154800Z

While y’all were out watching trees I was dabblintwith some Python code. Couple of thoughts: paredit combien with everything is a sexp is Clojures killer feature for me. I’m sure you can do all kinds of nifty thing given a language and a great IDE, but still... Secondly, generators in Python are one-shot. Once you’ve consumed a generator, it’s empty, so you end up with stuff like (into [] (map ...)) all over the place. And there is no error on consuming an exhausted generator. Although there is a Python-mode in emacs that works nicely with ipython (given some tweaks), the REPL experience is quite inferior to Cider. Lastly, it’s not a compiled langage, so misspelled symbols are only caught when the code is executed. Which kinda sucks if your code is branchy, since it’s hard to execute all combinations of all branches. Plus, it’s slow :)

borkdude 2020-11-28T08:51:49.155300Z

@slipset > Lastly, it’s not a compiled langage, so misspelled symbols are only caught when the code is executed. Babashka scripts are also not compiled, but it catches this.

slipset 2020-11-28T08:52:44.156Z

Interesting. I guess I conflated compiled and analyzed 🙂

borkdude 2020-11-28T08:53:58.156300Z

@slipset Iterators in Java are also one shot right

borkdude 2020-11-28T08:54:14.156800Z

It's the clojure seq abstraction on top which caches things

slipset 2020-11-28T08:54:18.156900Z

Jupp, and it doesn’t make sens there either.

slipset 2020-11-28T08:54:40.157400Z

I guess you solve the retaining-head problem when you have one-shot iterators.

borkdude 2020-11-28T08:55:19.158100Z

yeah, I think it's performance related. Maybe there are seq-like caching abstractions on top in Java as well?

borkdude 2020-11-28T08:58:37.158300Z

Here is a Java implementation: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L516-L529 ;)

dominicm 2020-11-28T09:36:36.161600Z

They solve different problems :). Iterators are great for performance. Lazy seqs infamously are trouble for high performance code.

borkdude 2020-11-28T09:50:36.162400Z

I would say they solve similar problems but they are different levels of abstraction. The low level abstraction is needed by the higher level one, but both should be accessible by the programmer

jasonbell 2020-11-28T11:29:36.162600Z

Morning

2020-11-28T15:15:51.162800Z

Morning

2020-11-28T15:54:02.163Z

Evening

borkdude 2020-11-28T15:54:27.163200Z

Morning