Hacker News new | past | comments | ask | show | jobs | submit login

I'd say Clojure. Clojure is very small (Scala seems quite complex).

The concurrency support is fantastic. I've never really had the patience to understand programming for multiple processors in other languages because of the complexity of locks. Clojure has lockless concurrency (via STM)- writing applications which take advantage of multiple processors is trivial!

The following shows easy it is to split work between two cores (if you have them). This code counts to 250,000,000 but does so on two separate threads. It takes half the time of performing the operation on a single core.

(def agentA (agent 0)) (def agentB (agent 0))

(defn my-inc2 [v] (loop [x 0 result v] (if (= x 125000000) result (recur (inc x) (inc result)))))

(defn split-my-inc2 [] (send agentA my-inc2) (send agentB my-inc2) (await agentA agentB) (+ @agentA @agentB))




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: