-
Notifications
You must be signed in to change notification settings - Fork 636
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
Show diff highlights in the Show, Show <num> and Show <id> commands. #10020
Conversation
Postponing to 8.11: the set of features for 8.10 has been frozen a few weeks ago. Thanks for your understanding. |
I'm afraid we won't be able to add this kind of fragile hack to the codebase; indeed, the API is purposely structured as to avoid this kind of pattern. Already in the original PR adding diff state, I suggested to use a design where ownership of the proof was more clear; with regards |
How is this more fragile than any other bit of code?
While it's needed for PG, this is not a PG-specific change. If diffs are turned on, you should see them in the This is a reasonable and modest change to the user experience. There should be a reasonable way to implement it with a moderate effort rather than requiring major changes. The current structure of diffs is based on what you requested. I can't tell from your comment what you're proposing. Perhaps to pass the previous proof down through Vernacentries.interp in Stm.vernac_interp? (What are you trying to achieve for the APIs with the various refactorings you've been doing? I don't know what you're aiming for architecturally or trying to preserve. It would helpful to understand that.) |
It violates separation of components and state ownership invariants.
Indeed that would be a reasonable choice, and we could incorporate such a change. However IMO diffs should be always initiated by the UI; for example in SerAPI you would write Using "Vernaculars" for print is anachronic and indeed shouldn't be relied upon; I have brought this issue in PG a few times but so far we didn't do a lot of progress. |
@vbgl IIRC @Zimmi48 told me that there was plenty of time before 8.10 would be shipped (until early June) when I asked in early April about completing some work for 8.10. Perhaps I misunderstood. I suppose https://github.com/coq/coq/projects/32 is the list of things planned for inclusion. Right? (FWIW, I notice the activity list therein doesn't show your moving this PR to 8.11) Is the schedule posted somewhere and updated when it changes significantly? It would be helpful if the process was documented some (e.g. criteria for including PRs submitted after the release branch is first created), assuming there will be some consistency on that across releases. That might save release managers from some questions. Regarding this PR, "new feature" overstates its novelty. The current code can display diffs as part of the proof state after each tactic. The |
Indeed communication in the release process could be improved quite a bit. Not so long ago I added a link to the wiki from the readme tho https://github.com/coq/coq/wiki/Release-Plan I'm much afraid that this PR, given its current state, will miss 8.10. We can however get #10019 in if the PG developers confirm the tags are OK for them. |
bca1b57
to
6b3dcde
Compare
The current state is not what you think :-) Check the version I just pushed. |
You don't need to convince me but @vbgl |
stm/stm.ml
Outdated
stm_pperr_endline Pp.(fun () -> str "interpreting " ++ Ppvernac.pr_vernac expr); | ||
let doc = get_doc 0 in | ||
let dproof = get_prev_proof ~doc (get_current_state ~doc) in | ||
try Vernacentries.interp ?verbosely:(Some verbose) ?proof ~st dproof (CAst.make ?loc expr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that the previous proof needs to be added to a core function highlights the problem with overloading the base API which was already sketchy (Show
I'm looking at you)
It is not clear to me if we should keep adding kludges or the moment for UI developers has arrived: they either adopt a modern protocol or they renounce to advanced functionality.
vernac/vernacentries.ml
Outdated
@@ -2622,11 +2622,11 @@ let () = | |||
optwrite = ((:=) default_timeout) } | |||
|
|||
(* Be careful with the cache here in case of an exception. *) | |||
let interp ?(verbosely=true) ?proof ~st cmd = | |||
let interp ?(verbosely=true) ?proof ~st dproof cmd = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If dproof
appears all the time I guess it should be placed on Vernacstate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks much better, however the ownership/control of the previous proof has some small issues:
- the previous proof seems to be updated at the wrong place (should it be the state update function in
vernacentries
the one to update it?) - the function that fetches the old proof seems not correctly implemented.
My general reservations about the kluges are still on; IMHO we should not overload Show
in this way, but I won't oppose merging, the impact is pretty small and anyways the whole infrastructure needs cleanup.
Dear Jim, The schedule for the 8.10 release has been announced on the coqdev mailing list (see e.g., https://sympa.inria.fr/sympa/arc/coqdev/2019-01/msg00035.html). About one month ago (https://sympa.inria.fr/sympa/arc/coqdev/2019-03/msg00021.html) I wrote that “feature” PRs are no longer welcome in the 8.10 branch. I did not look at the changes that are in this PR and expressed no opinion about them. The first line of this PR description reads: “Kind: feature”. If you believe this is inaccurate, then please choose a different wording. Thank you for your work on improving the Coq ecosystem. Your contributions will reach the end users; probably as part of the outstanding 8.11 version. |
Set up the previous proof in Which one is the "state update function" in |
6b3dcde
to
30cae2d
Compare
@ejgallego Please take a look at the latest version, thanks. |
Indeed, you misunderstood. I can't find again the mail in which I told you this, otherwise I would quote it, but all I told you was the schedule of the beta and the final release, that left plenty of time for finalizing things like #10019. I never said that new features would be accepted during this period. If I were the RM, I would reject this PR from 8.10 just like @vbgl did. |
How to "fairly" evaluate that? |
I think the change wrt STM is OK for master. I don't think this this is so urgent to justify a backport: it brings very little to CoqIDE (since Don't get me wrong, It is clearly welcome to have a single proof diff feature that works for both UIs, but I believe it can be merged in master and be released in 6 month for the reason above. I also agree that this patch is only required because PG is still interacting with Coq in a simplistic way (no protocol), so the code of this PR is going to be removed as soon as PG evolves, or we provide a valid alternative. But since we are not there today, I think we cannot reject this kind of patches on the basis of what we would like, but we did not manage yet, to do. |
+1 |
@ejgallego Earlier you suggested moving the commands to g_toplevel but then you seem to have changed your mind on that, too. Just to be clear, is that a reasonable solution or not?
|
JFR, @cpitclaudel said "The [diff] feature you implemented is superior" in ProofGeneral/PG#421 (comment). He is one of the principal implementors of company-coq, the PG add-on which provides the diff feature you refer to. |
FWIW, I don't think there's much of a hurry (I don't use diffs very often, in fact). |
Indeed I had a look at this PR again and unfortunately the current approach is not going to work, specially after all the work done on the reifyication of vernacs. IMVHO the best bet is to place the |
This is going stale; I may close if not further updates before the end of the year [of course you are very welcome to re-open once you have time] |
Hi @ejgallego, Just FYI @jfehrle's initial post mentioned that
and that was indeed an issue! But for the record this is not the case anymore [roughly, instead of doing e.g. |
@erikmd is correct. This PR is less urgent but still worth doing. Just working on some higher priorities first. |
Dear PR author(s) and contributors, it seems to us this PR may need additional work beyond the 8.12 branching deadline on May 15th. We are thus removing the 8.12+beta1 milestone; please retarget as appropriate, and also consider updating labels to reflect current status, moving the PR to draft status, etc. We apologize in advance if we misunderstood the PR status. |
As discussed with Théo there seem to be some design questions about this PR, feel free to have a discussion in a Call or in Zulip when you would like to retake this. |
I'd like to clean this up but probably won't get to it for a month or 3. Still pretty focused on updating the syntax in the documentation. There's also the IMHO more urgent issue that @erikmd tells me he's finding How can we make these commands available in all user environments? |
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
This PR was not rebased after 30 days despite the warning, it is now closed. |
1 similar comment
This PR was not rebased after 30 days despite the warning, it is now closed. |
Kind: feature.
Currently these
Show
commands don't display diff highlights, which they should. Also, Proof General uses aShow
when it undoes a proof step, so there are no diff highlights. That makes the same proof step look different depending on whether you got to that step by going forward or backward.This PR adds that support.
One wart in this code is the need to create the reference variable Proof_global.get_prev_proof, which is set from Stm. The problem is that if Vernacentries calls Stm directly, it creates a circular dependency that won't compile or link. If anyone has a better idea, please let me know.
I hope we can get this into 8.10.