This is confusing the difference between concurrency and parallelism, the latter of which Clojure doesn't yet address.
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.
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.
Comments
This is confusing the difference between concurrency and parallelism, the latter of which Clojure doesn't yet address.
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.
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.
Like this?
http://github.com/richhickey/clojure/blob/26f5aed73c9cc2959b...
http://paste.lisp.org/display/84027
It's coming,
Rich
sweet. Another incf for Clojure.
Is there auto tree balancing?
Just saw your reply. That's kickass.