I have a notion of purity as well :P
I think the applications of this sort of thing are pretty limitless. Maybe rust has `unsafe` but with further verification extensions to the language we can really push confidence in a working, safe product.
I have a notion of purity as well :P
I think the applications of this sort of thing are pretty limitless. Maybe rust has `unsafe` but with further verification extensions to the language we can really push confidence in a working, safe product.
That’s a really nice demonstrable and practical impact of using effects!
That's awesome! I started working to sandbox my Rust program using seccomp-BPF, and I was quickly frustrated about having to run my program with strace to find out what syscalls I should allow for my program, when it sounded like this information should be available at compile time!
is this open or proprietary? I'd love a link to a repo
Here's a little snippet:
#[effect::declare(
args=(inner_tmp as I)
returns=("/tmp/" + I)
)]
fn tmp_dir(inner_tmp: Path) -> Path {
Path::from("tmp/").join(inner_tmp)
}
So it can reason about that Path's constraints. When that Path gets used by, say, "File::create(path)", it gets turned into a rule and added to an apparmor policy.Apparmor doesn't support a "hey I'm a process, please sandbox me" so I have to write a privileged daemon that manages that bit.
I also have a way to apply effects to functions you don't own, mutating functions, functions that branch, etc. None of that is implemented yet, just designed.
- Github : https://github.com/insanitybit
- Twitter: https://twitter.com/InsanityBit