-
Notifications
You must be signed in to change notification settings - Fork 521
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
Glossary #48
Comments
One thing I have been wondering is if 'soundness' means something special in the compiler context or if it is just a different word for correctness. There are lot's of issues mentioning 'soundness bugs' and 'soundness fixes'. So maybe it makes sense to add this too or explain it somewhere? |
Yes, soundness is a technical term in programming languages literature. You will usually read about proving "soundness" and "completeness". Roughly, IIRC, soundness means that if a program type-checks, it is type-safe; i.e. I can never (in safe rust) force a value into a variable if the wrong type. Completeness means that every type-safe program also type-checks. Having both is very hard, and usually soundness is more important. |
I've found a good definition of Fat Pointers in the Programming Rust book. I can enter that in the glossary this weekend if it's OK with you team. |
We've been using "double pointer" or "wide pointer" as well; might be worth considering as "double pointer" at least is significantly more descriptive, IMO. |
FWIW "double pointer" can also be read as "pointer-to-pointer" (and I've definitely seen it used in that sense in other languages). Besides, double becomes inaccurate with custom DSTs (which can add more data than just one word to the pointer). One precise and universal phrase is "pointer with metadata" but that's probably a bit too verbose. |
"Pointer with metadata" is what I've found the definition of a fat pointer to be. A two word value with an address and some extra information needed to put the value to use. |
I think we could add all of these terms to the glossary. |
Is this a case with of several phrases with the same meaning? Or are these the names of different things? |
I believe "fat pointer", "wide pointer", and "double pointer" are all intended to be synonyms. |
I can enter this in the glossary as a single entry e.g.
Or I could make them separate entries, each referencing a single definition:
The second style makes it easier to find each individual term, as it keeps things in alphabetical order. |
@samWson I think the second option is best. "Fat pointer" is by far the most popular name for the concept of a pointer with some extra "metadata" attached, so if people want to lookup the term "wide pointer" we should redirect them to the canonical term. |
Perhaps we could also add that they are used for dyn Trait and slices? |
@mark-i-m Of course. I'll put in a longer definition in the glossary. I only omitted it in my comment for brevity. I'll have a PR ready soon. |
Just submitted pull request #112 . Let me know what you think. |
"Rib" and "upvar" should probably be mentioned too. |
Yeah, upvar is one that has mystified me too... |
Is an |
DST and ZST might also be worth including. |
It'd be good to explicitly define "item" too, as it's not immediately clear from the source exactly what things can be items. And "early-bound lifetime" and "late-bound lifetime". Edit: and "lang item". |
Thanks :) @varkor would you mind opening a PR for that? |
It would be really nice to have a definition for "late-bound regions/lifetimes" in the glossary... I still have no bloody clue what these things are! |
Unfortunately, there is a lack of people who know definitions to things, so this list is just getting longer... Not sure what to do about that... |
I can probably help with some of these... though I wouldn't call myself an authority. Borrow checking is pretty arcane magic as far as I'm concerned. We might have to draft in @nikomatsakis for this. Even if he (or someone like him) could leave comments on this post, then someone could formalise the definitions and create a PR maybe. :-) |
There are also some (albeit not necessarily easy to decipher) explanations in the internals docs: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/enum.RegionKind.html#bound-regions |
@mark-i-m Can we add "gensym" to the list please? That's a weird term that I'm still not entirely sure what it means. |
Added "landing pad" to the list |
@alexreg did you refer to the (now removed) compiler flag ? |
indeed I did |
@alexreg what about gensym... it did itself get removed. |
@tshepang Yep, good point. We can remove that from the list now. |
I think the concept of landing pads still exists... not 100% sure, but I think they are code emitted for unwinding. |
Closing this in favor of #707 |
Are there any other terms that should be added to the glossary? Please make suggestions.
gensymskolemization leakThe text was updated successfully, but these errors were encountered: