Skip to content

Define "abstraction pattern" and "reabstraction" in the Lexicon. #6493

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

Merged
merged 1 commit into from
Jan 4, 2017

Conversation

jckarter
Copy link
Contributor

No description provided.

@jckarter
Copy link
Contributor Author

@swift-ci Please smoke test

@jckarter
Copy link
Contributor Author

Does this look reasonable, @jrose-apple or @rjmccall? Hard to judge what level of depth to get into defining these terms here.

var value: (T) -> U // Bar.value has abstraction pattern <T, U> (T)->U
}
struct Bas {
var value: (Int) -> String // Bas.value has abstraction pattern
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't you forget the pattern here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, thanks @JaSpa!

@jckarter jckarter force-pushed the abstraction-terms-in-glossary branch from 746a88f to 0be782d Compare December 27, 2016 02:49
@jckarter
Copy link
Contributor Author

jckarter commented Jan 3, 2017

@swift-ci Please smoke test

@@ -23,6 +23,40 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
generic context. Sometimes known as a "rigid type variable" in formal
CS literature. Directly stores its conforming protocols and nested
archetypes, if any.

abstraction pattern
Copy link
Contributor

Choose a reason for hiding this comment

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

Alphabetical, please. :-)

direct register-based calling convention. The compiler transparently
introduces `reabstraction` conversions when a value is used with a
different abstraction pattern. (This is where the infamous "reabstraction
thunk helpers" you sometimes see in Swift backtraces come from.)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I think this is the right level of detail but the wrong audience. Lexicon.rst is aimed at contributors to swiftc rather than users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you're referring to exactly. Compiler developers do also have to look at backtraces sometimes…

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough. I guess I was just going for a "dictionary" tone rather than an "instructing" tone; there isn't an implied "you" in any of the other terms. Not that important.

@@ -235,6 +269,10 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_.
IR generation.
See `mandatory passes <mandatory passes / mandatory optimizations>`.

reabstraction
An implicit representation change that occurs when a value is used with
a different `abstraction pattern` from its current representation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, do we not consider things reabstractions unless they change a representation like this? (e.g. Optional to non-Optional in covariant overrides)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting question. We do use the "abstraction pattern" concept to govern method representations, so variance-related thunks could indeed be considered reabstractions.

@jckarter
Copy link
Contributor Author

jckarter commented Jan 4, 2017

@swift-ci Please smoke test

@jckarter jckarter force-pushed the abstraction-terms-in-glossary branch from 0be782d to 645a470 Compare January 4, 2017 02:55
@jckarter
Copy link
Contributor Author

jckarter commented Jan 4, 2017

@jrose-apple Revised to fix alphabetical order and remove wanton second-person pronouns.

@jrose-apple
Copy link
Contributor

@swift-ci Please smoke test

@jckarter jckarter merged commit a744b45 into swiftlang:master Jan 4, 2017
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.

3 participants