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 :)
@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.
Interesting. I guess I conflated compiled and analyzed 🙂
@slipset Iterators in Java are also one shot right
It's the clojure seq abstraction on top which caches things
Jupp, and it doesn’t make sens there either.
I guess you solve the retaining-head problem when you have one-shot iterators.
yeah, I think it's performance related. Maybe there are seq-like caching abstractions on top in Java as well?
Here is a Java implementation: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L516-L529 ;)
They solve different problems :). Iterators are great for performance. Lazy seqs infamously are trouble for high performance code.
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
Morning
Morning
Evening
Morning