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
Support for deprecating a file #18193
Conversation
Thank you! If I may, some first (probably very naive, really at user level) impressions:
Again, these are really first impressions from a non-specialist. Feel free to ignore them. |
Other things that come in mind:
|
This ambiguity should indeed be resolved. In commands such as I agree with your other comments. |
Agree, but that's a somewhat orthogonal feature. I'd propose the following course of actions in order to make quick and effective progress on those long stalled points:
|
vernac/docstring.ml
Outdated
| None -> | ||
let info_cat = CWarnings.create_category ~name:"info" () in | ||
let main_name = "info-warning" in | ||
let main_cat, main_w = CWarnings.(create_hybrid ~name:main_name ~from:[info_cat] ()) in |
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.
Why is this hybrid? main_w looks unused.
Also what's the point of having nested categories info
and info-warning
?
You should just do let info_cat = CWarnings.create_category ~name:"info" ()
at toplevel and then let w = CWarnings.create ~category:info_cat ~name:("info-" ^ name) pp
(when not in the table)
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.
With your change, it gives the warnings info-MyRoot.MyFile,info,default
which seems ok.
I'm not familiar with the design of the warning and deprecation system. What should it be for deprecation? Should it be deprecated-libraries-since-8.XX,deprecated-since-8.XX,deprecated-libraries,deprecated,default
(on the model of what is done for abbreviations)? Something different?
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.
I pushed a new version that includes deprecation. As of now, it works as follows:
- in file foo.v:
Library Warning "This implements foo arithmetic". Library Deprecation since "8.18" "Please use bar arithmetic".
- output at require time:
Toplevel input, characters 0-12: > Require Foo. > ^^^^^^^^^^^^ Warning: Library Foo is deprecated since 8.4. Please use bar arithmetic [deprecated-libraries-since-8.4,deprecated-since-8.4,deprecated-libraries,deprecated,default] Toplevel input, characters 0-12: > Require Foo. > ^^^^^^^^^^^^^ Warning: This implements foo arithmetic [info-Foo,info,default]
PS: To be clear, I'm not attached to any syntax, nor to any particular solution. My motivation is primarily that this is needed for other PRs.
Indeed I agree with @proux01 . While I'm not against with the implementation the PR provides for docstrings, there are a few questions around them, related to the libobject CEP , and some questions about usability, etc... I have thought about this problem for a while. IMHO it would be great to collaborate on a design with all the knowlegde we have, once we converge, we can go ahead and implement it. How does it sound folks to meet one day over Zoom to discuss? |
Sure. I can today any time, and otherwise from Thursday afternoon. (Is there some literature to read already?) |
What about discussing it shortly during the call tomorrow (it's been added to the roadmap anyway) and plan a specific meeting with anyone interested, to have more in depth discussions? |
Would it work for you Hugo if we ask in Zulip , we can do a framadate? I'm happy to explain what I know about docstrings in 5 minutes in the meeting, but indeed, off the top of my head, the liberabaci proposal included quite a few ideas, Hiearchy Builder has a docstring system, and the libobject PR has some discussion about this too. Some issues to consider:
|
That also works for me! |
That's a question I had. If the GUI does the job (e.g. by linking directly to the source), would docstring be really necessary??? |
We have use cases in hierarchy-builder (current |
1e33384
to
4f1b60c
Compare
Is there something to read about it? And what are the docstring plans regarding HB? |
ping @pi8027 |
During the Dagstuhl Seminar 23401, some people worked on a mapping from definitions in MathComp to their informal description and corresponding Wikidata tags (like Q534381). A feature of Coq to attach some metadata to definitions would have several use cases, e.g., generate nicer documentation (like mathlib), generate relational data similar to one done in the Dagstuhl Seminar, and look up the description of the definition through the So, I think we first have to discuss the design of the docstring feature we need and eventually open a CEP. We will have a meeting to discuss it (mainly between MathComp dev and some participants of the Dagstuhl Seminar) this Thursday at 16:00 Paris Time. Let me know if you want to participate in it. |
Very nice!
If things are already moving on your side, my presence is probably not necessary. In any case, this is great news. |
Regarding the PR, considering that warning/deprecation is not the kind of data mentioned by @pi8027, considering the related question of GUI support, and considering @proux01's suggestion of consolidate and merging the PR for deprecating files, I'm going to stop here with the implementation (up to an agreement on the user facing syntax). |
@herbelin (also @ejgallego) It seems that discussions about docstring-like features are happening in several groups of people. I first want to make sure that we understand the needs of each other. So I would appreciate your presence. |
Thanks @pi8027 , I was not aware this was happening, happy to be there! |
Thanks! Note however that it is not clear yet whether I will be able to attend, but I'll try. Note also that I don't have precise ideas about docstring. I was seduced by the projects of Florian R. at some time (but without time to work on it myself), and by the Logipedia projects too. I consider that Coq documents should be more structured, connected to ontologies, supporting classifications, and machine learning would probably benefit of it. Somehow, this should also be integrated with coqdoc (and with GUI). |
2873542
to
afbde6d
Compare
@herbelin during yesterday's call there was an agreement on |
It is ok. Thanks! |
The attribute "deprecated" is supported. Co-authored-by: Jim Fehrle <jim.fehrle@gmail.com>
afbde6d
to
56c4e51
Compare
@coqbot merge now |
@proux01: You can't merge the PR because it hasn't been approved yet. |
@coqbot merge now |
I'm just discovering that this is transitive, making it hardly usable: A.v Attributes deprecated(note="A deprecated"). B.v Require Import A.
(* warning as expected *) C.v Require Import B.
(* also a warning *) |
To have it only if textually mentioned in a |
Thanks, that's indeed what I have in a patch, I'm opening a PR. |
Following coq#18193 we had the following behavior: in A.v Attributes deprecated(note="A deprecated"). in B.v Require Import A. (* warning as expected *) in C.v Require Import B. (* also a warning *) Whereas we don't want the warning in the last case. This triggers the warnings only when directly requiring a file.
Following coq#18193 we had the following behavior: in A.v Attributes deprecated(note="A deprecated"). in B.v Require Import A. (* warning as expected *) in C.v Require Import B. (* also a warning *) Whereas we don't want the warning in the last case. This triggers the warnings only when directly requiring a file.
Following coq#18193 we had the following behavior: in A.v Attributes deprecated(note="A deprecated"). in B.v Require Import A. (* warning as expected *) in C.v Require Import B. (* also a warning *) Whereas we don't want the warning in the last case. This triggers the warnings only when directly requiring a file.
Following coq#18193 we had the following behavior: in A.v Attributes deprecated(note="A deprecated"). in B.v Require Import A. (* warning as expected *) in C.v Require Import B. (* also a warning *) Whereas we don't want the warning in the last case. This triggers the warnings only when directly requiring a file.
Following coq#18193 we had the following behavior: in A.v Attributes deprecated(note="A deprecated"). in B.v Require Import A. (* warning as expected *) in C.v Require Import B. (* also a warning *) Whereas we don't want the warning in the last case. This triggers the warnings only when directly requiring a file. (cherry picked from commit 3cbcc49)
Following #18193 we had the following behavior: in A.v Attributes deprecated(note="A deprecated"). in B.v Require Import A. (* warning as expected *) in C.v Require Import B. (* also a warning *) Whereas we don't want the warning in the last case. This triggers the warnings only when directly requiring a file. (cherry picked from commit 3cbcc49)
This is an experimental support for associating comments or warnings to global names.This provides support for associating warnings or deprecation to a library file.
As an example, two commandsLibrary Comment string.
andLibrary Warning string.
areA command
Library Attributes #[...]
is provided, with the idea that it could be used to warn about the status of some files (as e.g. for #18032, w/o requiring the indirection of an abbreviation, nor to rely on the deprecation system).The supported attributes are
deprecated(...)
andinformation="..."
.Fixes: #8032