Looks like a good tutorial, but it doesn't go into much depth on memory-management. The More About Types section has a little. It mentions that automated reference-counting is available through the GNATCOLL library, which seems to have since been broken apart into three different packages [0], so it now resides in gnatcoll-core [1].
We agree that it's a hole in the current curriculum, that we intend to fill at some stage with the advanced lessons.
State of memory management in Ada is:
- You have a lot of facilities to stack allocate/not heap allocate tons of stuff that you would heap allocate in pretty much any other low level languages.
- When that doesn't cover you, in Ada you're basically at the level of C++: You have refcounted pointers, unique pointers (which are enforced via limited types) in GNATCOLL, managed containers in the stdlib, and manual memory management. You have storage pools which, with the 2012 additions, are roughly similar to custom allocators in C++/Rust.
Anecdotally, I have a friend/colleague working on a fun side project, https://github.com/Roldak/AGC, meant to plug a garbage collector into Ada, since the language is much more amenable to that than C or C++. (completely prototype/for fun project, hence why I'm not including it in the "serious" options at your disposal above)
Can anyone comment on memory-management in Ada?
[0] https://github.com/AdaCore/gnatcoll
[1] https://github.com/AdaCore/gnatcoll-core/blob/master/src/gna...