I had an extremely frustrating exchange with a FP practitioner who was overly enthusiastic about Curry-Howard the other day, so I tried to write up my thoughts in this note here.
I had an extremely frustrating exchange with a FP practitioner who was overly enthusiastic about Curry-Howard the other day, so I tried to write up my thoughts in this note here.
@liamoc I feel this blog post might give the wrong impression that the Curry-Howard correspondence is just a fun curiosity, but that most concepts of interests (e.g. type safety, type isomorphism, etc) can only be stated in type-theoretical parlance. This is not the case, because the correspondence is not only at the static levels of type/propositions and programs/proofs, but also at the *dynamic* level of execution/cut-elimination (this is also why I am usually reluctant to add Lambek to the correspondence's name). Thus it really is an isomorphism, that is no abuse of language.
Of course this does not invalidate your thesis that currently, having deep knowledge of Curry-Howard doesn't bring much practical benefit to software engineers. I agree that it becomes really useful in the presence of dependent types, but I still think more people should be exposed to Curry-Howard as a way of thinking about types, seen as a way to express and enforce your code's logic (literally) declaratively. At least when I was learning FP, it was eye-opening to me to understand that e.g. sum types are just a way to encode disjunction/case reasoning.
Computer science provides an in-depth understanding of technical aspects of programming concepts, but if we want to understand how programming concepts evolve, how programmers think and talk about them and how they are used in practice, we need to consider a broader perspective that includes historical, philosophical and cognitive aspects. In this paper, we develop such broader understanding of monads, a programming concept that has an infamous formal definition, syntactic support in several programming languages and a reputation for being elegant and powerful, but also intimidating and difficult to grasp. This paper is not a monad tutorial. It will not tell you what a monad is. Instead, it helps you understand how computer scientists and programmers talk about monads and why they do so. To answer these questions, we review the history of monads in the context of programming and study the development through the perspectives of philosophy of science, philosophy of mathematics and cognitive sciences. More generally, we present a framework for understanding programming concepts that considers them at three levels: formal, metaphorical and implementation. We base such observations on established results about the scientific method and mathematical entities -- cognitive sciences suggest that the metaphors used when thinking about monads are more important than widely accepted, while philosophy of science explains how the research paradigm from which monads originate influences and restricts their use. Finally, we provide evidence for why a broader philosophical, sociological look at programming concepts should be of interest for programmers. It lets us understand programming concepts better and, fundamentally, choose more appropriate abstractions as illustrated in number of case studies that conclude the paper.
@stphrolland @liamoc I mean something like this:
http://lmf.di.uminho.pt/quantum-logic-1920/LQ-Lec8.pdf
(One of the first hits Duck Duck Go gave me.)
@ohad @liamoc
I have just skimmed it... I saw no mention of the misconception you were mentionning.
My current understanding of the misconception about the Curry-Howard isomorphism: it is more meaningful if we use truncation so as to decouple a Type which implies an heavy machinery, versus a Truncation, which is only witnessing that the type is inhabited, and which is sufficient enough for Logic/Theorem Proving.
That's more or less what I understood from several statements I read from discussion between mathematicians like J. Carette and M. Escardo
From what I understand the paper you indicate is only establishing the Curry-Howard-Lambek correspondance.
I have not seen concerns about misconceptions around it.
Am I mistaken ?
I admit I am not yet fluent enough to understand fully the paper, I will have to re-read it and dig some parts. But I have not seen a passage about misconceptions induced by Lambek calculus.
That's great. I have not worked enough on the concept.
I am interested because I have beginning of experiments where I put a layer that probably can be modeled with Lambek calculus. But for the moment, it is an additional/external layer. I am tempted to think there will be ways to connect the layers.
But I am not experienced enough to bet on the fact that I will not fall into misconceptions, of the kind you are highlighting.
That's why I am interested in case you remember papers dealing with them.
I only sort of "feel" the sort of decoupling you express between a categorical semantics and a denotational semantics. But I am not yet at ease.
I ask you more "by fear" of doing mistakes.
@liamoc I think the first time this clicked with me was when getting familiar with a proof assistant and getting practical intuition that proving a disjunction looks very similar to if then else in programming, so I do think it's useful to show a student coming from either direction that programming and theorem proving (specifically computer assisted theorem proving) are not that different deep down and it's not just by coincidence.
Besides giving you confidence that your skills can be partially transferred if you shift your reasoning mode a bit, I don't find much use for it.
I think one should also point out that non-computer assisted theorem proving has often very little to do with any practical programming, it seems a very different skill set. So maybe it's like drawing and writing, you can use pen and paper to do either but you won't learn much about doing one practicing the other.
@liamoc Imagine the damage they do, when someone then tries to approach the untyped community.
We have a bad reputation, let me tell you that, some for good reason.