@Zergling_man @gentoobro @Suiseiseki Source-based languages with transparent recompilation on dependency upgrade have zero problem with sharing directories of libraries.
Consider Common Lisp on Debian and Guix.
(SBCL just transparently compiles source files into FASL object files, so any SBCL instance will just reuse them. Its FFI also supports native object files, though CFFI also allows for mostly transparent handling of C source.)