3 ms·
CircleCI uses it - it's great. The upsides are: - the great concurrency model - the REPL - being able to edit with Paredit, - it's a great language - It's
by pbiggar 10y ago
CircleCI uses it - it's great. The upsides are:
- the great concurrency model
- the REPL
- being able to edit with Paredit,
- it's a great language
- It's also amazing for hiring devs: there is a niche pool of devs who want to use clojure, and it's easy to hire them since demand for them is low. (Vs the thousands of Rails companies who are competing for a much larger pool)
- being able to use clojurescript, in particular using Om (we use a pattern which is similar to the Elm Architecture, and it's great for writing frontends with).
The downsides are:
- mostly related to Java. Startup time is shitty (which is why you use the REPL a lot).
- Libraries are often unmaintained (though often it doesn't matter, since they are typically very composable and don't need changing).
- The web framework story is poor too - it's not nearly as advanced as the rails and nodejs worlds - you have to compose different libraries which is sometimes good and sometimes bad.
- Finally, Rails encourages good web-app best practices: you can only really scale Rails horizontally, so you start with queues and horizontal scaling and workers. With Clojure, it's tempting to run things in threads and pools since it's so easy to do. But it scales poorly, and leads to concurrency bugs you wouldn't get in the Rails world.
- chebum 10y ago@pbiggar Hi, Paul! Could you elaborate on poor scaling and concurrency bugs, please? From my understanding Closure's functional nature and immutability should minimize concurrency bugs.
- pbiggar 10y agoSuppose you have a background job you want to run. Clojure has good concurrency, so it's tempting to just run it in the background. OK, now it needs to retry: that's great, Clojure has STM so it'll keep retrying until it succeeds. So you have your process spin off a bunch of threads doing some background stuff. Easy. Now, because you're using AWS, or a new deploy, or something else, the server dies. What happened all that stuff running in the background? Because it was built with clojure primitives, it never got saved anywhere, like it would if you had used a queue and workers. The summary is: Clojure's awesome stuff encourages you to use it, but it's actually a bad pattern for horizontally scalable apps. Rails - lacking the cool concurrency stuff - forces you to have better habits, and makes them easy.