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

>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: