Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, it's not interesting.

I use Clojure a lot at home and work. I'm an active participant in the community. I've also discussed core.typed with Ambrose to my satisfaction.

If you do Clojure web development, there odds aren't terrible you're using a library I've either made or worked on. (Korma, lib-noir, Selmer, luminus, Revise, bulwark, blackwater, trajectile, clj-time, brambling)

https://github.com/bitemyapp?tab=repositories

I'm tired of tracking down type errors in Clojure.

I'm tired of increased source->sink distances in runtime errors compared to compile-time errors.

I want to be able to refactor my code fearless, period, end of story with static assurances.

Record (product) types handle statically verifying schematic use of data. I'd rather have that work statically so that I can minimize source->sink distance. That obviates the need for a "schema" library.

I'm a very active Clojure user, I end up having to explain the same things over and over as to why I'm moving my stuff over to Haskell.

The most thorough way to go is to do what I did and just learn Haskell to decide for yourself. Don't try to paper over the problems with 1/4 solutions.




What you're saying makes a lot of sense. Clojure has a lot to recommend it (especially the JVM, in business) but there are a lot of benefits to Haskell.

The "source->sink" problem is a pain, I agree. It's one of those dangers of macros and metaprogramming that seems to be difficult to resolve. Generally, I only run into nastiness there, though, when I'm trying to do things that would be very hard to do in statically-typed languages.

What I've noticed in Scala and Ocaml is that people end up hacking the compiler (see Jane Street's "with sexp" and "with fields"). That, to me, has all the negatives that come from macros and dynamic typing. A compiler that does static typing is great, but if it ends up being hacked, then all bets are off and I'd rather use macros. (I'm playing Devil's Advocate here; I know that most web apps aren't going to require compiler hacks, but most companies, given enough time, will find reasons that they need to hack the compiler.)

I'm curious about your experiences with Haskell. What negatives have you found in the language? (I like it a lot, but haven't used it for anything big.) How strong is the story for the web? What are the build tools like; are they mature, or obviously in need of work (as in, say, Ocaml or Scala)?


>would be very hard to do in statically-typed languages.

I doubt these things apply to Haskell, which is part of my point. It offers a lot of rope for the self-hanging if you want, but the defaults (static, safe, strong, immutable, pure, lazy) are the best place to start.

There are a hundred things people think "only dynamic languages can do" that you can do in Haskell.

I have yet to get anybody to contrive something you can't do in Haskell that you can in other languages.

This is a mere glimpse, but should give you an idea:

http://hackage.haskell.org/package/base-4.6.0.1/docs/Data-Dy...

^^ Uni-typed languages are a subset of proper type systems. This is a practical application of that idea.

You don't generally hack GHC unless you're an enthusiast, although that option is certainly available to you and it's much easier than you'd expect.

Negatives? More people using it would improve library coverage, but the libraries are very good. The web story is better than Clojure. Scala web vs. Haskell web entirely and utterly depends on whether you're happy with Scala's Play Framework or assorted uber-micro-frameworks. If you're not and would prefer a more diverse and componentized ecosystem of libraries, Haskell's is better. You can go whole-hog with a single framework like Snap or Yesod, but their individual components are eminently reusable libraries. Yesod even checks the damn URLs in your templates at build-time.

The interactive workflow in GHCi is legitimately better than Clojure's. I'm not exaggerating. It's not as good as the glory days of Common Lisp + swank + Emacs, but it's better than Clojure + Emacs + nrepl.

Bonus? Has a fucking debugger - unlike Clojure.

Native binaries, multiple quality vector libraries that support CUDA. Burgeoning but respectable family of bioinformatics libraries.

Negatives? Forces you think and learn. There's a ramp-up time, but the other side of the first hump or two has some pretty serious leverage. Doesn't have the library diversity of Perl or Python, but the building blocks are incredible (Parsec, attoparsec, Aeson, etc).

Another negative? You'll have even less patience with poorly designed static languages.

It's worth noting that I'd sooner use Clojure than OCaml, but I'd sooner use Haskell than Clojure.

I don't fetishize type systems in general, I just really find Haskell very pleasing and productive.

The build tools are mature and quite nice now that Cabal has sandboxing built in by default. Put it this way, I don't cringe at all when I use cabal the way I did with Scala's sbt.

Another difference between Haskell and Scala is that it uses a relative conservative core augmented by potentially unsound/unsafe augmentations like GADTs. http://en.wikibooks.org/wiki/Haskell/GADT

What this helps with is it means you only have to think about the "core" of the language at any given time, but if somebody is using magic like Template Haskell (macros), you get that documentation in the form of a pragma at the top of the file. I quite like it.

The laziness is also important, it obviates the need of 80-90% of how macros get used in languages like Clojure. It makes functions themselves more general and useful.

Another negative? A sufficiently "specialized" application of Haskell might mean you're on the frontier. But the same is true of Clojure. I don't find that really matters nor do I find the situation truly improves by using something like Java or Ruby.

I'd rather just read a white paper, sip tea, think, and then sit down to write the code in a language that won't waste my time.

I would add that Haskell's sweet spots extend from Java -> Python -> Clojure. I wouldn't use it for systems programming - for that I'd use Rust.


I wish I could give this more than 1 upvote. Really good response.

My Haskell experience is a few years out of date (and not as deep as my OCaml knowledge) but it sounds like the language has advanced pretty far.

I'll still be using Clojure for the next 3-4 years (my company uses the JVM heavily, and Clojure still beats Scala IMO) but I'll have to look into the current state of things in Haskell.

Out of curiosity: what were your experiences with OCaml, and why didn't you like it?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: