3 ms·
I emphatically reject the many of the conclusions of this article. >Let me say it simply. Type systems cannot be a one-stop solution for specification and veri
by wyager 12y ago
I emphatically reject the many of the conclusions of this article.
>Let me say it simply. Type systems cannot be a one-stop solution for specification and verification.
Wrong! Any correctness property can be encoded into a sufficiently powerful type system. Which brings me to...
>Curry-Howard is an interesting mathematical equivalence, but it does not advance any argument about how to write software effectively.
This is absurd, of course. The isomorphism between type systems and proof systems allows us to build lots of impressive systems like Agda and Coq.
>No sane person can argue that we want to bifurcate a programming language into distinct base-level and type-level fragments.
That's actually quite a reasonable desire.
>Personally, I want to write all my specifications in more-or-less the same language I use to write ordinary code.
To the author, this seems to mean "therefore, we shouldn't have types!". In reality, a sufficiently flexible programming language allows you to write type-level code in the same language as value-level code. See Agda.
>Rich Hickey's transducers talk gave a nice example of how patterns of polymorphism which humans find comprehensible can easily become extremely hard to capture precisely in a logic.
Lots of people have typed transducers just fine... http://blog.podsnap.com/ducers2.html http://blog.podsnap.com/ducers2.html http://conscientiousprogrammer.com/blog/2014/08/07/understanding-cloure-transducers-through-types/ http://conscientiousprogrammer.com/blog/2014/08/07/understan...
- djur 12y ago> To the author, this seems to mean "therefore, we shouldn't have types!". This doesn't follow from the author's earlier statements about using and benefitting from languages with static type checkers. An ideal typed Lisp dialect would fit the author's requirements.
- jroesch 12y agoAn ideally typed Lisp would be no different then a dependently typed language semantically. Yes, you would use slightly different syntax but a key feature of most dependently typed languages is that they only have a single class of pseudo-terms that are used for both types and programs. An example Idris program: double : Nat -> Nat double n = 2 * n ourVectorType : Type ourVectorType = Vect (double 1) Int aVector : ourVectorType aVector = [1, 2] If you change everything above to an S-Exp you have a typed Lisp where both types and terms have the same language.
- lispm 12y agoAdding s-exp notation to a random programming language does not make it a Lisp...
- danielscrubs 12y agoExcellent points. Thanks.
- jedharris 12y agoThanks for refuting by example all the other comments that say "The author is wrong because no one actually believes those things."
- AnimalMuppet 12y ago> >Let me say it simply. Type systems cannot be a one-stop solution for specification and verification. > Wrong! Any correctness property can be encoded into a sufficiently powerful type system. I'm writing a factorial function. But, because the caffeine hasn't kicked in yet, at the recursion step, I add one instead of subtracting one. The result is that the program will run in an infinite loop until either the fixed-size Int rolls over to 0, or the bignum-style integer consumes all available memory. That's certainly incorrect behavior. But I'd like to see your "sufficiently powerful type system" that will handle that. Then there's numerical accuracy. Here the results are not "wrong wrong", they're just "a little bit wrong" or "less accurate than they could have been". Again, I'd like to see your type system detect that. In my world, embedded systems, you can get hard-real-time situations, which means that the right answer, too late, is wrong. I believe that there are formal verification tools, but they don't look anything like a type system. And even those tools depend on a very deep knowledge of the processor that the code will be running on (not compiled on). Once more, I'd like to see your type system that's going to handle this. > > Curry-Howard is an interesting mathematical equivalence, but it does not advance any argument about how to write software effectively. > This is absurd, of course. The isomorphism between type systems and proof systems allows us to build lots of impressive systems like Agda and Coq. And if Agda and Coq were being used to write much software, you'd have a point. But if I understand correctly, they're mostly used for automated proofs. The point is that the program compiles, and therefore something is proven. The point isn't to get a runnable program.
- codygman 12y ago> The result is that the program will run in an infinite loop until either the fixed-size Int rolls over to 0, or the bignum-style integer consumes all available memory. That's certainly incorrect behavior. But I'd like to see your "sufficiently powerful type system" that will handle that. I believe that Agda could do this.