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

Modularization of the code base #252

Open
doyougnu opened this issue Oct 8, 2024 · 2 comments
Open

Modularization of the code base #252

doyougnu opened this issue Oct 8, 2024 · 2 comments
Labels
refactoring An implementation change with no effect on Klister programs

Comments

@doyougnu
Copy link
Collaborator

doyougnu commented Oct 8, 2024

I would like to start decoupling the code base. This would mean separate packages for the parser, expander, evaluator. I'm unsure how feasible a lot of that is but just moving code to packages in a cabal.project would be a start.

Why? Well architecturally I really don't like monoliths. This would force us to define good api's between each subsystem and would make maintenance and experimentation easier.

@gelisam
Copy link
Owner

gelisam commented Oct 10, 2024

In any other project, I would worry that the multi-package ghcid experience is not great yet, but on Klister I usually run cabal run klister -- run examples/my-example.kl whenever I edit a .hs or .kl file, and I think that would continue to work just fine if the code is divided into multiple packages. So sure, if that's what you're passionate about, go ahead!

@gelisam
Copy link
Owner

gelisam commented Oct 10, 2024

I'm unsure how feasible a lot of that is

The parser can definitely be separated. The evaluator too, probably, since it isn't split into multiple tasks. But I suspect you will be unhappy with the end result, because the expander+typechecker logic will be much bigger than everything else, you will only have moved out two modules (Parser.hs and Evaluator.hs). I guess the biggest win might be moving out the dependencies of those two files: Syntax, Scope, ScopeSet, Core, PartialCore, SplitCore, Kind, Type, PartialType, SplitType, Value, Env, Unique, Pretty, and ShortShow (which is barely used, we should get rid of it in favor of Pretty).

@gelisam gelisam added the refactoring An implementation change with no effect on Klister programs label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring An implementation change with no effect on Klister programs
Projects
None yet
Development

No branches or pull requests

2 participants