I encourage you to give a try to D, since it's another kind of language and you may discover many great things that don't exist in the Pascal world, especially with templates (variadic, template value parameter, template metaprogramming, compile-time reflection, ...).
I thought I would look at writing a D wrapper class for the example NDFD dynamic (shared) library, since I have wrapper classes in Pascal, C#, Python and Swift. This can be a useful exercise to perform. (
https://macpgmr.github.io/MacXPlatform/PascalDynLibs_2.html)
However, D looks a little, um, underdeveloped. Where FPC's DynLibs unit provides cross-platform versions of the Windows API LoadLibrary and GetProcAddress functions for doing so-called dynamic loading, it looks like with D one would have to write the DynLibs equivalent oneself, using these functions on Windows, but dlopen and dlsym on non-Windows.
And I don't see any example of how to do so-called static loading with D, where you let the OS load the library (or, on macOS, the framework) at startup (the easy way of doing it).
https://dlang.org/articles/dll-linux.htmlFPC still looks like a good choice for both _creating_ dynamic libraries (a good way of preserving some of the investment in Pascal code in a decidedly non-Pascal world) and _consuming_ dynamic libraries (a good way of bringing some of the non-Pascal goodness into the Pascal world).