News for hackers. Stuff that matters.
Re:Ask HN: On Rob Pike's Concurrency is not Parallelism? by gruseom on Sunday July 29, 2012 @02:19PM (#4309240)
Erlang and Clojure don't have threads in the common meaning of the term (http://en.wikipedia.org/wiki/Thread_(computing)). They are reactions against programming with threads.

You can expand the term "thread" to mean "concurrency in general" but even then it isn't true that the main purpose of writing concurrent code is clarity. When people say "look at this concurrent program I wrote" they rarely [1] say "look at how well the code expresses the problem". What they overwhelmingly say is "look at this benchmark".

[1] Joe Armstrong talks about how Erlang lets you represent processes more like they happen in the real world. But that's a niche view. Most people think about concurrency as a platform issue, where the platform is multicore hardware or distributed systems, and otherwise wouldn't bother with it.

Re:Ask HN: On Rob Pike's Concurrency is not Parallelism? by arohner on Sunday July 29, 2012 @07:12PM (#4310096)
Clojure absolutely has threads, in the common meaning of the term. I use futures all over the place in my code, and it's quite idiomatic.

(future (do (foo 1) (bar 2)) Runs the expression on another thread. Futures intentionally compose well with the built-in clojure concurrency tools.

Clojure has no dislike of threads. It scorns locks, and code that is safe in one thread, but unsafe in multi-threaded situations.

Re:Ask HN: On Rob Pike's Concurrency is not Parallelism? by gruseom on Sunday July 29, 2012 @07:35PM (#4310168)
Ah, thanks for the correction and teaching me something.
Re:Ask HN: On Rob Pike's Concurrency is not Parallelism? by aphyr on Monday July 30, 2012 @12:42AM (#4310951)
Erlang and Clojure are multithreaded. Clojure offers full access to Java-style (Thread. (fn [] ...)), j.u.c Executors, and Clojure-specific threadpools for agents and futures, including differentiation between CPU and IO intensive threads. Erlang's scheduler is also threaded, though its threads aren't 1:1 with pthreads. That's fairly common: plenty of libraries and languages map green threads to physical threads for highly concurrent programs.