Skip to content
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

Refactor the spec to better explain the semantic model #497

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

mtdowling
Copy link
Member

The semantic model is a much more important concept now that we have two
representations for models (the AST and IDL), and these representations
are meant to build up the same graph of shapes regardless of their
different syntactic features. The spec is also now laid out in an easier
to understand way since it explains the high-level concepts, shapes, and
traits before diving into the details of the IDL ABNF.

Various aspects of the model have been clarified:

  • Applying traits externally is the same as applying them inline in the
    semantic model.
  • Simplifications to the documentation_comment ABNF so that it is now
    just one of the two kinds of comment productions.
  • A broader overview of the model, including transformations.
  • More information on namespaces, including that there can be multiple
    namespaces loaded into the semantic model.
  • More information on how and why models would be merged together (it's
    left up to tooling to combine and merge models, but the semantics of
    merging models are described in the spec).
  • Lots of minor error corrections in the spec.
  • The special behavior around resolving relative shape IDs in the
    "conflicts" property of the trait trait have been removed since that
    is at odds with the rest of the model.

This commit moves various headings around and removes some pages, but
redirects are issued when a removed page is visited.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mtdowling mtdowling requested a review from kstich July 14, 2020 22:02
@@ -158,12 +157,6 @@ public Builder selector(Selector selector) {

public Builder addConflict(String trait) {
Objects.requireNonNull(trait);

// Use absolute trait names.
if (!trait.contains("#")) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider this a bug since it's at odds with how literally every other value is resolved to a shape ID. There were two instances that used this in the prelude that were fixed. I did not see any other cases that would be affected by this in models that I sampled.

Shapes
======
============
Smithy model
Copy link

@johnstonskj johnstonskj Jul 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title seems very vague, it's not clear which "model" you mean without qualification in the title.

  • Change "Smithy overview" to "Smithy framework", which matches the figure caption
  • Change "Semantic model" to "The semantic model"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The title seems very vague, it's not clear which "model" you mean without qualification in the title.

How about "Smithy overview"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of like calling this "The Smithy model" still, and making the first sentence something like:

The Smithy model describes the Smithy semantic model and the files used to create it. Smithy models are used to describe services and data structures.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the overloading, but I can live with it

@mtdowling mtdowling force-pushed the refactor-spec-for-semantic-model branch from 0d4a21a to 4d344f2 Compare July 15, 2020 07:27
docs/source/1.0/spec/core/json-ast.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/model.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/model.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/model.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/model.rst Show resolved Hide resolved
docs/source/1.0/spec/core/idl.rst Show resolved Hide resolved
docs/source/1.0/spec/core/idl.rst Show resolved Hide resolved
docs/source/1.0/spec/core/idl.rst Show resolved Hide resolved
docs/source/1.0/spec/core/idl.rst Outdated Show resolved Hide resolved
docs/source/1.0/spec/core/idl.rst Outdated Show resolved Hide resolved
docs/smithy/__init__.py Show resolved Hide resolved
docs/source/1.0/spec/core/model.rst Outdated Show resolved Hide resolved
@mtdowling mtdowling requested a review from JordonPhillips July 15, 2020 21:24
The semantic model is a much more important concept now that we have two
representations for models (the AST and IDL), and these representations
are meant to build up the same graph of shapes regardless of their
different syntactic features. The spec is also now laid out in an easier
to understand way since it explains the high-level concepts, shapes, and
traits before diving into the details of the IDL ABNF.

Various aspects of the model have been clarified:

* Applying traits externally is the same as applying them inline in the
  semantic model.
* Simplifications to the documentation_comment ABNF so that it is now
  just one of the two kinds of `comment` productions.
* A broader overview of the model, including transformations.
* More information on namespaces, including that there can be multiple
  namespaces loaded into the semantic model.
* More information on how and why models would be merged together (it's
  left up to tooling to combine and merge models, but the semantics of
  merging models are described in the spec).
* Lots of minor error corrections in the spec.
* The special behavior around resolving relative shape IDs in the
  "conflicts" property of the `trait` trait have been removed since that
  is at odds with the rest of the model.

This commit moves various headings around and removes some pages, but
redirects are issued when a removed page is visited.

This commit also ensures that requirements.txt is used for docs.
Since we're using a github repo for the redirects package, we need to
install it using a special syntax. There some docs around how to pull
this off with setup.py, but I couldn't get it to work:
https://python-packaging.readthedocs.io/en/latest/dependencies.html#packages-not-on-pypi
@mtdowling mtdowling force-pushed the refactor-spec-for-semantic-model branch from 10448b3 to 627e7e9 Compare July 16, 2020 00:20
@mtdowling mtdowling merged commit 3dbe356 into master Jul 16, 2020
@mtdowling mtdowling deleted the refactor-spec-for-semantic-model branch August 7, 2020 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants