2 ms·
It's my opinion that Rust's safety model is flawed by way of being too rudimentary. It can only guarantee safety against a subset of memory issues, and actively
by johnnyjeans 3y ago
It's my opinion that Rust's safety model is flawed by way of being too rudimentary. It can only guarantee safety against a subset of memory issues, and actively locks you out of using programmatic techniques which are often necessary in high-performance contexts without introducing unsafe code into your codebase. ATS[1] takes a different approach, much more broad in its ability to ensure safety, by enforcing a notion of logical safety in arbitrary contexts. It's essentially a cutting edge type system tacked onto C, what you see is what you get, and the safety constructs don't impose any structural restrictions on your code. Memory safe pointer arithmetic, page table manipulation, etc. All checked for correctness at compile time thanks to the type system. If you cannot prove your code works, it will not compile.
I don't actually care that much for ATS. It's a highly experimental and unwieldy. There are very silly design decisions sprinkled about and it's far more complex and kitchen-sink than it needs to be. A bizarre academic vision more than anything else, but one that has a lot of important points to make. To me, ATS represents what we should be looking for in a safe systems language much more than Rust.
I know the general reaction to the idea of languages that require you to write proofs is revulsion at what it requires out of the programmer. My response to this is simple; safe code must be written with time taken to sit down and think through the problem domain, mapping it out and working off of explicit proof. Without this, our efforts to create "safety" are akin to taping a tarp over a hole in the wall and calling it a repair. Safety is important, and that's why half-measures are unacceptable.
[1] https://www.cs.bu.edu/~hwxi/atslangweb/ https://www.cs.bu.edu/~hwxi/atslangweb/