Ask HN: Clojure vs Go

7 points by clubhi ↗ HN
I'm really wanting to get proficient in one of these languages.

I'm a fan of python. Go is really attractive to me for this reason. I feel like it is a language that I could really love.

Clojure is still a bit alien to me. I've gone through tutorials and have built small dummy programs. I feel like this language can make me improve more as an overall programmer. However, I am still skeptical if it will benefit me as much as go.

I'm attracted to both languages because I'm trying to improve on my knowledge of concurrent/parallel programming.

Any reasons to choose one over the other as my next language? For reference I feel like I'm proficient in Python/Java/JavaScript/C++.

3 comments

[ 4.0 ms ] story [ 19.9 ms ] thread
If you are proficient in Python/Java already. There is no reason for you not to choose a Lisp language. Clojure is a good choice.
In my mind Clojure is an easy win unless you're writing short running things that need to boot fast (though you could consider clojurescript + node for that).

Both languages have good support for concurrency, but for me Clojure has much more going for it:

- It's fast, and has all the tooling and libraries from the JVM - it has immutable datastructures with literals for all of them) by default, this is huge, they're probably the thing I miss most when I have to use other languages. - It encourages functional programming very strongly, but has excellent support for managing mutable state when you need it. - It's very simple (it's a lisp) and has a very small number of primitives, with much of the standard library coming from macros rather than actually being baked into the language. - The community is amazing, #clojure on freenode is incredibly helpful and friendly towards noobs.

I probably don't sell it well, but I'd highly recommend watching some of Rich Hickey's talks to sort of understand the philosphy that goes into Clojure:

http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hic...

Don't go for Go just because it's familiar ;)

If you are attempting to learn about concurrent programming I think using python is you're best bet (initially) because it provides a "low signal to noise" which best demonstrates some of the common pitfalls concurrent programming promotes as well as some of the solutions. (such as those found in the python wiki) [http://wiki.python.org/moin/Concurrency/Patterns].

Understanding the problems then allows you to make a better choice and understand some of the choices made for you by the language designers, such as why does Clojure use STM and promote immutability? Are actors/goroutines/coroutines the same thing? What is so good about this reducers library? etc. etc. Linking the dots and the "ah ha!" moments will help you make your choice and understand more about why the tool might be a greater asset than the other.

In short: Understand the problem before solving it. (or use the hammer for nails and screwdriver for screws)