Reason #18723 why I hate Actix and think the Rust community really should abandon ship on it and work on alternatives like warp, tower, gotham or rocket https://twitter.com/whitequark/status/1217945196400447488 …
-
This Tweet is unavailable.Show this thread
-
Replying to @mgattozzi
It's annoying because the community has gone way overboard with the "no unsafe ever" trend, and I want to be on the maintainer's side. But holy shit their reactions on the issue tracker are ridiculous
2 replies 0 retweets 16 likes -
Replying to @sgrif
Yeah like a little unsafe here and there sure. Necessary stuff, but this maintainer is too dismissive. You'll also love to hear their commit for adding their own custom unsafe cell was merely: "add custom cell"
2 replies 0 retweets 6 likes -
Replying to @mgattozzi
What's frustrating with their style is they clearly don't understand what `unsafe` *means*. "There's no issue because public API doesn't exhibit UB" no that's besides the point. This function has unchecked invariants. Mark it as unsafe and move on
2 replies 0 retweets 5 likes -
Replying to @sgrif @mgattozzi
was the issue here that a public function is not marked unsafe, but contained `unsafe` blocks, but doesn't guarantee the invariants those blocks rely on? I'm still really unsure what forces a function to be marked unsafe
1 reply 0 retweets 1 like -
Replying to @mountain_ghosts @mgattozzi
It was archived, you can see for yourself. http://web.archive.org/web/20200116231317/https://github.com/actix/actix-net/issues/83 … A function should be marked `unsafe` whenever it has invariants that cannot be upheld by the compiler. Whether that is public API or not is irrelevant, requiring `unsafe` to call a function like that is critical
1 reply 0 retweets 1 like -
Replying to @sgrif @mgattozzi
but the compiler doesn't *force* you to mark a function that contains `unsafe { ... }` as `unsafe`, you have to elect to do that? so `unsafe { ... }` is you going "look, I know rustc can't prove this memory use is ok, but trust me I know what I'm doing"
3 replies 0 retweets 1 like -
Replying to @mountain_ghosts @sgrif
correct. unsafe { } means within this block of code I have upheld the invariant. whereas marking the fn unsafe means, you the callee need to uphold some invariant.
1 reply 0 retweets 1 like -
Replying to @mgattozzi @sgrif
does "invariant" here only include invariants the borrow checker can prove, or any invariant at all? would one ever mark a fn unsafe if it didn't contain anything that would require an unsafe block (i.e. raw ptr deref etc)
3 replies 0 retweets 1 like -
like, I could write a broken impl of some data structure in safe rust, but marking its API unsafe wouldn't fix that
1 reply 0 retweets 0 likes
Right, `unsafe` is very specifically about memory safety and undefined behavior
-
-
Replying to @sgrif @mountain_ghosts
though I do wish there was some way that wasn't `unsafe` to say hey like if you use the API this way you might have a bad time if you don't do x, y, and z
1 reply 0 retweets 0 likes -
Replying to @mgattozzi @sgrif
I would simply not write APIs with this property being slightly facetious but to me a core element of object APIs is that it should not be possible to put them in a bad state by any sequence of messages
1 reply 0 retweets 2 likes - 7 more replies
New conversation -
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.