nikomatsakis / context-capabilities-initiative

https://nikomatsakis.github.io/context-capabilities-initiative/
Apache License 2.0
12 stars 1 forks source link

Auto contexts #4

Open tmandry opened 2 years ago

tmandry commented 2 years ago

Motivation

Covered in https://blog.sunfishcode.online/context-brainstorming/

Details

TODO

tmandry commented 2 years ago

This post says a lot of good things. I would add though that I don't think negative bounds are correct for automatic contexts. Rather, like auto traits, they should be default context bounds that are relaxed...

fn totally_pure(a: &A) -> B
with
    ?ambient_authority +
    ?unwind
{
    // lots of interesting stuff
}

The syntax is up for debate; I personally find ! more readable but it doesn't actually express what we need here. True negative reasoning can complicate the type checker quite a bit so I'm not sure if we want to go that route.