coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Clément Pit-Claudel <cpitclaudel AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library
- Date: Thu, 31 Oct 2019 17:42:57 -0400
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=cpitclaudel AT gmail.com; spf=Pass smtp.mailfrom=cpitclaudel AT gmail.com; spf=None smtp.helo=postmaster AT mail-qt1-f169.google.com
- Ironport-phdr: 9a23:vVBqaR/l3CFdHP9uRHKM819IXTAuvvDOBiVQ1KB30uwcTK2v8tzYMVDF4r011RmVBN6dsqoZwLOL6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglVijexe65+IAm2oAneq8UbgZduIbstxxXUpXdFZ/5Yzn5yK1KJmBb86Maw/Jp9/ClVpvks6c1OX7jkcqohVbBXAygoPG4z5M3wqBnMVhCP6WcGUmUXiRVHHQ7I5wznU5jrsyv6su192DSGPcDzULs5Vyiu47ttRRT1jioMKjw3/3zNisFokaxVvhyhqRx8zYDabo6aO/hxcb/Sc94BWWpMXdxcWzBdDo6ybYYCCfcKM+ZCr4n6olsDtQWzBQ22A+Pq1DBIgGP20rUg3eQgDQHKxRItH9YUv3TJsdr6KqMSWv2ywabU1TXDbu9W1iv56IfSbxAuvO+DXbZrfMrezEkgDQLFjlGKpYP5ODOV0/0Avm6G5ORjTeKik3Arpx11rzS1xcohipPFip8Ux1zY7yl13Yc4KNmgREJlYNOoDJVduiSVOodqXs8tWWRltDo/x7AFp5K0YC0HyJopxx7Rd/CKdoeF7QzgWeqPJDp1i2xqdb2xihu37Uev1unxWdey3V1XtCRKiMPMuWoI1xHL6siIVP99/kC51DaKzQ/T6+VELVktlarHNpIt27AwmocSvEnHBCP2l0L2jKiZdkUg5Oek8fjoYrLjppOENo90jB/xMrg2l8ChHeg1NhICUmub9OimybHu/FH1TK9XgvA3lqTVqJXaKt4apq69DQ9VyIEj6xOnAji6yNQYnGUHI05BeB2dkojmJk/BIPTjAPewhlSjijZrx/TcMrL9BZXNK2DPkK39crZl905c1A0zwMhD6JJTE7ENOe78WkvstNPDFRI5KAy1w+P/CNpnzI8eWGSPArWYMKzIq1OI6PgvcKGwY9oevy+4IPw47dbvi2U4kBkTZ/qHx5wSPVu8n/FrJVmuWXvwx/wFGHoGsw52GOfyiUGJVTdOa3u2d6057zA/TomhCNGQFciWnLWd0XLjTdVtbWdcBwXUSCu6R8C/Q/4JLRmqDIp5iDVdDOquToYg0Velswqok+M6fNqRwTURsNfY7PYw5+DXkktspzl9DsDYyn3UCm8twDJOSDgx06Ry50d6zwXbiPkqs7ljDdVWoshxfEI/PJ/YwfZ9DomrCA3Ed9aNDl2hR4f/DA==
On 2019-10-31 11:02, Xavier Leroy wrote:
> You're right, this trick must be applied to all inductive types in your
> hierarchy. It is a maintenance burden, indeed. But at least you should
> get meaningful errors when something is wrong (missing or wrong Extract
> Inductive command).
> [...] For the casts inserted by extraction, type soundness was checked by
> the Coq type-checker. In other words, the extracted code is type-safe,
> just not typeable in OCaml because its type system is too weak. So,
> assuming extraction is sound and OCaml compiles correctly in the presence
> of Obj.magic, you can feel reasonably safe about these casts.
Well, you also need to assume that your Extract Inductive commands are sound,
too — and you don't always get an error message: because of the Obj.magic
that the compiler introduces, your ill-typed extraction command can silently
go through and lead to a crash. Arguably that's not likely, but I've seen it
happen :/
On the other hand, and additional Obj.magic that converts between two copies
of (what should be) the same type can only go wrong if you're using an OCaml
library that's inconsistent with the Coq one; that can't happen if both are
packaged in distributed together, right?
So we're looking at a problem that would only bite developers trying to
compile a Foo program written against an copy of the Coq sources using a
compiler linked against a different copy of the Coq sources, which sounds
like a fairly nice issue.
Clément.
- [Coq-Club] Separate/incremental extraction of parts of a Coq library, Clément Pit-Claudel, 10/30/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Xavier Leroy, 10/30/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Clément Pit-Claudel, 10/30/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Xavier Leroy, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Clément Pit-Claudel, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Xavier Leroy, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Stefan Monnier, 10/30/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Erik Martin-Dorel, 10/30/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Clément Pit-Claudel, 10/30/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Matthieu Sozeau, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Clément Pit-Claudel, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Matthieu Sozeau, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Clément Pit-Claudel, 10/31/2019
- Re: [Coq-Club] Separate/incremental extraction of parts of a Coq library, Xavier Leroy, 10/30/2019
Archive powered by MHonArc 2.6.18.