4 ms·
Hello Max! 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
by Raphael_Amiard 6y ago
Hello Max!
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.
- In SPARK we have ownership pointer that are roughly similar to pointers in Rust: https://blog.adacore.com/using-pointers-in-spark https://blog.adacore.com/using-pointers-in-spark
Anecdotally, I have a friend/colleague working on a fun side project, https://github.com/Roldak/AGC 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)
- MaxBarraclough 6y agoGreat answer, thanks.