-
Notifications
You must be signed in to change notification settings - Fork 564
Rework the introduction and add a scope chapter #2100
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
base: master
Are you sure you want to change the base?
Conversation
This elaborates the intro a little, and moves the bug note (since I do not consider it to be so important to be at the very beginning).
This describes who the Reference is for. This links to the upcoming scope chapter which is in a future commit. Closes rust-lang#550
This is in preparation to rearrange notational conventions. This chapter *only* deals with grammar, so let's be explicit about that.
The intent here is to tie together the different conventions used in the book (with the grammar), and to provide a more focused place to house this content. I've also noticed this is a more common approach to including this kind of content.
This changes the conventions chapter to use sections instead of a list. It also rearranges the order into something that for whatever reason seems a little more logical to me.
For whatever reason, I feel like this flows a little better as "how to read" is directly tied to the audience (the reader). It also doesn't seem to be a very high priority section to me.
This chapter describes exactly what is in and out of scope for the Reference, along with the characteristics of how it is covered.
|
|
||
| - Valid syntax and forms. | ||
| - Meaning and interpretation of the syntax. | ||
| - Semantic properties of the runtime behavior. |
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.
What exactly is meant by "Semantic properties of the runtime behavior"? This sounds vaguely opsem-related and yet I have no idea what you mean. ;)
FWIW, in a typical PL textbook, we'd typically have 3 stages for defining a language; I am not sure if the first three items are meant to match that.
- Formal grammar (corresponds to "valid syntax and forms" I think)
- Static semantics -- this is the type system and all the other static checks the compiler might be doing (in Rust that would include borrow checking [unless you consider that to be part of the type system], const checking, things like that)
- Dynamic semantics -- the set of legal "observable behaviors" or "outcomes" or whatever you want to call it of any program
This reworks the introduction and adds a scope chapter to hopefully make it clearer exactly what the Reference is intended to cover. In summary, the changes are:
This is based on my understanding of how the Reference currently works.
The goal is to provide guidance on all the topics covered here. However, since a lot of these guidelines use subjective words (such as "significant" or "exceptional"), it may not provide enough guidance. I expect that some of this may need more elaboration in the future to resolve uncertainties.
Should we document when features are stabilized?
Closes #60
Answer: The scope now says version history is out of scope.
Clarify the audience and goals of the reference
Closes #550
Answer: Introduction now has an audience section.
Policy: Past behavior
Closes #2024
Answer: The scope now says past behavior is out of scope.
Guidelines for parts that are incomplete or undecided
Closes #2025
Answer: The completness section largely covers this. There's a few points here that aren't really covered, but I couldn't think of a way to incorporate them:
Guidelines for parts that are intentionally unspecified
Closes #2026
Answer: Covered in "unspecified behavior".
Guidelines for referring to rustc lints
Closes #2027
Answer: Covered in scope chapter.
Guidelines for documenting intended vs actual behavior
Closes #2037
Answer: This is largely covered in the intended behavior section. It uses subjective wording, which maybe isn't super helpful. It also doesn't get really explicit about when to link to an issue or how to handle future-incompatible-warnings. However, I think the spirit is there, and it's hard to be clearer.
Guidelines for deprecated language features and intended future changes
Closes #2038
Answer: Covered in the scope chapter. Notes:
Guidelines for linking to other documentation
Closes #2039
Answer: I think this is largely covered in out-of-scope, and other places.
Guidelines for implementation-specific rules
Closes #2040
Answer: Essentially we have decided that we won't have a special "implementation-defined" category for now. The Reference will be explicit about the allowed behavior (even if that means there are different options), leave it up to unspecified-behavior, or leave it up to special uncovered topics like certain target-specific behavior.
This is not explicitly stated in the scope since it is covered by other things.
Guidelines for documenting the why of something
Closes #2042
Answer: The new scope rationale section is brief, but I think largely covers this. There are subjective words for the guidelines, which maybe isn't super helpful. But I can't think of super clear guidance without going in too deep with examples and such.
Guidelines for referring to tools and compilers
Closes #2043
Answer: I think this is generally covered, though it still uses subjective adjectives like "significant" or "exceptional".