by gknoy · 11y ago · 0 comments
All the uses I saw listed on the blog were as a replacement for Python, it seemed like, so this might be a direction of integration that wasn't intended.
edit: Perhaps I should read more and ask less. It looks like this is what `import_file_to_module` does, right? :-)
It works both ways, and bi-directional interop is intended! Just `import hy` then you can import any `.hy` on `sys.path` :D
(yes, this means you can make Hy code pip installable, just like Hy itself!)
Hy uses a metaimporter to parse the Hy code and hand the Python compiler AST. So you can import any hy file like normal Python and use the code. Its that simple.