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

demonstrate that separate compilation is possible #118

Open
gelisam opened this issue Oct 21, 2020 · 1 comment
Open

demonstrate that separate compilation is possible #118

gelisam opened this issue Oct 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@gelisam
Copy link
Owner

gelisam commented Oct 21, 2020

Klister is an interpreter, not a compiler, but we want to demonstrate that its ideas are applicable in a wider setting in the hope that they will be adopted by a larger project such as ghc. To this end, we should serialize each module after expansion, so that we can load this binary artifact (which would be compiled code in a compiler, but would consist of Maps of bindings in our context) instead of re-traversing a module.

This would also improve the performance of our test suite, as several examples happen to load the same modules (e.g. the prelude).

One thing we need to be careful about is our newUnique calls: Uniques are only guaranteed to be unique within one invocation of a Haskell program, not between runs! Therefore, we need to use a slightly more complex system of references. For example, we could write our own variant of newUnique which increments a different counter for each module, and each reference would include both a module identifier and that unique number.

@gelisam gelisam added the enhancement New feature or request label Oct 21, 2020
@david-christiansen
Copy link
Collaborator

Rather than a map of bindings, I would probably serialize the fully-expanded source code of the module, as that's entirely first-order and readable.

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

No branches or pull requests

2 participants