-
Notifications
You must be signed in to change notification settings - Fork 375
Description
As noted in #2131, Hy ends up loading most of its internal modules just from the initial import of the top-level module.
Turns out it's not entirely trivial to fix this, since we have complicated dependency chains such as hy.importer._inject_builtins() needing hy.macros.load_macros(), but hy.macros imports hy.compiler (which itself imports macroexpand back from hy.macros...)
The whole thing is fragile enough that (naive) initial attempts just result in a bunch of ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import).
I think the proper solution for this is going to be a (potentially invasive?) reorganization so that dependencies are much clearer/saner and so that we actually get the benefit of just-in-time submodule loading.