Live data from Hacker News

RFC: Rust Has Provenance

github.com

1–10 of 19 posts

Re: RFC: Rust Has Provenance

#2
> The pointer's "provenance" says where in memory the pointer is allowed to access when.

Is that the definition of provenance or is there a wider definition that we should know?

Re: RFC: Rust Has Provenance

#3
post #2

> The pointer's "provenance" says where in memory the pointer is allowed to access when. Is that the definition of provenance or is there a wider definition that we should know?

See the doc for a definition: https://github.com/RalfJung/rfcs/blob/provenance/text/0000-r...

Re: RFC: Rust Has Provenance

#4
post #2

> The pointer's "provenance" says where in memory the pointer is allowed to access when. Is that the definition of provenance or is there a wider definition that we should know?

"where in memory the pointer is allowed to access when." - ... when what?

Sorry, this sentence is difficult to understand.

Re: RFC: Rust Has Provenance

#5
post #4
post #2

> The pointer's "provenance" says where in memory the pointer is allowed to access when. Is that the definition of provenance or is there a wider definition that we should know?

"where in memory the pointer is allowed to access when." - ... when what? Sorry, this sentence is difficult to understand.

Probably just a mistake. I just would assume that the word "when" is superfluous and respond in a way that allows the asker to correct their mistake but not invest too much in an answer because the assumption might be wrong.

I am picky in language as well, so I understand where you are coming from. But I discovered that LLMs often answered anyway when my question was incomplete or contained mistakes and they got it correct not too rarely.

It's a useful trick I discovered late in my life (I am in my fifties). I started to use it with my children and my wife. Their utterances are often not mathematically and linguistically perfect, but very human and lovely. When I got stumped I just thought about what they might have asked and answered that. More often than not they were happy with my answer.

Re: RFC: Rust Has Provenance

#6
post #4
post #2

> The pointer's "provenance" says where in memory the pointer is allowed to access when. Is that the definition of provenance or is there a wider definition that we should know?

"where in memory the pointer is allowed to access when." - ... when what? Sorry, this sentence is difficult to understand.

‘when’ here meaning “and under what circumstances”. An ‘and’ might help

Re: RFC: Rust Has Provenance

#7
post #5
post #4

Earlier quoted context omitted.

"where in memory the pointer is allowed to access when." - ... when what? Sorry, this sentence is difficult to understand.

Probably just a mistake. I just would assume that the word "when" is superfluous and respond in a way that allows the asker to correct their mistake but not invest too much in an answer because the assumption might be wrong. I am picky in language as well, so I understand where you are coming from. But I discovered that LLMs often answered anyway when my question was incomplete or contained mistakes and they got it c…

It’s just a multiple wh construction as in

    Who arrived when?
which you might answer with e.g. “John on Tuesday and Mary on Wednesday”. This one is a bit harder to parse because it’s longer, but the answers will be something like “it can access region A at time T, region B at time T’, …”

Re: RFC: Rust Has Provenance

#8
post #7
post #5

Earlier quoted context omitted.

Probably just a mistake. I just would assume that the word "when" is superfluous and respond in a way that allows the asker to correct their mistake but not invest too much in an answer because the assumption might be wrong. I am picky in language as well, so I understand where you are coming from. But I discovered that LLMs often answered anyway when my question was incomplete or contained mistakes and they got it c…

It’s just a multiple wh construction as in Who arrived when? which you might answer with e.g. “John on Tuesday and Mary on Wednesday”. This one is a bit harder to parse because it’s longer, but the answers will be something like “it can access region A at time T, region B at time T’, …”

Right, in particular objects (in the general sense, not the OOP sense) have lifetimes and so the provenance of a pointer to or into that object is restricted to the lifetime.

If I make a Box some heap is allocated and my Goose is in there, and I can get myself a pointer to that Goose, but the pointer must not be used either before I made the Box or after it's dropped.

Re: RFC: Rust Has Provenance

#9
post #2

> The pointer's "provenance" says where in memory the pointer is allowed to access when. Is that the definition of provenance or is there a wider definition that we should know?

Isn't this a definition of lifetimes too?

A lifetime is some set of memory a reference may refer to. Consider:

fn foo(x: &'a str, y: &'b str) -> &'a str

Aren't 'a and 'b sets of memory a reference can refer to? As far as this function call is concerned, both 'a and 'b will live throughout, so it's not about life and death, it's about what memory the references may refer too.

Is a lifetime and a "provenance" the same thing?

Re: RFC: Rust Has Provenance

#10
post #2

> The pointer's "provenance" says where in memory the pointer is allowed to access when. Is that the definition of provenance or is there a wider definition that we should know?

Isn't this a definition of lifetimes too? A lifetime is some set of memory a reference may refer to. Consider: fn foo (x: &'a str, y: &'b str) -> &'a str Aren't 'a and 'b sets of memory a reference can refer to? As far as this function call is concerned, both 'a and 'b will live throughout, so it's not about life and death, it's about what memory the references may refer too. Is a lifetime and a "provenance" the same…

> Aren't 'a and 'b sets of memory a reference can refer to?

No, the set of memory the reference refers to is encoded by the reference's bits. Two references with the same lifetime can refer to different memory, and vice-versa. Lifetimes determine when the reference is valid.

Post reply on HN