Conversation

Another fun insight gained this week: the unsafe keyword is actually two keywords in a trenchcoat. Much like `async/.await` there is the: - function modifier (`unsafe fn`) - call convention (`unsafe {}`)
5
30
Back in the day (pre-1.0) I _think_ there were ideas to rename `unsafe {}` blocks to `trusted {}`, but I don't think it went anywhere. It seems quite similar to modal types, where you 'box' and 'unbox' terms… but not sure!
2
To make it more clear, I'm interested in the ways your abstracted keywords work… like I'm assuming that some of the keywords correspond to coeffects, and some correspond to effects? But I could be mistaken.
1
1
Yeah I don't fully understand it either. Not sure if can explain better… but I think it’s something that _needs_ to be true in a context for something to be used, vs, something that could _possibly_ change the context if something is used.
1
1
The weird thing is that some things can be expressed either as effects or coeffects… like state? So `const` might be a coeffect, but `async` might be an effect? I could be wrong though - and I know that Rust's async has interesting quirks to it so I'm not sure.
1
1
Show replies