by catnaroek · 10y ago · 0 comments
> There’s a generic function in the standard library called `Ada.Unchecked_Deallocation`, which frees memory to the heap.
A systems language without a safe resource finalization story is simply an unsafe language. This isn’t some fringe use case. Finalizing resources is a common operation in systems programming.
Other “benefits” of Ada just consist in bloating the core language with stuff that can be reasonably done in libraries: bounds checking (in ML, this is just a functor that produces an abstract type of bounds-checked integers), concurrency abstractions (as Rust has shown), etc.
There are ways in Ada to write programs without ever having to call Unchecked_Deallocation.
Good luck having the compiler eliminate bounds checking for library code.