is the modern memory management really so bad in Pascal?
is like 1990's again -- even simple things like owned pointers (unique_ptr) and refcounted pointers (shared_ptr) are missing. The replacements (manual free's and free notifications) have A LOT of manual boilerplate. Also, everything is horribly thread-unsafe.
Is there a better example of memory management in a modern pascal?
Somebody asked a interesting question on a Reddit thread and frankly, i am not qualified to answer that person. Anybody with more experience able to answer that?
C++ uses textual #include files from 1970-s.
C++ compiler knows only about one file it compiles. All the info about project structure must reside in a build system(CMake, Automake, Scons, Waf, etc).
"Modern memory management"...
C++ is parsable only by its compiler. Static analysis of C++ is extremely difficult.
Clang tools fixed some inconveniences of a development process with C++.
What is static analysis? It's like another compiler that doesn't generate code, but analyses it by some criteria.
It can replace automatic memory management. It can convey automatic code quality audit, find deprecated features, propose optimizations. Anything imaginable that humans do with existing code.
One of the main advantages/features of Object Pascal is that it's suitable for static analysis.
Rust language for example, made memory management static analysis a standard part of its compiler.
In the end of 1980s Lispers created one official standard out of many separated implementations, that is ideal to this days - Common Lisp.
Object Pascal nowadays is only at a "Free" stage, not Common. Slow development and small user community that isn't really interested or motivated in fixing some grey areas of the language(function pointers).