Hacker News new | ask | show | jobs
by yakshaving_jgt 2496 days ago
Clojure is one of the better dynamic languages.

The rub however is that GHC can check the consistency of my software faster than I or my colleagues will ever be able to, and programmer time is expensive.

So that's why not Clojure.

2 comments

> and programmer time is expensive

That's why you need to spend 3 years learning Haskell? I feel that's the right amount of years for an average Joe programmer to reach meaningful productivity with the language. Well, maybe I'm exaggerating, maybe it's just two years. Plus/minus another year to learn and understand compiler pragmas.

Hey, I won’t deny that it takes a relatively long time to learn Haskell to a standard where you’re comfortably writing web applications with it.

I’m not sure how that’s a rebuttal to my point though.

I run a startup. I’ve already put the time in to learn the technology. I’ve learned other technologies too. This one happens to be the one I find the cheapest (now) to write. Did it take my employees a long time to learn Haskell? Maybe! But I didn’t pay for that. They learned the technology for whatever reason, and I’m seeing far better returns on my investment than I think I would have if I hired a bunch of Clojure developers. My previous full-time gig was at a Clojure startup. Their pace is pretty atrocious compared to the pace of my current team.

Alright, jokes aside, let's not get into "measuring dicks" and argue which one is better. I know Clojure, and I know some Haskell. I love both. They both have their strengths and weaknesses. To be honest - I always find things in one that I wish existed in another and vice versa.

But your simple dismissal of Clojure (even though seem to be an educated one) has no merits. Don't feel bitter because Clojure is growing in popularity (in relative terms) and Haskell seems stagnated. Haskell is an older language and has had its ups and downs, and I think it will be fine. Clojure as well - no matter how aggressively haskellers would evangelize against it, it will continue to grow steadily. Think of it as a gateway drug into Haskell. I know people who jumped that way, and I know people who went the other way - from Haskell to Clojure.

To me, it is like using headphones - some prefer wired ones, some people enjoy wireless, even though audio quality suffers, wireless gives them a lot of freedom and might be viewed as a "more practical choice." To that though, proponents of wired might say: "what if the battery dies?". It is an endless and quite pointless debate. So let's concur: Haskell is great, and Clojure is fantastic too.

> But your simple dismissal of Clojure has no merits.

I believe it has an impact on my business' bottom-line. Saving money in business is a merit.

> Don't feel bitter because Clojure is growing in popularity and Haskell seems stagnated.

That… was an odd take. I'm not sure what gave you the impression that I would be bitter about Clojure growing in popularity (not that I think it is, anyway). I have nothing invested in Clojure not being a popular language, and the idea that Haskell has stagnated is a little hilarious.

> Haskell is great, and Clojure is fantastic too.

Again, I have never denied Clojure's merits. My position is pretty simple — I have found it cheaper to build Internet software businesses with Haskell than with Clojure.

I wonder which is more closer: 3years or "a week or two" to learn enough haskell to start writing things with it.

At least for OCaml/ReasonML it was "less than a week" for me and Haskell is probably not that much harder than another ML.

No, you cannot realistically learn Haskell in two weeks and jump into industrial Haskell codebase. I mean, it is not impossible - I just never heard such stories. If that was as easy as you think it is - Haskell would be much, much more popular. It is an amazing language. And probably the only point of criticism you can think of is exactly that: it takes quite some dedication and time to grok it.
I don’t think the only alternative to Haskell types is manually checking your program for consistency.

For one thing, Clojure has type analysis: spec. Also, as pointed out in the article, you can also write tests.

Haskellers can and do write tests.

    +----------+-------+-------+
    | Language | Tests | Types |
    +----------+-------+-------+
    | Haskell  | Yes   | Yes   |
    | Clojure  | Yes   | No    |
    +----------+-------+-------+
Clojure has something like an extendable type system called Spec. We can create our own types lol
I am quite familiar with Spec. In my few years of professional Clojure experience, working with people who write Clojure every day, and enjoy it, and advocate using things like Spec, I have never actually seen anyone do it successfully in practice.

I understand the idealist world view is seductive — we'll be discipined, we'll write the tests, we'll make good use of Spec, etc etc.

In reality, I have never seen this happen. Humans are lazy and undisciplined, so that's what I optimise for.

We use spec a lot, using orchestra’s defn-spec combined with expound for improved error reporting.

It’s not a type system, but it’s very concise and easy to add validations to important functions. This removes the “lazy and undisciplined” part of the equation.

Basically you says if a type system is optional, people tend not to use it, because most of the times they are good without it.

I agree.

But we do use spec very successfully for complex data structure validations and example data generation.

As I said above, clojure also has a type system. So your chart is yes for both features for both languages.
I had taken it for granted that when someone says a language "has types", they mean it is statically typed as opposed to dynamically typed.

This is also made obvious by the idiomatic use of each technology.

So, no. My little chart is correct.