News for hackers. Stuff that matters.
Re:Pixie – A small, fast, native Lisp by DannyB2 on Tuesday January 17, 2017 @04:13PM (#13421246)
I'll give you another. Laziness. It's built in. It's trivial to create lazy lists that generate their contents as you walk down the list. Even infinite lazy lists. The list of all prime numbers. The list of all fibonacci numbers.

You can use map, which if I remember my CL, is like MAPCAR. But instead of map, you can use pmap which will do the processing on all of your cpu cores.

Re:Pixie – A small, fast, native Lisp by junke on Tuesday January 17, 2017 @04:26PM (#13421376)
pmap in CL is one library away, along with preduce, ... (https://lparallel.org/).
Re:Pixie – A small, fast, native Lisp by DannyB2 on Wednesday January 18, 2017 @04:16PM (#13430358)
Is it lazy?
Re:Pixie – A small, fast, native Lisp by junke on Thursday January 19, 2017 @05:12AM (#13434573)
Of course not, lazy is opt-in in CL, that wouldn't be idiomatic.

Besides, the semi-lazy approach of Clojure's pmap (allocate futures consecutively) doesn't seem to convince everyone:

https://stackoverflow.com/questions/2103599/better-alternati...

https://www.reddit.com/r/Clojure/comments/20lxmv/just_what_i...

On the one hand, when you want to parallelize, you are delegating tasks to workers and you want them to do what they need, independently of you. But on the other hand, laziness introduce a dependency from you, because workers cannot produce a result before they are sure you really need it. This basically slows down parallelization and that's why I am not sure Clojure's pmap is a good general solution.

Note that Clojure Reducers, mentioned here in Zombie Metaphysics (ppmap: http://www.braveclojure.com/zombie-metaphysics) and documented at https://clojure.org/reference/reducers, use strict sequences.

Laziness is great when you need it, but when you don't you shouldn't have to pay for it.

http://clojure.com/blog/2012/05/08/reducers-a-library-and-mo...