mental32 / monty

A language toolchain for explicitly typed annotated Python. 🐍

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing core "import" machinery.

mental32 opened this issue · comments

We gotta have modules but for that we gotta have importlib/import machinery in order to resolve and locate the modules when parsing out from-import and import nodes.

See also importlib._bootstrap, CPython actually appears to have its core import logic implemented in Python but when the interpreter gets compiled the source file implementation gets dumped out into raw bytecode and transpiled into a C int array and marked as "frozen".

As of 5582b11 we now have CompilationUnit.inport_module which takes in a language.ImportDecl and attempts to resolve the declarations fully qualified name against the file system.

This is in no way a "complete" implementation of the import machinery, there is still a lot of work to do to meet all the PEPs related to importing but we're making progress :)