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

Glossary #48

Closed
24 of 27 tasks
mark-i-m opened this issue Feb 9, 2018 · 36 comments
Closed
24 of 27 tasks

Glossary #48

mark-i-m opened this issue Feb 9, 2018 · 36 comments
Labels
Easy Might be a good place for a beginner help wanted Extra attention is needed Medium Might require some prior knowledge or code reading

Comments

@mark-i-m
Copy link
Member

mark-i-m commented Feb 9, 2018

Are there any other terms that should be added to the glossary? Please make suggestions.

@mark-i-m mark-i-m added the help wanted Extra attention is needed label Feb 9, 2018
@phansch
Copy link
Member

phansch commented Feb 10, 2018

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?

@mark-i-m
Copy link
Member Author

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.

@mark-i-m mark-i-m added Easy Might be a good place for a beginner Medium Might require some prior knowledge or code reading labels Mar 16, 2018
@samWson
Copy link

samWson commented Apr 6, 2018

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.

@steveklabnik
Copy link
Member

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.

@hanna-kruppe
Copy link

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.

@samWson
Copy link

samWson commented Apr 6, 2018

"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.

@mark-i-m
Copy link
Member Author

mark-i-m commented Apr 6, 2018

I think we could add all of these terms to the glossary.

@samWson
Copy link

samWson commented Apr 7, 2018

Is this a case with of several phrases with the same meaning? Or are these the names of different things?

@mark-i-m
Copy link
Member Author

mark-i-m commented Apr 7, 2018

I believe "fat pointer", "wide pointer", and "double pointer" are all intended to be synonyms.

@samWson
Copy link

samWson commented Apr 7, 2018

I can enter this in the glossary as a single entry e.g.

Term Meaning
Fat pointer, wide pointer, double pointer "definition goes here"

Or I could make them separate entries, each referencing a single definition:

Term Meaning
Fat pointer Two word pointer with address and metadata
Wide pointer see fat pointer
double pointer see fat pointer

The second style makes it easier to find each individual term, as it keeps things in alphabetical order.

@Michael-F-Bryan
Copy link
Contributor

@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.

@mark-i-m
Copy link
Member Author

mark-i-m commented Apr 7, 2018

Perhaps we could also add that they are used for dyn Trait and slices?

@samWson
Copy link

samWson commented Apr 8, 2018

@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.

@samWson
Copy link

samWson commented Apr 8, 2018

Just submitted pull request #112 . Let me know what you think.

@varkor
Copy link
Member

varkor commented May 18, 2018

"Rib" and "upvar" should probably be mentioned too.

@mark-i-m
Copy link
Member Author

mark-i-m commented May 19, 2018

Yeah, upvar is one that has mystified me too...

@mark-i-m
Copy link
Member Author

mark-i-m commented Jun 4, 2018

Is an upvar basically a variable that is captured by a closure?

@varkor
Copy link
Member

varkor commented Jun 4, 2018

DST and ZST might also be worth including.

@mark-i-m
Copy link
Member Author

mark-i-m commented Jun 5, 2018

@varkor added in #152

@varkor
Copy link
Member

varkor commented Jul 22, 2018

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".

@mark-i-m
Copy link
Member Author

Thanks :)

@varkor would you mind opening a PR for that?

@mark-i-m mark-i-m pinned this issue Jan 23, 2019
@alexreg
Copy link
Contributor

alexreg commented Feb 14, 2019

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!

@mark-i-m
Copy link
Member Author

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...

@alexreg
Copy link
Contributor

alexreg commented Feb 14, 2019

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. :-)

@varkor
Copy link
Member

varkor commented Feb 14, 2019

@alexreg: most of these definitions can be found with a little sleuthing. I think this post explains early- and late-bound lifetimes, for example.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 14, 2019

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

@alexreg
Copy link
Contributor

alexreg commented Feb 14, 2019

@varkor @oli-obk Thanks. I'm not very good at searching. There are too many "references" rather than "definitions", which makes grepping harder than it should be.

@alexreg
Copy link
Contributor

alexreg commented Mar 7, 2019

@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.

@mark-i-m mark-i-m unpinned this issue Jun 26, 2019
@mark-i-m
Copy link
Member Author

mark-i-m commented Dec 6, 2019

Added "landing pad" to the list

@mark-i-m mark-i-m pinned this issue Dec 6, 2019
@tshepang
Copy link
Member

@alexreg did you refer to the (now removed) compiler flag ?

@alexreg
Copy link
Contributor

alexreg commented May 10, 2020

@tshepang I think you meant to tag @mark-i-m?

@tshepang
Copy link
Member

indeed I did

@tshepang
Copy link
Member

@alexreg what about gensym... it did itself get removed.

@alexreg
Copy link
Contributor

alexreg commented May 10, 2020

@tshepang Yep, good point. We can remove that from the list now.

@mark-i-m
Copy link
Member Author

I think the concept of landing pads still exists... not 100% sure, but I think they are code emitted for unwinding.

@mark-i-m mark-i-m unpinned this issue May 19, 2020
@mark-i-m
Copy link
Member Author

Closing this in favor of #707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Might be a good place for a beginner help wanted Extra attention is needed Medium Might require some prior knowledge or code reading
Projects
None yet
Development

No branches or pull requests

10 participants