[Feature Request] seemlessly integrate to Python Runtime and vice versa
Request
The modules created in Mojo can be simply imported in Python, and Python module can easily imported to Mojo. The data type can be seamlessly converted and maximum compatibility.
Maybe a custom Loader, Importer and PathFinder are required.
Motivation
Mojo is something initially designed for AI. and it can be used for general programming. But it is not expected to completely replace Python, Python is a good glue language. and it has strong ecosystem.
Just like how Cython like, Cython can be easily imported in normal Python file. (Not so perfectly).
But Mojo is in development, a lot of feature can be adjusted.
Description and Requirements
- Add support to Python
importlib. (define PathFinder, Loader and Importer). - Make stable ABI between Mojo and CPython (or other Python implementation via HPy (https://hpyproject.org/))
- For primitive data type, it can directly pass to Python and vice versa. For struct, It create a Python class which has only single field (pointer to struct object) and it mapping all method to the struct.
@lattner @scottamain @goldiegadde @paige-on-github what is your opinion?