2 ms·
> No one except mathematicians and type theorists are using HoTT, Right. > where every programmer in existence is using first-order and sometimes second-order
by catnaroek 10y ago
> No one except mathematicians and type theorists are using HoTT,
Right.
> where every programmer in existence is using first-order and sometimes second-order logic.
I'm not so sure about this one. Perhaps by “programmer” you mean “every Haskell programmer”? Even then I'm still not sure. Are you counting “let's approximate `forall x. P(x)` with the large but finite conjunction `P(a) /\ P(b) /\ P(c) ...`” as “using first-order logic”?
- naasking 10y agoI mean pretty much every programmer, even C programmers. Simple business logic is rife with such propositions. Note that I didn't say they use first-order logic to encode invariants in types or anything, but they obviously use it everyday to write programs Haskell programmers also use higher order logic, which is also common now in Java and C#.
- catnaroek 10y ago> Note that I didn't say they use first-order logic to encode invariants in types or anything, but they obviously use it everyday to write programs I wasn't talking about types either. Most programmers I've talked to simply can't use formal logic.
- naasking 10y agoHmm, I don't think you're being very charitable. That these programmers can write working programs suggest they sufficiently understand disjunction, conjunction, negation, conditionals and quantification. Perhaps they have trouble abstracting the semantics from their preferred language and/or syntax, but that doesn't mean they don't grasp their meaning.
- catnaroek 10y agoI offer this thread as evidence: https://news.ycombinator.com/item?id=12342583 https://news.ycombinator.com/item?id=12342583
- naasking 10y agoThat's definitely not being charitable. Subtyping has some pretty subtle interaction with other typing features, which is why it's still being studied more than 20 years after Cardelli's "Subtyping Recursive Types". The pernicious conflation of subtyping and subclassing in common OO programming languages just compounds the confusion.
- eli_gottlieb 10y agoHey, it's not the fault of the programming masses that some evil motherfucker conflated implementation extension (inheritance) and subtyping. Subtyping = "A <: B, therefore I can start with an A, forget the details irrelevant to B, and just use it as a B." Inheritance = "A inherits B, if I try to actually use it as a B, it promises to work. However, it might actually blow up in my face, because it was keeping its extra details secret from me and promising they wouldn't blow up."
- catnaroek 10y ago> programming masses, some evil (bleep) Too harsh. Logic is hard for humans. Evolution has trained us to take lots of mental shortcuts, not to be perfect calculating machines. Even the most technically competent people rely on their intuition. What differentiates them from the rest of us is that they have trained their intuition to make it more reliable [0]. It's the job of a language designer to arrange things so that intuition doesn't mislead programmers regarding the meaning of language features. Before proposing a new feature, the designer must anticipate how programmers will think about code that uses this feature, and there better not be a mismatch between what programmers think the code means and what the code actually means. > A inherits B, if I try to actually use it as a B, it promises to work. There's nothing wrong with implementation inheritance per se [1]. It addresses a very common use case: you have a thing Foo, and you want to produce another thing Bar that's similar to Foo, with minor changes here and there. This describes accurately how many things work in real life. However, you can't assume that Bar can always be used where Foo is expected. Those “minor changes here and there” might have rendered Bar incompatible with Foo. Hence, “inheritance is not subtyping”. As stated above, it's the job of a language designer to anticipate this. [0] https://terrytao.wordpress.com/career-advice/there%E2%80%99s-more-to-mathematics-than-rigour-and-proofs/ https://terrytao.wordpress.com/career-advice/there%E2%80%99s... [1] Other than the lack of mathematical elegance, but few things are mathematically elegant in life.