right, from my POV 'owned has its own problems here. I kinda like the symmetry of 'static, but I feel like the fixes here are in how we teach this, not in introducing a new thing
-
-
Replying to @ManishEarth @mgattozzi and
I am open to alternative suggestions but I don't know how one would go about teaching people this better than we already do without making changes to the language.
1 reply 0 retweets 0 likes -
Replying to @yaahc_ @ManishEarth and
We could add material everywhere but in the end I feel like the easiest way to get ppl to learn this is to make it distinct and require that they look it up. The problem with 'static is that people assume they understand what it means but they really don't.
2 replies 0 retweets 1 like -
Replying to @yaahc_ @ManishEarth and
what we really need is a distinct lifetime that means "until the end of the program" that doesn't make it seem like the memory MUST live until the end of the program, which is the main problem with static. 'forever, 'none, 'end-days, whatever
2 replies 0 retweets 1 like -
Replying to @yaahc_ @ManishEarth and
As long as its distinct from 'static, because to me a 'static lifetime really feels like the one and only concrete named lifetime in rust, to me it means data that just exists forever. Where as a 'static lifetime bound is much more abstract in nature.
1 reply 0 retweets 0 likes -
Replying to @yaahc_ @ManishEarth and
It's cool how we looked at the thirteen different interpretations of that keyword in C and said "that sucks" and did it anyway anyway I feel like 'top would be okay for "outlives, but is not in the data segment"
1 reply 0 retweets 4 likes -
still strongly believe we're using `'static` and `static` to mean the same thing everywhere, it's just that the discovery path for this mental model isn't clear the actual confusing thing is that `'a` and `: 'a` don't work the same way
3 replies 0 retweets 8 likes -
Replying to @ManishEarth @yaahc_ and
static the declaration very firmly means "has exactly one address allocated by the linker" while static the lifetime just means "you'll die before it does", which is the set of things allocated by the linker and also by mem::forget
2 replies 0 retweets 3 likes -
right, to me those are basically the same, "you'll die before it does" implies it came from a `static` (usually) `T: 'static` means "T is allowed to live as long as a static"
1 reply 0 retweets 2 likes -
Replying to @ManishEarth @yaahc_ and
wait hang on you know what the most sensible lifetime name for "this will outlive you" is? 'self objects with 'static are allowed to eventually die, but statics aren't. when we want to say "I determine my own lifetime", then incoming data must be 'self in order to not bind me
2 replies 0 retweets 4 likes
I think it's unfortunate that `'static` is conflated with `static` variables here. I thought it meant "static" as in unchanging. As in there is no variable in the type which could change and affect the lifetime
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.