Fork me on GitHub
#clojure-europe
<
2020-11-28
>
slipset08:11:04

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 :)

borkdude08:11:49

@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.

slipset08:11:44

Interesting. I guess I conflated compiled and analyzed 🙂

borkdude08:11:58

@slipset Iterators in Java are also one shot right

borkdude08:11:14

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

slipset08:11:18

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

slipset08:11:40

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

borkdude08:11:19

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

dominicm09:11:36

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

borkdude09:11:36

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