Live data from Hacker News

Dijkstra on Haskell and Java (2001)

chrisdone.com

111–120 of 124 posts

Re: Dijkstra on Haskell and Java (2001)

#111
post #104

Earlier quoted context omitted.

Each list comprehension is O(n). O(n)+O(n)=O(n). Each iteration will roughly bisect the list, resulting in roughly log(n) iterations. Thus the one-liner is O(n*log(n)). Haskell says nothing about how lists are implemented, so with respect to "true"ness (I'm not really sure what this means), we can cannot generalize. A sufficiently optimized Haskell compiler implemented in silicon would have the liberty of using the m…

>Each list comprehension is O(n). O(n)+O(n)=O(n). Each iteration will roughly bisect the list, resulting in roughly log(n) iterations. Thus the one-liner is O(n*log(n)). "I'm not disputing the scaling properties of that sort" = this proof does not convince me of anything I didn't already agree with. Was I unclear about what I was objecting to? > Haskell says nothing about how lists are implemented, so with respect to…

What do you mean by the "real QuickSort"? The professor who taught me Haskell at UT used to work on Burroughs LISP machines and wasn't too concerned with caches, memory, or the like. Again, Haskell can be viewed as a language for computation. From this perspective, the one-liner is pure beauty.

Re: Dijkstra on Haskell and Java (2001)

#112

Although I didn't do CS, but electrical engineering, I would have loved to get some more exposure to functional programming. We got Scheme which everybody hated because of the cumbersome bracket counting. And of course we got C, Java, Matlab, and VHDL, besides a bunch of assembly. VHDL or Verilog would maybe also a nice eye opener for CS students. It's again another mindset.

Think about how that would have changed if they had a simple text editor with parenthesis highlighting.

Absolutely. Or parenthesis coloring, that would be even better.

Re: Dijkstra on Haskell and Java (2001)

#113
post #32

Earlier quoted context omitted.

That day will come, for many of us, when a large AAA game, web browser, or usable OS is written in a FP language. And I realise that is an unfair target, but there is very little user facing FP software. The only one I can think of I have used is xmonad, which is both hard to use and fairly buggy

You mean like Crash Bandicoot, Abuse, Jak and Daxter? Or maybe Genera. Or maybe Remote Agent software used by Nasa Deep Space 1? Or eventually the train control systems running on software from Siscog?

While Crash Bandicoot used LISP (which I wouldn't call FP, although definitions vary), it was only for a small part of the code (the AI), nowhere near all the game was written in lisp.

Re: Dijkstra on Haskell and Java (2001)

#114
My favorite quote:

"A fundamental reason for the preference is that functional programs are much more readily appreciated as mathematical objects than imperative ones, so that you can teach what rigorous reasoning about programs amounts to. The additional advantage of functional programming with “lazy evaluation” is that it provides an environment that discourages operational reasoning."

Re: Dijkstra on Haskell and Java (2001)

#115

Earlier quoted context omitted.

I really don't understand why people think monad is a "fancy scary term". It's a five-letter easily-pronounceable word. What makes it fancy or scary? I think people assume that they're scary, and then confirmation bias themselves into making them hard to learn, despite them being a reasonably simple concept overall. As for calling them strategies… if we called them that it would make learning and understanding the in…

We should call things what they are. Sure - I wasn't seriously suggesting we rename them, just that in my personal experience, newcomers get scared off seemingly by the name alone before ever actually finding anything out about them. A friendlier name may avoid this for newcomers . It definitely wouldn't be worth it for more advanced practitioners where referring to them exactly and in the context of their category t…

I'm not sure how worried I am about the class of newcomers that will be scared off by a word that they don't know. PHP is friendly to newcomers, and the result is thousands of insecure websites built by people who think they know what they're doing but don't. Software engineering is a professional discipline. I don't understand the desire to pander to the lowest common denominator. When's the last time you saw a physics practitioner propose renaming vector spaces to be friendlier to the students?

(For what it's worth, you may not have been serious about renaming monads, but many others have seriously proposed it. In most languages other than Haskell they've been successful.)

Re: Dijkstra on Haskell and Java (2001)

#116

Earlier quoted context omitted.

We should call things what they are. Sure - I wasn't seriously suggesting we rename them, just that in my personal experience, newcomers get scared off seemingly by the name alone before ever actually finding anything out about them. A friendlier name may avoid this for newcomers . It definitely wouldn't be worth it for more advanced practitioners where referring to them exactly and in the context of their category t…

I'm not sure how worried I am about the class of newcomers that will be scared off by a word that they don't know. PHP is friendly to newcomers, and the result is thousands of insecure websites built by people who think they know what they're doing but don't. Software engineering is a professional discipline. I don't understand the desire to pander to the lowest common denominator. When's the last time you saw a phys…

I don't understand the desire to pander to the lowest common denominator.

If people want to learn about monads is up to them and I don't have any skin in the game, but I hear a lot of people complaining that monads are so difficult to understand or use and I guess I was really just observing, in a roundabout way, that I feel a lot of that is down to monads appearing more complicated or scary than they are and that people are put off by it, kind of how people are put off Lisp's due to the parentheses.

Re: Dijkstra on Haskell and Java (2001)

#117

Earlier quoted context omitted.

I'm not sure how worried I am about the class of newcomers that will be scared off by a word that they don't know. PHP is friendly to newcomers, and the result is thousands of insecure websites built by people who think they know what they're doing but don't. Software engineering is a professional discipline. I don't understand the desire to pander to the lowest common denominator. When's the last time you saw a phys…

I don't understand the desire to pander to the lowest common denominator. If people want to learn about monads is up to them and I don't have any skin in the game, but I hear a lot of people complaining that monads are so difficult to understand or use and I guess I was really just observing, in a roundabout way, that I feel a lot of that is down to monads appearing more complicated or scary than they are and that pe…

Yep, on that point I agree with you completely. I don't at all understand why people find their appearance complicated or scary, but I agree that it's more appearance than reality.

Re: Dijkstra on Haskell and Java (2001)

#118

Earlier quoted context omitted.

I am looking forward to the day the notion that functional languages are not suitable for developing software will die. It is not only that functional languages are more succinct, easier to reason about and are more readable, they also often come with significantly better type systems. Some have type systems sophisticated enough to specify nearly all the legal states and guarantee these are the only states the progra…

That day will come, for many of us, when a large AAA game, web browser, or usable OS is written in a FP language. And I realise that is an unfair target, but there is very little user facing FP software. The only one I can think of I have used is xmonad, which is both hard to use and fairly buggy

Since I use Xmonad as my window manager, I'm rather invested in you elaborating on Xmonad being "fairly buggy". Should I worry about my data?

Re: Dijkstra on Haskell and Java (2001)

#119
post #99
post #75

Earlier quoted context omitted.

I looks like alayne is using 'purely functional' to mean Pure + Functional, but you are using it to mean Everything is an Expression / First-class functions, etc.. The functional paradigm. Lisp is definitely a functional language. It's just not as pure as Haskell, which is the poster child for Maximally Pure FP, if not for the functional style.

Hence why I made the reference to Miranda. We were already doing functional programming while Haskell was still using diapers.

Well, yes. Haskell is heavily inspired by Miranda. Haskell was just managed in a way that allowed it to become very popular.

Re: Dijkstra on Haskell and Java (2001)

#120

Earlier quoted context omitted.

I don't know if I can agree with this. I've invested a significant amount of time in learning about monads (and functors, applicatives, monoids, and more from the bestiary of commonly used category theoretic structures in Haskell) and I find them quite challenging to grasp in their full generality. While specific use-cases are readily understood, getting to the heart of what a monad "is" has taken me time, and I hone…

Absolutely there's a spectrum and I certainly don't fully understand the full set of category theoretic structures (I'm slowly trying to learn, but.. its slow going). I just think that monads as programming constructs are quite simple. I don't doubt that in a full mathematical context there is a hell of a lot more to them and the mathematical reasoning behind how they work is surely beyond my understanding, but from…

...but from a how they work, how to use them, how they interact with the language and what they enable you to do point of view, they aren't difficult at all.

I guess we'll have to agree to disagree here: I have found it challenging to grasp all of these things (even simply within the context of programming language usage). I guess that is, in the end, rather subjective.

Post reply on HN