4 ms·
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 b
by yakshaving_jgt 7y 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.
- jaredklewis 7y agoI 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.
- yakshaving_jgt 7y agoHaskellers can and do write tests. +----------+-------+-------+ | Language | Tests | Types | +----------+-------+-------+ | Haskell | Yes | Yes | | Clojure | Yes | No | +----------+-------+-------+
- jaredklewis 7y agoAs I said above, clojure also has a type system. So your chart is yes for both features for both languages.
- yakshaving_jgt 7y agoI 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.
- badsavage 7y agoClojure has something like an extendable type system called Spec. We can create our own types lol
- badsavage 7y agoA great example here: https://news.ycombinator.com/item?id=18776215 https://news.ycombinator.com/item?id=18776215
- yakshaving_jgt 7y agoI 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.
- stingraycharles 7y agoWe 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.
- badsavage 7y agoBasically 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.
- iLemming 7y ago> 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.
- yakshaving_jgt 7y agoHey, 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.
- iLemming 7y agoAlright, 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.