6 ms·
I never liked Coq's name because I'm immature, but it really is magic software in my eyes. The level of downright objectivity that you get with it makes it fee
by tombert 8y ago
I never liked Coq's name because I'm immature, but it really is magic software in my eyes. The level of downright objectivity that you get with it makes it feel so bulletproof.
I know functional languages are slowly starting to adopt dependent types, and you can get reasonable certainty of correctness with property-based testing, but Coq just feels kind of universal. If the proof passes, so will your code.
I really wish I could get my employer to sign off on me using it for a real project.
- quickthrower2 8y agoGood enough, with bugs is what makes the real money unfortunately.
- dan-robertson 8y agoI don’t really like this trope. The goal of a programming in Coq would, I suppose, be to shift debugging time from after compilation succeeds to before, with the hope that the compiler will direct one towards the bugs and they will be easier to find. I don’t think this is always a win. I think it is a win if what you write must be very reliable, but it seems less obvious that the advantage would still exist as the required reliability decreases. Remember that bug Coq had when if you used more than 256 parameters in a constructor you could prove anything? I suppose one could say Coq is good enough, with bugs.
- bunderbunder 8y agoWhat I would be terrified of in Coq is some tiny change in business requirements ends up pulling the linchpin out of some fundamental premise way down at the bottom of your stack of proofs, this forcing you to go and fix everything. Sort of the mother of all brittle testing scenarios. Maybe that's FUD on my part; I've only read Coq code and never written any of my own. In any case, at least the way I'm thinking of it, it's not that good enough with bugs is what makes the money. It's more a question of proportionality: It doesn't make sense to spend $100 to guard against a $5 bug. I don't think Coq leaves much room for being pragmatic about test coverage like that.
- Swizec 8y ago> What I would be terrified of in Coq is some tiny change in business requirements ends up pulling the linchpin out of some fundamental premise way down at the bottom of your stack of proofs, this forcing you to go and fix everything. Sort of the mother of all brittle testing scenarios. Isn't the same true for static typing? One small business requirement changes, you change a foundational type, and suddenly all your code needs to adapt. Of course this is true with dynamic typing too, but at least you don't know.
- deleted 8y ago[deleted]
- bunderbunder 8y agoI guess. My experience has been that it's more a case with, for lack of a better term, "old school" OOP. SOLID helps a lot with that sort of thing. Avoiding inheritance like the plague helps a lot. I slightly hate that I said old school, because Smalltalk-style tell-don't-ask helps a lot. I think that the idiomatic ways of structuring code in the ML family of languages help the most, because they tend to be pretty radical about limiting scope of visibility. But they also tend to make more of a muddle of things than they're worth in algol-style languages.
- dmitriid 8y ago> Isn't the same true for static typing? One small business requirement changes, you change a foundational type Business changes are usually changes in logic, not in types. So it's mostly "our cashback is now calculated in percentage of the sum, not as a fixed sum" etc. Of course, this may still have repercussions through the entire system. I don't know how it would work in Coq (I don't know Coq :) ).
- bjz_ 8y ago> Business changes are usually changes in logic, not in types. Types _are_ logical propositions. In languages like Coq they are more expressive, and it's easier to leverage them as a way to constrain your implementation. Of course it's just a model, and there can be bugs in the specification, so it's not a silver bullet.
- nickpsecurity 8y ago" with the hope that the compiler will direct one towards the bugs and they will be easier to find." Also, less expensive to fix given bugs are cheaper to fix earlier in the lifecycle. You can also reduce breakage during changes to existing code. Finally, you can warranty the code at specific defect rates or for certain kinds of defects where the fixes are free within the warranty. Companies using Cleanroom and Correct-by-Construction did that with the above benefits. http://infohost.nmt.edu/~al/cseet-paper.html http://infohost.nmt.edu/~al/cseet-paper.html http://www.anthonyhall.org/c_by_c_secure_system.pdf http://www.anthonyhall.org/c_by_c_secure_system.pdf
- quickthrower2 8y agoI’m referring to production code being good enough rather than the tooling. Let’s take HN for example. Is it coq proven? I doubt it. Is that a barrier to its success?
- seanmcdirmid 8y ago> I suppose one could say Coq is good enough, with bugs. Wait, isn't Coq verified by itself?
- syrak 8y agoThe Coq compiler is unverified, it is written in OCaml. It's not possible for Coq's consistency to be verified in itself, thanks to Gödel's second incompleteness theorem. However there are still various other aspects of the compiler that could be verified in principle. The CertiCoq project is actively going in that direction.
- quickthrower2 8y agoI love this comment, because there is this pie in the sky mathematical idea, with direct consequences for practical coding.
- tombert 8y agoI should rephrase; obviously nothing is perfect, I'll admit that a few things will slip through the cracks. I just feel that it's night and day, compared to nearly any mainstream language.
- rtpg 8y agogood enough without bugs makes you a lot of money and also lets you build something with a much smaller team. I don't think Coq is the way forward (I don't think "code that makes money" has many interesting provable properties in itself along those axes) but being able to ship stuff that's pretty close to bug-free will get you far
- OnlyOneCannolo 8y agoIt's pronounced closer to "coke".
- tom_mellior 8y agoNo. The software Coq is pronounced like the French word "coq", which has a short o like the English "cock" and unlike the long o in the English "coke". https://forvo.com/word/coq/#fr https://forvo.com/word/coq/#fr This is certainly the only pronounciation in the French formal methods community, where Coq comes from. It is also the standard pronounciation in the international formal methods community. I have never heard anyone pronounce it like "coke". See for example Adam Chlipala at about 5:40 here: https://www.youtube.com/watch?v=4DYVJdHMV5k https://www.youtube.com/watch?v=4DYVJdHMV5k Benjamin Pierce has a slightly longer o here, but it doesn't sound to me like it's deliberately pronounced differently from "cock": https://www.youtube.com/watch?v=KKrD4JcfW90 https://www.youtube.com/watch?v=KKrD4JcfW90 And here is Andrej Bauer: https://www.youtube.com/watch?v=COe0VTNF2EA https://www.youtube.com/watch?v=COe0VTNF2EA I know from rare comments like yours that some prudish Americans pronounce it "coke", some deliberately, others apparently because they have been fooled by the first group. But this seems to be a very small minority.
- dragonwriter 8y ago> The software Coq is pronounced like the French word "coq", Yes, but... > which has a short o like the English "cock" No, it doesn't. The sound it has isn't a common English vowel sound at all; it is closer to the vowel sounds in “cuck” and “cook” than the one in “cock”, but not exactly either of those, either. In fact of the four (those two, plus coke and cock), the “o” in “cock” is the one most Americans would find it most distinct from, I would think. > https://forvo.com/word/coq/#fr https://forvo.com/word/coq/#fr Yeah, none of those pronounce it with the vowel sound in English “cock”. > I know from rare comments like yours that some prudish Americans pronounce it "coke", It's not prudish, its a common way Americans that haven't mastered French pronunciation approximate the unaccented French “o” irrespective of context.
- tom_mellior 8y ago