Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Off-topic: I want to learn a functional programming language, and I was thinking to go with Scheme (because, you know, SICP...) Would there be any advantage for me to go with Haskell instead?



Scheme and Haskell are very different languages. Both are functional, but that's about where the similarities end. Scheme is impure, haskell is pure; scheme is strict, haskell lazy; scheme is dynamically typed, haskell static; all functions in scheme are variadic, all in Haskell are unary; etc. So it depends on what you're looking for, and what you're trying to use it to do. That said, here are some advantages of Haskell:

1) Speed. Haskell binaries are highly optimized and tend to be very fast.

2) Correctness. Haskell's type system is far more advanced than any other language with as much or more usage, and is very good at preventing runtime errors. (and can go a long way to preventing logic errors). Also, its purity prevents huge classes of bugs.

3) Interesting: Haskell introduces a lot of new concepts which can really open up your understanding of computer science. It's a lot of fun.

4) Forward-looking: many of the ideas introduced or popularized by Haskell, such as pattern-matching, type classes, no null pointers, etc, are manifesting themselves in the new languages these days (such as Rust and Swift). Haskell itself is also (slowly) making its way into industry. Learning Haskell, in some ways, exposes you to the "next generation" of languages and programming techniques. I'm not sure the same can be said of Scheme, which tends to be used pedagogically more than as a means to push the envelope.

Then again, I know Haskell a lot better than I know Scheme, so maybe I'm biased. But at least, it gives you something to think about.


Thanks.

By training I am not a computer scientist, but an applied mathematician, so it is a little difficult for me to make judgement calls on things like type system, lazy evaluation, unary/variadic (don't even know what that means). I am interested in AI (machine learning) and statistical inference. I was looking at Lisp/Scheme because I know that AI needs gave birth to Lisp. Plus you have newer things like Church[1] that extends Scheme to deal with probabilistic models.

[1]http://projects.csail.mit.edu/church/wiki/Church


Perhaps, but it wouldn't hurt to pollute your mind with SICP first. At least watch the Abelson/Sussman videos (an accelerated version for HP employees); the audio sucks on a couple of them (I mean, in a couple of the lecture videos the audio sucks with much greater force than it sucks in the rest of them, but it's still not quite as bad as Feynman's Robb lectures), but it's a small time sink for a lot of enlightenment.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: