Ask HN: Is Clojure Dead?
41–50 of 145 posts
Re: Ask HN: Is Clojure Dead?
#42Earlier quoted context omitted.
can you clarify "how" it makes one a better developer? When I think of how the java streams API is used, it generates lots of garbage (i.e. lots of intermediary allocs), doesn't always make things clearer.. i'm genuinely curious (and in fact i like the streams API, it's just often misused by collecting at the wrong step..).
I think it helps you better understand how data flows through you program. My input is A, and I need to create D. A -> A', then another function makes B, then another makes C, then another makes D. You can reason about and relatively easily test each of these steps. However, testing in a repl gets quite messy with calls such as h(g(f(x))). In python, you'd need to decorate you functions with an input/output logger.
Re: Ask HN: Is Clojure Dead?
#43Clojure is not dead, the core language is still very strong, but the dev experience has been degrading IME. This is due to a lack of heavy corporate backing and investment, probably by choice. Taking a PL to the mainstream is very expensive. You cannot compare Clojure and Rust in any way as they're completely different design philosophies.
Re: Ask HN: Is Clojure Dead?
#44There are still Clojure jobs and new companies using Clojure.
It is a niche language, and I think it will stay a niche language, but that is fine.
Re: Ask HN: Is Clojure Dead?
#45One benefit of learning functional languages, whether Haskell or Clojure, is that it makes you a better developer in other, non-functional, languages.
can you clarify "how" it makes one a better developer? When I think of how the java streams API is used, it generates lots of garbage (i.e. lots of intermediary allocs), doesn't always make things clearer.. i'm genuinely curious (and in fact i like the streams API, it's just often misused by collecting at the wrong step..).
For example, here's Clojure's implementation of `map`[1]. It internally uses `cons` to build a cell[2] and `map` to recursively walk the collection (but all wrapped up in `lazy-seq` to delay evaluation).
Transducers[3] do help with this if you are applying a stack of collection transformations. But, and this is just my opinion as a very occasional Clojure user, transducers are harder for me to grok and so I generally avoid using them. If I was doing performance critical work, I might try to build up a better mental model.
My biggest complaint about the Java streams API is that it makes it hard to write your own stream transformation functions. Or rather, you can, but then calling them is awkward. You generally transform a Stream by calling instance methods - e.g. `myStream.map(::f)`. But since Java doesn't have extension functions, there's no way for you to make a custom function callable in the same way as the built-in functions. I ended up writing a small shim to build a stream pipeline without using member functions. You would use it something like this:
newPipeline(stream)
.then(map(::mapFn))
.then(filter(::filterFn))
.then(customTransform())
.collect(Collectors.toList());
Contrast that to Clojure, where everything's a function: (into []
(customTransform
(filter filterFn
(map mapFn collection))))
Or (using the threading macro, I think this is right) (->> collection
(map mapFn)
(filter filterFn)
(customTransform)
(into []))
Or (using transducers, I'm really not sure if this is right) (into []
(comp
(map mapFn)
(filter filterFn)
(customTransducer))
collection)
[1] https://github.com/clojure/clojure/blob/2b3ba822815981e7f769...[2] https://github.com/clojure/clojure/blob/2b3ba822815981e7f769...
Re: Ask HN: Is Clojure Dead?
#46Clojure is not dead, the core language is still very strong, but the dev experience has been degrading IME. This is due to a lack of heavy corporate backing and investment, probably by choice. Taking a PL to the mainstream is very expensive. You cannot compare Clojure and Rust in any way as they're completely different design philosophies.
I like Clojure the language but what I found frustrating was that even more than in other ecosystems a package would get momentum, become popular, and then mysteriously die suddenly without any real replacement. A classic example was the statistics package Incanter -- it had the potential to become a new version of Xlispstat for the 21st century and then it just died.
It lacks some polish and has some wierd conventions relative to modern Clojure, but I still use it occasionally.
Re: Ask HN: Is Clojure Dead?
#47Earlier quoted context omitted.
I mean compared to a few years ago. I tried setting up a new project after 1 or 2 years away from the ecosystem, and struggled a lot : all existing templates to set up new projects (esp. with CLJ/CLJS combined) had bitrotten and were not usable out of the box ; emacs integration no longer working out of the box, etc. I think it's a "death by a 1000 cuts"/"broken windows" that is may be happening when the ecosystem la…
I've very recently changed my system from MacOS to Linux, so I've been reibuilding my Clojure environment from scratch. I've found the exact opposite in terms of maturity; Emacs support in particular is far more complete and usable out of the box than it ever was. I installed Spacemacs fresh, loaded up a Clojure file, and not only did I get automatically get CIDER, but I also got LSP support via clj-kondo and a bunch…
What I am kinda saying is that Clojure would be in a better place if it was paying people like you a lot more!
Re: Ask HN: Is Clojure Dead?
#48So -- it's a niche for sure, but a very successful niche, and one that many people are very happy in. There aren't a ton of jobs out there relative to, say, Python, but there are also fewer people competing for those jobs, so it works out fine for individuals. It can be tricky to find your first Clojure job, but I think that's true in most languages.
I plan to stick with it for the foreseeable future, because there's no other language that I like nearly as much, or can be nearly as productive in.
Re: Ask HN: Is Clojure Dead?
#49Except, just for kicks I add Golang, and it turns out that all of the above are marginal compared to Go[1].
HN posts are very different from general interest, but yeah, I'd go with "Clojure has sadly missed on its shot to become a popular general-purpose language" rather than "Clojure is dead," but your instincts seem right.
0. https://trends.google.com/trends/explore?date=all&geo=US&q=%...
1. https://trends.google.com/trends/explore?date=all&geo=US&q=%...