Why do you prefer Clojure over Haskell?

Hello,
This may look like another post about “which language should I learn x or y?” but it is not.
I’m learning Haskell and I’m learning Clojure, and I want to learn both, the decision is already made.
What I’m looking for is for real reasons of people preferring Clojure over Haskell.
I don’t want to start a comparison between both languages, that is not my intention, I want feelings, subjective opinions, all kind of answers.
Something like “I like parenthesis” it’s a legitimate answer (in fact that is one of my reasons to like Clojure).
So feel free tho express your feelings no matter what they are, I want to hear from other people’s hearths

For me its clearly the tooling and the backing by all the java libraries available.
Haskell lacks in both of these disciplines massively compared to clojure and everytime I give it another try I wonder, why should I go through all the hassle if its much easier to develop with clojure?
I dont find a reason so I stay with clojure.

2 Likes

Thanks for your answer.
I have been relatively short time using Haskell, but I find the tooling good enough. What are you missing exactly? Feel free to compare it to existing Clojure tools

Its been some time, but a few that I remember very well were

  • No IDE that is comparable to what is available for clojure. I am excluding emacs specifically here, as I dont have the time to learn emacs
  • The REPL experience is not comparable and not as easy to setup, or at least I could not figure out how to do that in the context of a project I am working on.
  • Nothing comparable to clojurescript
  • DB access libraries

The first two are a dealbreaker for me already.

The last time I tried it was when stackage was on the rise, so maybe things are different right now, but I wont even try it if there is no other IDE available than emacs.

Also, to not sound to negative, I remember the community being very helpful and also the docs most of the time were very good, but thats not enough for me.

Is curious how your past experiences can influence our likings. For most of my life the languages I liked to program in usually lack a good ide, and I get used to work in lightweight but advanced text editors, so the lack of an IDE is something I just accept naturally.
Also my experience with Haskell and Clojure seems to be exactly the opposite as yours, it was very easy to setup Haskell and properly use repl and tools than ClojureScript, which took me literally days.

Any place to point me out? Something like this forum but for Haskell. Also if you know anything like slack I’ll be very grateful too.

Thank you for sharing your point of view, exactly what I was looking for

Disclaimer: I’m only an amateur Haskeller, but I use Clojure professionally at work.

The fact that Clojure gives you full access to all of the JVM eco-system, with its rich tools like visualVM, JMX, mission control, as well as Java’s infinite set of libraries and frameworks.

The fact I can then pivot to running on JavaScript hosts when needed.

Lisp syntax. I just love it. The homoiconicity, the simplicity, the consistency, and off course the way it enables me to forever extend it easily with the use of Macros.

Live programming. The instant gratification of seeing your program run as you code it, with the tight REPL integration and everything being reified and having the ability to be redefined live. I find it more like jamming to an instrument, while Haskell gives me the feeling I’m composing on music sheets.

I’m not a fan of being restricted to only use lazy constructs. I find they sometime make things harder to reason about or debug.

Static Typing overhead. Always having to think about types, and their definition, its fun, but I’ve never had a lot of type induced bugs in practice in Clojure, so I’d rather spend my time thinking about other aspects of my program.

Finally, I think I find the purity compromise of Clojure to be more practical. Monads for side effects work well, but it confuses me more. I’d rather know that I’m just breaking purity to have side effect and control it myself how I want.

9 Likes

Any place to point me out? Something like this forum but for Haskell. Also if you know anything like slack I’ll be very grateful too.

No, unfortunately not, slack was not even a thing back then.

I just spent an hour doing a fresh install of stack on windows and starting a yesod project with postgres template.
I encountered two errors, related to postgres and they were easy to fix, I would guess it is even mentioned in the docs, but I did not read them.
Overall yesod + stack has come far in the last years and I am positively surprised.

Also there is a intellij plugin now which I got working so that I at least have code highlighting. It supports more, but I dont have the time to fiddle around with it. So its not the “everything just works” experience yet in regards to the IDE.

If it would have been like that 4 years ago could be that my private project stack was haskell + elm, I have to admit.

1 Like

Are you expecting to have a very short career?

4 Likes

I prefer prefix notation and languages with relatively little syntax, and I do not like starting from type signatures as much of what I do involves exploratory programming in which I discover the types through experimentation.

4 Likes

Are you expecting to have a very short career?

Ok, there is some information missing in my statement. The value of learning emacs does not justify the time needed to learn emacs.
I always preferred vim anyway so I find my way around the console if I have to.
Also I dont see any area that I work in where there is no other IDE that is superior to emacs.

2 Likes

haskell: Think function first.

Clojure: Think data first. (Clojure is designed for writing databases.)

Me: Think PurefunctionPipeline&Dataflow First. For me, programming is the process of designing a data model that is simple and fluent in manipulation. More than 80% functions of my project is threading macro code block, each step is simple, verifiable, replaceable, testable, pluggable, extensible. The Clojure threading macro provides language-level support for PurefunctionPipeline&Dataflow. For other important reasons, the JVM is ecologically powerful and clojure syntax is simple.

Rob Pike: Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.

Linus Torvalds: Bad programmers worry about the code. Good programmers worry about data structures and their relationships.

3 Likes

I am also a Data-first oriented programmer. After years of programming I came to the conclusion that I don’t like java and other overly verbose languages because I like to think on my code like pipelines for data transformation. However, that does not mean that I think that data should dominate development, It’s just how my brain works, I’m sure that there are several persons whose brains works exactly the opposite.

Yes, those are very good quotes. However, I don’t see any justification about why they are right or better than the opposite. Don’t get me wrong, I agree with them, but I don’t usually see the reasoning behind that.

I started to see haskell more appealing after reading about the mysterious tuple problem which I suffered many times while doing FP. I think clojure suffers from this problem too, and that’s why I am seeing haskell appealing. They have a type system, that’s true, but that does not mean that you have to think about functions first. I mean, you can think on data, then the functions that operates on that data, and thanks to the inference type system you can defer types until the last part of your development workflow.
I don’t have much experience with haskell, so I may be absolutely wrong.

You’re definitely an open mind person. I didn’t expected you to try haskell just to check my assertions. However, this explains why your experience an mine was so different, we tried Haskell on very different points of its history.

@sveri notepad++, conemu, lein is very good IDE.

notepad++, conemu, lein is very good IDE.

Thanks, I am perfectly happy with cursive.

2 Likes

You’re definitely an open mind person. I didn’t expected you to try haskell just to check my assertions. However, this explains why your experience an mine was so different, we tried Haskell on very different points of its history.

Thanks, I just try to learn something new if I have the time and haskell offers a lot to learn as far as static typing goes.
It made me curious that you said you had the opposite experience.

I’m currently learning Haskell, about 2/3 into Haskell Book. I’m doing this mostly to learn something new, not because I’m discontent with Clojure. I’ve been doing Clojure for years now and it’s my dayjob, so it’s nice to do something else now and then.

One thing I like better about Haskell is the fast startup time. It’s a really good language to write scripts in.

I haven’t made any big projects in Haskell so I can’t give a fair comparison to Clojure in that regard.

1 Like

I’m not sure I see this pattern in Clojure at all. It seems the article’s complaint related to Clojure is only that of lacking static types. Otherwise the tuple handling is similar to Python or JavaScript.

In Clojure maps and vectors are both used extensively as records. Lists are almost never used for representing data. I only see lists used for representing code. Variants are actually quite popular. Destructuring is often used to label input tuples. And now Spec fills the gap of the missing documentation that types would normally add. And records are used when performance matters.

That said, its true that even in Clojure, compared to statically typed languages, or OO languages where every piece of data is represented in a custom object type, it can be harder to figure out what is what. I think beginners suffer from this a lot. I did when I started. You eventually learn how to manage it, but there’s a hump.

1 Like

Clojure is only a database in a high-level language, or Clojure is a database-oriented language. Using database theory is easier to understand clojure than using FP theory.

Clojure’s biggest advantage: it manipulates data simply and smoothly.

Before using Clojure, I was a FoxPro (Best Desktop Database) programmer. Clojure is a Super FoxPro using LISP syntax.

In the last 8 years, I wrote only Clojure, and wrote nearly 100,000 lines in total.

Getting cljs repl setup is much more difficult than Clojure though, and Clojure isn’t Clojurescript. So that seems like a red herring.

If you’re comparing apples and apples, you’d ask ‘how easy is it to setup a GHC.js repl?’.

2 Likes