Hallo. I see some of you are listing things here. It really would be very helpful to me if you could list them on Reddit as well, using the format of the thread, so that I only have one source to deal with. I don't mean to instigate any Reddit vs. Hacker News rivalry, or whatever, but I just don't have time to go over several sources for my talk and PDF. So this is just a tip for if you want me to include your Haskel…
You already have this page open... how much more time is needed?
Why does Haskell, in your opinion, suck?
181–190 of 208 posts
Re: Why does Haskell, in your opinion, suck?
#182Earlier quoted context omitted.
Incidentally, this is why prefix notation seems so foreign. (+ 1 2) reads as "plus one two." It might just be the Lisp version of Stockholm Syndrome, but it seems perfectly natural to me to gloss that as "Add one and two."
Good point. (eq (+ 1 2) 3) would read "is add one to two equal to three?" though.
It's nice because it shows it's a value not a question.
But I don't really verbalize code, I think in symbols, maybe that's why prefix doesn't bother me.
Re: Why does Haskell, in your opinion, suck?
#183Earlier quoted context omitted.
You are right in that I am using the word continuation to highlight an important property of computational models (be they lambda calculus, Turing machines, or FSMs), namely the ability to stop and resume a computation. In imperative languages, subroutines are continuations in the sense that they can block and then be resumed (although only some languages have reified continuations that allow direct manipulation of t…
OK, you are equating continuations with the ability to "block". Please explain how OCaml computations have a notion of "blocking".
Re: Why does Haskell, in your opinion, suck?
#184Earlier quoted context omitted.
OK, you are equating continuations with the ability to "block". Please explain how OCaml computations have a notion of "blocking".
`input_line`
Re: Why does Haskell, in your opinion, suck?
#185Earlier quoted context omitted.
> It would be simply impossible for the stated benefits not to be beneficial in practice. The only question is whether the benefits are outweighed by the drawbacks. If you have already paid the one-off cost of learning the gnarly corners of Haskell then those drawbacks are significantly diminished. Provided that you think that the only significant drawback is the learning curve. I think that the PFP abstraction itsel…
> Provided that you think that the only significant drawback is the learning curve. No, you misread me. I acknowledge other significant drawbacks, such as immaturity of tooling and infrastructure. > I think that the PFP abstraction itself is a drawback, and that you can get most of Haskell's benefits (leaving aside their real-world value for a moment) without it. OK, that would be great! I am genuinely interested in…
> (One of) the real-world benefit(s) is that I can write a substantial part of a program and know from inspecting only a single line (its type signature) what effects it performs. How can OCaml give me that benefit?
That's a property, not a real-world benefit. It's like saying that one of the real-world benefits of Haskell is that its logo is green. In any case, don't know about OCaml, but in Java I just click a button, and get the call tree for the method (or, inversely, get the reverse tree for all methods eventually calling printf). More to the point, see some of Oleg Kiselyov's work on type systems for continuations here: http://okmij.org/ftp/continuations/
> I think that says more about how you interpret informal comments on the internet than it does about those making the comments.
I think that you should decide whether this is a serious discussion or grandstanding.
> Where did I say you should go (the equivalent of) "full vegan"?
Maybe you didn't say that I should, but you did say that it's better to be vegan (i.e. make a very significant "lifestyle" change without any evidence to its effectiveness).
> At least, it is not known to be wrong.
That's true. But I wouldn't go around telling people that being vegan has great health benefit if all we know is that it's not been found to kill you.
> I would love to see PFP as a drawback and obtain its benefits without requiring its rigors. So far I have failed to understand your ideas about how to do that and I can only continue to see PFP as a massive boon.
OK, but first, a few things: 1/ I don't know if by "rigors" you meant difficulties or rigorousness, but if the latter, then I don't see why you conflate rigor with the pure-functional abstraction. Most formally verified, safety-critical software is written in languages that are far more rigorous than Haskell, yet are not pure-functional. Which leads us to 2/ these are not "my ideas"; if correctness is your goal (as it seems to be), most languages guaranteeing correctness do not espouse the PFP abstractions. Haskell, Coq, Idris and Agda are used far less than other approaches to ensuring software correctness. Finally, 3/ I'd like to be careful when I say "benefits", because we don't know whether they are true benefits, neutral or even detrimental to software at large. All I can say that in this context, when I say "benefits" I mean things that I (and you) believe to be positive and see as potentially advantageous in the "real world".
Now, I will give you two examples (of languages used more than Haskell/Coq etc.) for "correct" languages, both of them are very rigorous in the sense of being completely formal, yet they do not suffer from PFP's downsides mainly by being measurably much easier to learn/teach/adopt. They are not generally applicable, but neither is Haskell. The first is the set of synchronous langauges, now used by the industry to design safety-critical realtime software, as well as a lot of hardware. Instead of PFP, it relies on what's known as the "synchronous hypothesis". It has been proven over three decades, as an effective, practical method of writing verifiably correct software by "plain" engineers in hundreds of critical real-world systems. You can read more about it here[1]. A generalization of the approach is called Globally Asynchronous, Locally Synchronous, or GALS, and I believe it has the potential of being a great, more widely applicable way of writing software in a way that lends itself to careful reasoning.
The second (you probably saw it coming), is TLA+. It's not a programming language, so I won't compare it to Haskell but to Coq. Unlike Coq, TLA+ does not rely on PFP, or Curry-Howard (neither do other verification tools, like Isabelle) but goes a step further in not being typed at all. It is not functional yet fully mathematical ("referentially transparent"), and its main advantage is that while having the same "proving strength" as Coq when it comes to verifying algorithms[2] while taking days to learn instead of months, and not requiring any mathematical background more than what any engineer already has. I guess that the answer to "how?" would be "in a manner bearing a lot of resemblance to the synchronous hypothesis".
There are, of course, other formal approaches (like CSP), but synchronous programming in particular has had a lot of success in the industry.
If you want to know about (typed) monads vs. continuations, and their relationship to typed effects, I'll refer you again to my blog post on the subject: http://blog.paralleluniverse.co/2015/08/07/scoped-continuati... and to Oleg Kiselyov's work, which I've linked to above.
[1]: http://link.springer.com/chapter/10.1007%2F978-3-319-11737-9...
[2]: Coq may be more powerful when proving general mathematical theorems, but Coq was designed as a general theorem prover, while TLA+ is a language for verifying software in particular.
Re: Why does Haskell, in your opinion, suck?
#186Earlier quoted context omitted.
`input_line`
But Haskell pure functions do "block" when they request memory from the allocator, for example. How do you distinguish these two kinds of blocking so you can claim that OCaml has it and Haskell doesn't.
Re: Why does Haskell, in your opinion, suck?
#187Can I encourage everybody to classify their complaints according to the following scheme? http://h2.jaguarpaw.co.uk/posts/complaining-about-languages/ I believe it would help everybody understand how we can improve people's experience around Haskell.
Re: Why does Haskell, in your opinion, suck?
#188Earlier quoted context omitted.
> What exactly is your definition? The problem is that there are two things here: purity, and functional. I don't know how to define purity alone, but let's say I take your definition, namely, the language defines a set of operations (that must include IO, and may or may not include mutation) and call them side-effects, and that the compiler enforces the transitive closure of said effects used by a subroutine. But Ha…
So you like PP (pure programming) but not PFP (pure functional programming)? Fine. For me the functional part is a means but the purity part is an end. If you can explain to me how to achieve purity in a non functional setting I will be extremely happy. Could you perhaps give me a toy example of a pure imperative language and a type system where effects are handled through continuations? I really don't see how that i…
Re: Why does Haskell, in your opinion, suck?
#189Earlier quoted context omitted.
So you like PP (pure programming) but not PFP (pure functional programming)? Fine. For me the functional part is a means but the purity part is an end. If you can explain to me how to achieve purity in a non functional setting I will be extremely happy. Could you perhaps give me a toy example of a pure imperative language and a type system where effects are handled through continuations? I really don't see how that i…
I don't know that I like pure programming; I'm just saying that if that's what people like in PFP, you can get that same sense of purity without PFP. Personally, though, I believe that people who like PFP simply find the paradigm to fit well with how they like to think of programs.
I don't think so actually, which I why I'm so keen to get to the bottom of your idea.
In my experience people find IO in Haskell very unnatural initially. It certainly took me months to get it. Now that I understand it it causes no additional overhead but I think it would have preferred to avoid it. I would still prefer to program in a more "natural" style and still get the benefits of purity. I just don't believe it's possible.
There seem to be two options
1. Work out how to explain IO more straightforwardly so it consumes less effort to understand it 2. Work out how to get the benefits of pure functional programming in a more natural, imperative setting.
I'd prefer to achieve 2, if possible.
Re: Why does Haskell, in your opinion, suck?
#190Earlier quoted context omitted.
> Provided that you think that the only significant drawback is the learning curve. No, you misread me. I acknowledge other significant drawbacks, such as immaturity of tooling and infrastructure. > I think that the PFP abstraction itself is a drawback, and that you can get most of Haskell's benefits (leaving aside their real-world value for a moment) without it. OK, that would be great! I am genuinely interested in…
> I would love to see PFP as a drawback and obtain its benefits without requiring its rigors. > (One of) the real-world benefit(s) is that I can write a substantial part of a program and know from inspecting only a single line (its type signature) what effects it performs. How can OCaml give me that benefit? That's a property, not a real-world benefit. It's like saying that one of the real-world benefits of Haskell i…
Secondly, I'm interested in general purpose programming, so as useful and interesting as your explanation of synchronous languages and TLA+ are, they are not relevant to me.
I am interested, though, in your thoughts on effects, monads and continuations. I've read everything you've written on the topic including your code on Github (and much of what Wadler and Oleg have written) but I'm afraid I'm no closer to understanding what you're getting at.
Does your notion of "continuation" require threads? If so, Python fails to have "continuations", right?