fathom
fathom copied to clipboard
Multiple modules
It would be nice to support breaking up fathom files into multiple modules, especially as files like opentype.fathom get larger.
Iād imagine imports could go at the top of a file:
module opentype;
import fathom.{ u32be, ... etc ... };
import opentype.common.{ unknown_table, optional_table };
import opentype.tables;
And later:
cvt <- optional_table "cvt " tables.cvt,
fpgm <- optional_table "fpgm" unknown_table,
Imports should be qualified by default, and form a DAG.
Some questions:
- what import syntax should we use?
- how do we find new modules relative to an existing module?
- how do we dump multiple modules for snapshot testing?
- how doe we represent modules in the elaborator/evaluator(s)/etc.
What about local imports?
local import fathom.u32be; foo would function like let.
Alternatively, we could have an expression version of import, which would be more orthogonal and not requre another binder form in the core syntax
let {u32be} = import fathom; foo