Live data from Hacker News

What was your "ah ha" moment with Haskell?

reddit.com

21–30 of 61 posts

Re: What was your "ah ha" moment with Haskell?

#21
post #17

Earlier quoted context omitted.

Would that downvotes interested me... To your questions: OcaML: seems like a hack-ish [S]ML. There's a nice comparison between SML and OcaML here : http://adam.chlipala.net/mlcomp/ . I like SML's syntax, but OcaML made it too easy to be imperative and seemed too hackish. Most of the OcaML I've seen looks like weird C, but written in OcaML because it's F4ST3R. F# : I run Linux... next! Scala* : I can't stand it. I use…

> F# : I run Linux... next! I feel your pain. The other thing that bothers me is that Mono developer(s?) have been extremely bone headed about tail recursion. Hey guys if you are reading this, sorry about the tone, but that needed saying. John Harrop can be quite a troll but he is right in calling Mono out on this. Their incorporations of futures and promises is indeed an attraction though. But then we only have a no…

Where do you get the impression that Microsoft's promise is non-binding?

Microsoft's official FAQ on their Community Promise explicitly states that it irrevocable and legally binding [1]. I have previously read complaints that the promise doesn't cover enough of the .NET libraries among other issues [2], but I was not aware until now of anyone claiming that it is non-binding.

[1] http://www.microsoft.com/openspecifications/en/us/programs/c...

[2] http://www.fsf.org/news/2009-07-mscp-mono

Re: What was your "ah ha" moment with Haskell?

#22

I studied haskell at university, but there was very little explanation of why it would be useful or the fundamental difference between it and a standard iterative language (or maybe there was and I skipped that day). At that point I assumed it was simply a language invented by academics in order to torture undergrads. It wasn't until a bit later and playing around with things like python and Javascript and using clos…

> Now when I go back to Java I often get frustrated and the amount of code I have to write simply to work around the fact that functions are not first class objects. Frankly, I've mostly gotten over Java's lack of first-class functions and just make do with the boilerplate involved with regular for-loops or with anonymous implementations of interfaces that are just stand-ins for functions, etc. What I really struggle…

Remember, Maybe and Either are not language features in Haskell, but rather library features! Java is totally capable of hosting them. (Though, there isn't any special syntax for tuples in Java).

Re: What was your "ah ha" moment with Haskell?

#23
post #12
post #4

My "ah ha" moment with Haskell was when I ragequit for the 23rd time and decided that Haskell is probably not for me.

That also what I did when I realized that the "return" function isn't actually for returning values. But then I came back for the 24th time and got hooked. Now Im doomed forever.

:) What an unfortunate function name. But "pure" isn't much better...

Re: What was your "ah ha" moment with Haskell?

#24

Earlier quoted context omitted.

> Now when I go back to Java I often get frustrated and the amount of code I have to write simply to work around the fact that functions are not first class objects. Frankly, I've mostly gotten over Java's lack of first-class functions and just make do with the boilerplate involved with regular for-loops or with anonymous implementations of interfaces that are just stand-ins for functions, etc. What I really struggle…

Remember, Maybe and Either are not language features in Haskell, but rather library features! Java is totally capable of hosting them. (Though, there isn't any special syntax for tuples in Java).

Yes, but without pattern matching and a do-like syntax sugaring they are close to useless, unfortunately.

Re: What was your "ah ha" moment with Haskell?

#25

My "ah ha" moment with Haskell was after a few years of using it quite regularly, I realized that it wasn't actually making me more productive in the kind of code I actually write from day-to-day. It's a lovely language and I wouldn't discourage anyone from using it, but for my purposes I realized it was more exciting than useful at some point, and after that I haven't been back to it as much.

Agreed. It's so beautiful, but so constraining. I'm a much better developer for having used it, but returned to Python/Ruby/Java[for-speed] after spending lots of time with Haskell. That said, I desperately miss static-typing and Hindley-Milner type inference... I keep searching for the perfect language.

Could you give a concrete example that shows why Haskell is constraining?

Re: What was your "ah ha" moment with Haskell?

#27
post #20

I have yet to have my big ah-ha moment for how to do what I do (scientific computing) in Haskell. I recently found myself needing a proof-of-concept implementation for solving a bunch of big tridiagonal matrices in parallel using MPI. I thought to myself "here's an opportunity to use Haskell!", but I must confess I'm rather stumped for how one goes about allocating some memory, banging on it, communicating a subset o…

In my experience, Haskell is not yet a great language for numerically intensive computing. I'll explain in a bit, but before I do, let me first address your question about "can I bang on bits?". Yes, you can allocate memory and do all the low-level hacking you please in Haskell. It's not really any harder than in C, although the notation is different and that throws people. But because this is a very imperative way o…

> There are interesting projects underway for parallel programming (both on CPUs and GPUs) that rely heavily on the type system

Are you referring to Accelerate[1]? And isn't Repa[2] stable and usable?

[1]: https://github.com/AccelerateHS/accelerate/ [2]: http://repa.ouroborus.net/

Re: What was your "ah ha" moment with Haskell?

#28
post #18

Earlier quoted context omitted.

Would that downvotes interested me... To your questions: OcaML: seems like a hack-ish [S]ML. There's a nice comparison between SML and OcaML here : http://adam.chlipala.net/mlcomp/ . I like SML's syntax, but OcaML made it too easy to be imperative and seemed too hackish. Most of the OcaML I've seen looks like weird C, but written in OcaML because it's F4ST3R. F# : I run Linux... next! Scala* : I can't stand it. I use…

I don't think you understand either ML or Lisp. SML would never make whitespace significant because: 1) that's a brain-dead choice, and 2) ML, much like Lisp, is used as a language, as a notation, and as a "kernel" language. Clojure without dynamic-typing is bath-water without baby. What is the point of interactivity, homoiconicity and macros if the language is statically typed?

> What is the point of interactivity, homoiconicity and macros if the language is statically typed?

If the type system can handle it? MAGIC!

Re: What was your "ah ha" moment with Haskell?

#29
post #20

I have yet to have my big ah-ha moment for how to do what I do (scientific computing) in Haskell. I recently found myself needing a proof-of-concept implementation for solving a bunch of big tridiagonal matrices in parallel using MPI. I thought to myself "here's an opportunity to use Haskell!", but I must confess I'm rather stumped for how one goes about allocating some memory, banging on it, communicating a subset o…

In my experience, Haskell is not yet a great language for numerically intensive computing. I'll explain in a bit, but before I do, let me first address your question about "can I bang on bits?". Yes, you can allocate memory and do all the low-level hacking you please in Haskell. It's not really any harder than in C, although the notation is different and that throws people. But because this is a very imperative way o…

the key bit is not yet! :) You're highlighting all the right points, and i'm actually spending some time this summer putting the pieces together for a better numerical story with some really cool use cases and aiming for an out of the box turn key experience with numerical algorithm awesomeness.

I think once the pieces are laid out nice and clear, a dramatically better numerical toolchain will be born. :)

Re: What was your "ah ha" moment with Haskell?

#30
post #12

Earlier quoted context omitted.

That also what I did when I realized that the "return" function isn't actually for returning values. But then I came back for the 24th time and got hooked. Now Im doomed forever.

:) What an unfortunate function name. But "pure" isn't much better...

I always thought it ought to be "inject" or something. Return is just outright confusing to novices & just encourages them to believe that do ... return notation has something to do with imperative programming. Which is does of course, but only by the most circuitous of routes.

My embarrassing Haskell moment was how long it took me to realise that I could never get Arrow notation to work because the first argument to an arrow was the "arrow type" bit, so I was always trying to pass the wrong number of arguments to (*) and friends. Took me ages to get over that hump.

Post reply on HN