I think some of this consideration, and resulting work is already being looked at in the context of Numba. They came up with PIXIE (Portable Instructions eXchanged in Executable), the concept being to compile your functions into a shared library which embed the low-level compiler IR, and can then be JIT compiled, or "pulled" in at link-time.
Modular can do exactly the same with existing Python packages, and lift them into Mojo that way.
Modular can do exactly the same with existing Python packages, and lift them into Mojo that way.
Reference: https://numba.discourse.group/t/proposal-development-focus-f...