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

[Coding Guidelines] Review of Unsafe Coding Guidelines Reference Glossary #123

Open
PLeVasseur opened this issue Dec 5, 2024 · 13 comments
Assignees
Labels
coding guidelines Related to work in the Coding Guidelines Subcommittee

Comments

@PLeVasseur
Copy link
Collaborator

PLeVasseur commented Dec 5, 2024

Hey folks 👋

Based on the discussion we had yesterday in our Coding Guidelines Subcommittee meeting, I'd like to propose we divvy up entries from the glossary of the Unsafe Coding Guidelines Reference.

The idea here is for each entry to ideally have four eyeballs (two people) to review it, dive into the current state within Rust, and become a bit more familiar with talking about them. How you become familiar is up to you -- writing up a small paragraph, trying some Rust code and so on.

The goal is to think about how someone would wish they had this material presented to them in a practical fashion so they can write safe unsafe software. Our review of materials here can help inspire us on how to contribute further chapters toward Learn unsafe Rust.

May depend a bit on how many folks jump in, but I'd propose starting with each person having say, 3-4 entries to allow for that deep dive.

I'll list up these entries below. If you're interested, please reply with the 3 or 4 entries you'd like to review and I'll update the table.

Glossary Entry Interested
ABI (of a type)
Abstract Byte @PLeVasseur
Aliasing
Allocation
Interior Mutability @Dillonmcewan
Layout
Memory Addresses
Niche
Padding
Place @PLeVasseur
Pointer Provenance @PLeVasseur, @Dillonmcewan
Representation (relation)
Soundness (of code / of a library) @vapdrs
Undefined Behavior @vapdrs
Validity and safety invariant @vapdrs
Value
Zero-sized type / ZST @Dillonmcewan
@PLeVasseur PLeVasseur added the coding guidelines Related to work in the Coding Guidelines Subcommittee label Dec 5, 2024
@vapdrs
Copy link
Contributor

vapdrs commented Dec 5, 2024

I'd like to review,

@PLeVasseur PLeVasseur self-assigned this Dec 5, 2024
@Dillonmcewan
Copy link

Interested in:

@Manishearth
Copy link

Based on the discussion we had yesterday in our Coding Guidelines Subcommittee meeting, I'd like to propose we divvy up entries from the glossary of the Unsafe Coding Guidelines Reference.

This is a great idea, the Learn Unsafe Rust book's chapter organization is currently a mess and we probably could do much better.

@PLeVasseur
Copy link
Collaborator Author

PLeVasseur commented Dec 10, 2024

@Manishearth -- as we're looking to contribute to the Learn unsafe Rust book, a couple of questions:

  1. Does the effort we're starting off over here to write up a bit of a practicum make sense as a contribution to Learn unsafe Rust?
  2. Are there particular areas of the Learn unsafe Rust book that would make sense to flesh out in a particular order? Could help focus on the ordering of sections of the glossary we review. (Speaking just for myself, I'm relatively newbie when it comes to unsafe)

@Manishearth
Copy link

(Sorry, been extremely busy these weeks, I'm going to try and respond to this soon)

@iglesias
Copy link

Hey, nice to e-meet you, I started going through the info and I'd like to review

@PLeVasseur
Copy link
Collaborator Author

PLeVasseur commented Dec 18, 2024

Hi @iglesias 👋

Would love to have more contributions!

Have you joined the consortium and the coding guidelines subcommittee?

Here's a link to the issue templates.

If you could do these couple of steps, I'll go ahead and add your items you're interested in into the table ✌️

@iglesias
Copy link

Hi @PLeVasseur

I opened this issue to apply for the consortium with motivation, noticed it was closed and then got the invitation through gmail to today's coding guidelines subcommittee meeting. Does it mean the application to the consortium went through?

In any case, I will open the issue for the coding guidelines subcommittee.

Thanks for the swift reply!

@pellico
Copy link

pellico commented Dec 18, 2024

Hi @PLeVasseur ,
I would like to review:

  • Undefined Behavior
  • ABI
  • Layout
  • Soundness

@adfernandes
Copy link

adfernandes commented Dec 18, 2024

I'd be happy to add sections/definitions on the following:

  • Regulatory Approach (objective-based vs Risk-Based)
  • Spatial Safety (à la "mutable xor shareable")
  • Temporal Safety
    • concurrency, infinite loops, liveness, and deadlocks
  • Modified Condition / Decision Coverage (MC/DC) verification and validation
  • Integer overflow / underflow
  • Functional "purity" and "side effects"

@Manishearth
Copy link

  • Does the effort we're starting off over here to write up a bit of a practicum make sense as a contribution to Learn unsafe Rust?

It's a nice example, would this be like a tour through the different parts? That would work nicely as an introduction.

2. Are there particular areas of the Learn unsafe Rust book that would make sense to flesh out in a particular order? Could help focus on the ordering of sections of the glossary we review. (Speaking just for myself, I'm relatively newbie when it comes to unsafe)

Yeah even figuring out what sections the book should have, and in which order, is a huge help.

In general my goals for each chapter are:

  • They should talk about a specific topic
  • They should tell you how UB around that topic works
  • They should tell you when thinking about that topic is relevant (Sometimes it's not obvious! Dealing with padding can end up with validity/uninit issues, for example)
  • They should tell you common techniques for safely working with it
  • They should tell you what is yet-to-be-decided on the topic, and ideally have some advice on how to work around these specification holes, or assumptions on the specification's future that can be safely made.

@Manishearth
Copy link

Yeah even figuring out what sections the book should have, and in which order, is a huge help.

Though I do think this should be done by someone who has a really good understanding of how unsafe works in Rust. There's a certain flow to it, many things depend on many other things.

@PLeVasseur
Copy link
Collaborator Author

It's a nice example, would this be like a tour through the different parts? That would work nicely as an introduction.

That's my thought: a tour through. Intro might be a nice idea for where it fits in.

Though I do think this should be done by someone who has a really good understanding of how unsafe works in Rust. There's a certain flow to it, many things depend on many other things.

While I serve as chair, I would not put myself among the crowd that has this level of understanding, frankly. As I've begun to learn more about unsafe, it's true that there's many interlocking pieces. Anyone else in the subcommittee that does I'd welcome to help guide section choice and ordering!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coding guidelines Related to work in the Coding Guidelines Subcommittee
Projects
None yet
Development

No branches or pull requests

7 participants