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

Write hie info #3708

Merged
merged 2 commits into from
May 17, 2024
Merged

Write hie info #3708

merged 2 commits into from
May 17, 2024

Conversation

balacij
Copy link
Collaborator

@balacij balacij commented Apr 2, 2024

Contributes to #3700 by writing HIE information necessary for both stan and weeder

@balacij
Copy link
Collaborator Author

balacij commented Apr 2, 2024

Force-pushed to remove a commit I didn't intend to write to this branch...

Copy link
Owner

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look fine to me, but I want to understand a bit better first. What are .hie directories?

code/Makefile Show resolved Hide resolved
@balacij
Copy link
Collaborator Author

balacij commented Apr 3, 2024

Yep, .hie files are snapshots of key information found about a codebase by GHC (while it was compiling said codebase). From what I've understood, its ultimate goal is to enable external tools to 'search/analyze/manipulate the AST' as if it were built into the compiler itself. One of the key benefits to that approach is that they can rely on GHC's Haskell parser. Notably, stan and weeder use .hie information to examine Haskell programs.

The hiedb package allows us to write Haskell code that handles the .hie information (hence enumerating what information we can readily see from the GHC output), and it also has a nifty 'Query' module that we might be able to use as well! For example, we have those two scripts in the scripts/ folder -- I forget what they do completely, but I know they scan the source code -- that could probably be simplified by relying on the .hie information instead of a string search. Maybe we make that a work task actually? I'm not sure how robust those scripts are.

@balacij
Copy link
Collaborator Author

balacij commented May 17, 2024

@JacquesCarette I see on #3739, you mentioned that you wanted more information about this -- did the above comment clarify everything?

@JacquesCarette
Copy link
Owner

Upon re-reading: yes.

@JacquesCarette JacquesCarette merged commit ed340bb into master May 17, 2024
7 of 8 checks passed
@JacquesCarette JacquesCarette deleted the writeHieInfo branch May 17, 2024 19:44
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

Successfully merging this pull request may close these issues.

2 participants