| As one of the developers of this patchset, here is my simple answer: try it. I'd love to see it. I know Rust; I don't know Frama-C or Idris or Ada. What little I know of Ada indicates that it doesn't actually solve the problem because it doesn't have safe dynamic memory allocation. Ada advocates have told me I'm wrong and there's some new thing (inspired by Rust) that does this. Maybe! I'm not sure there's any benefit to the world in arguing it; someone skilled in Ada should just write something and show how it would actually work. Write a kernel module with any of those techniques, send in a patch, and see what people say. Any effective means of making the kernel less buggy is great. It doesn't have to be Rust. I claim that Rust is effective because, well, those patches are there, and frankly I haven't been doing any work for this project in almost a year and we're getting so many enthusiastic contributors. So, apparently, a lot of other people also know or are willing to learn Rust. Maybe it's actually better than the alternatives you mention; maybe it just has better documentation. I don't know. I'm not claiming Rust is perfect, just that it's empirically likely to solve the problem. If you can get together a community of folks who can do any of these other approaches, that would be fantastic. Try it! |
It does, just not the way most are used to it.
Surely if one wants to code like malloc()/free(), free() is unsafe in Ada and requires the Ada version of unsafe {}
However many type constructions in Ada do dynamic allocation by themselves, including on the stack.
If memory allocation fails, an exception is thrown and a retry with less memory requirements is a possible execution path.
Ada also has RAII since Ada95 (controlled types), and yes SPARK formal specification now allows for ownership rules.