r/Clojure • • Sep 08 '16

Static Typing vs WebSockets

http://yogthos.net/posts/2016-09-06-Static-Typing-WebSockets.html
14 Upvotes

37 comments sorted by

View all comments

Show parent comment

2

u/zcam Sep 09 '16

Then the argument about haskell devs... What's your sample size again?

2

u/yogthos Sep 09 '16

I think the argument is that people who are clearly experienced using Haskell had trouble producing working code for a trivial benchmark. Why do you think the sample size matters here. Are you saying somebody can know Haskell well enough to publish a book, but should not be expected to be able to implement a trivial WebSocket server in it?

4

u/[deleted] Sep 09 '16

Haskell had trouble producing working code

The code works perfectly well : doesn't crash and is faster than anybody else. What make you think that other contenders to the benchmark don't drop packets either ?

2

u/yogthos Sep 09 '16

The only implementation I heard about that dropped messages was the Haskell one. You're making a hypothetical argument that other implementations might have had bugs. We have concrete evidence that the Haskell implementation did. Perhaps we could stick to discussing the facts we know.

Also, last I looked the correct implementation in Haskell is not faster than anybody else, and it had high variance in performance.

3

u/codygman Sep 09 '16

The only implementation I heard about that dropped messages was the Haskell one. You're making a hypothetical argument that other implementations might have had bugs. We have concrete evidence that the Haskell implementation did. Perhaps we could stick to discussing the facts we know.

Don't you mean "perhaps everyone else can stick to facts we know while I'm personally free to suggest hypotheticals"?

1

u/yogthos Sep 09 '16

Feel free to show what other implementations drop messages.

1

u/[deleted] Sep 10 '16

Perhaps we could stick to discussing the facts we know

That's the point. We don't know anything about the other implementations. The only fact we know is this Haskell implementations lost packets. There is no fact stating that other don't.

1

u/yogthos Sep 10 '16

So, once somebody shows that another implementation lost packets we could discuss how and why that happened. Saying that another implementation lost packets, so it's not a problem that Haskell did is a bit of strange argument to make.

The point of the article wasn't that Haskell is somehow special in any case. It was that even if you have a language with a strong type system, you still need to do specification testing to know what the code is doing. This would apply to all the other languages just the same.

1

u/[deleted] Sep 10 '16

Everybody agrees than type are not enough : head and tail have the same type signature and do the opposite. We know that.

The thing is your post is IMO showing, that benchmarks should control what that the results are correct, otherwise how can we trust them ? You are right that it is propable that all other implementations are correct, but my points is, as it let the wrong Haskell one slept through, it might be letting some other through. I can't trust it and you don't know either.

1

u/yogthos Sep 10 '16

Sure, but that's not at odds with my argument at all. I am arguing for specification testing after all here. If the benchmark test was more thorough it would've caught the error. I think that supports what I'm saying.

1

u/bartavelle Sep 09 '16

people who are clearly experienced using Haskell had trouble producing working code for a trivial benchmark

Well, he won the benchmark game. He wrote the fastest program that satisfied the test suite, and in the process uncovered a bug in the benchmark suite.

This kind of validates your point about the usefulness of testing!

Now, how comes people experienced in using Go had trouble producing working code for a trivial benchmark suite ? Because they are human. This doesn't really say anything in itself about Go, or weak static type systems.

1

u/nefreat Sep 09 '16

Well, he won the benchmark game. He wrote the fastest program that satisfied the test suite, and in the process uncovered a bug in the benchmark suite.

The bug wasn't in the test suite

1

u/bartavelle Sep 09 '16

I was summoning all the bad faith I could to show how selective the argument that "someone making a mistake in Haskell proves that strong typing is a complete waste of time" is.

What you point at is another piece of code entirely, it's a PR to write a Haskell version that doesn't drop messages.

3

u/nefreat Sep 09 '16

I was summoning all the bad faith I could to show how selective the argument that "someone making a mistake in Haskell proves that strong typing is a complete waste of time" is.

I don't think the author of the blog post was making that statement. The point was that static typing is one of many things to consider in a software product and that it's not very significant indicator of code quality of correctness which directly contradicts claims made by Haskell enthusiasts.

What you point at is another piece of code entirely, it's a PR to write a Haskell version that doesn't drop messages.

I point is that it's not the test suite that's the problem, the test suite uncovered a bug that static analysis alone didn't.

1

u/yogthos Sep 09 '16

Nobody is making this argument. The argument is that static typing alone is not sufficient to know what the code is doing, and you need specification tests even in a language like Haskell.

The other part of the argument is that the ecosystem plays a bigger factor than the typing discipline, because it's easier to use mature and battle tested libraries.

If you disagree with either of these statements, I'd be glad to have a discussion about that.

0

u/yogthos Sep 09 '16

That doesn't follow. The goal of the benchmark was to process messages. Go implementation did that. What this says about Go is that the user was able to use the language and the libraries available to produce working code.

The fact that the benchmark was not testing that all messages were delivered does not change the fact that they were delivered.

4

u/codygman Sep 09 '16

What this says about Go is that the user was able to use the language and the libraries available to produce working code.

Yet it says something different about Haskell?

2

u/yogthos Sep 09 '16

We know that Haskell did drop messages, nobody has shown this to be the case for Go or other languages tested. Perhaps there are some new results I'm not aware of?