-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[coq] Improve support for Coq's native compiler #5831
Comments
Out of curiosity, why is that the case? |
@rgrinberg the native compiler still needs to read ( We should be able to optimize that. For the purposes of this PR, I think it is not so important if we setup I wish #4908 would be an option, but I understand that is not so easy. |
Just to clarify, |
Yes, see the PR #4750 , the rules are really straighforward. |
Okay, then I propose that you just let me setup the native rules "jsoo" style for local & installed theories. That means I'm going to set them up "on demand" whenever someone needs a native target rather than on package installation time. However much slower coqnative is, the benefit of eliding the native build for the 90% who don't care for it is going to be far more important. |
We currently elide the native build unless demanded in the stanza too, so how's coqnative be different here? |
Well, what do you do on installation time? E.g. And yes, the cache is what makes all of this possible. With the cache, we don't need to worry about rebuilding the same installed theories over and over. |
What we need to do here is to install the native stuff if Coq was configured with On Opam, coqc is configured to use native when the coq-native package is installed. Regarding |
Glad we're on the same page as to what the consequences are. Now let's remind ourselves why this is such a poor user experience. Let's consider the following user session:
This is a highly inefficient and inconvenient workflow. Moreover, if the user then publishes a package downstream, they have no means to express that a particular theory needs native compute for performance. They can only express an extremely coarse dependency on
Yes, I only expressed a preference for |
We all agree this is not ideal and there is a long term, yet unprecise, plan to depart from that (c.f. coq/ceps#48 for the detailled discussion). However, as a user, I would already be happy if things were just working as you describe (I can just keep two opam switches with and without native for instance). Today with dune, things are even much worse than this not ideal situation, as they look more like:
and everything ends up broken. In my opinion, this is the main, if not only, point deterring me from using dune to build Coq libraries nowadays. |
Indeed @rgrinberg this is not a great experience, tho dune cache would trigger for the .vo files if we setup things a bit more carefully and use I'd be happy indeed if we close this issue with the auto-detection feature, as this provides a very good packaging experience. The improved workflow you propose is to have a |
Fixed by #6409 |
Current support for Coq's
native_compiler
in Dune is unsatisfactory and we should fix it before(using coq 1.0)
(maybe we can add a milestone coq-1.0 or something like that?)In particular, the choice done in Coq's current implementation is a bit similar to how OCaml works for "byte/native":
coqc -config
and generate the .cmxs if neededThere is another interesting alternative which I tried to implement, which is using
coqnative
which is the standalone native compiler, but it is much slower as of today.I guess for 1.0, we should just call
coqc -config
and if native is enabled, andrelease
profile is selected, we just tell Coq to generate the native files too (or setup the coqnative install / build rules)The text was updated successfully, but these errors were encountered: