4 ms·
I don’t really see how declaring an unsafe block is materially different for the purposes of this discussion than, e.g., entering an async runtime. It is code
by simonask 4mo ago
I don’t really see how declaring an unsafe block is materially different for the purposes of this discussion than, e.g., entering an async runtime.
It is code you need to write, tradeoffs you need to weigh, invariants you need to keep.
- xigoi 4mo agoIn Rust, if you have a function containing an unsafe block, you do not need to use another unsafe block to call the function. Therefore, unsafe is not “contagious” like JavaScript’s async.
- jeroenhd 4mo ago> you do not need to use another unsafe block to call the function And in C#, you can just type `await` and call an async function from a sync function. Calling unsafe requires an unsafe block from safe functions. That's essentially the same thing as async/await in many languages (Rust does things differently, of course, but that's even worse in my opinion).
- xigoi 4mo ago> And in C#, you can just type `await` and call an async function from a sync function. Yes, but not in JavaScript.