Re:ICFP '09: "Get rid of cons!" Guy Steele on parallel algor...
by tsally on Thursday September 10, 2009 @02:39PM
(#815862)
Ah yes, a silly mistake on my part. I am hoping that eventually Clojure will help the programmer write parallel algorithms, but you are correct in that such constructs don't exist in the language at this moment.
Re:ICFP '09: "Get rid of cons!" Guy Steele on parallel algor...
by richhickey on Friday September 11, 2009 @03:22PM
(#817941)
Like this?
http://github.com/richhickey/clojure/blob/26f5aed73c9cc2959b...
http://paste.lisp.org/display/84027
It's coming,
Rich
If your program is divided into threads, having a language like Clojure that makes concurrency easy and lock-free is a wonderful thing, and of course you get some benefit from running on multiple cores, though I don't think that's entirely the point.
If, on the other hand, you're looking for a faster way to map a function across eight million lines in a flat file, using Clojure's map function won't magically make your program run faster (and pmap might not run at all -- you may run out of memory, since pmap isn't truly lazy).
The fact that a Clojure PersistentVector (not a PersistentList) is implemented with a 32-way tree (not 64-way) does not imply that Clojure has abandoned the car/cdr paradigm in favor of conc lists -- it still uses cons, in a more generic form, but still with the same first/rest concept. The trees allow vectors to be inexpensively persistent, so you can have actual practical immutable vectors.