Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple modules #489

Open
brendanzab opened this issue Feb 2, 2023 · 1 comment
Open

Multiple modules #489

brendanzab opened this issue Feb 2, 2023 · 1 comment

Comments

@brendanzab
Copy link
Member

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.
@Kmeakin
Copy link
Contributor

Kmeakin commented Feb 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants