Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Write hie info

Open balacij opened this issue 1 year ago • 2 comments

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

balacij avatar Apr 02 '24 22:04 balacij

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

balacij avatar Apr 02 '24 22:04 balacij

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 avatar Apr 03 '24 18:04 balacij

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

balacij avatar May 17 '24 19:05 balacij

Upon re-reading: yes.

JacquesCarette avatar May 17 '24 19:05 JacquesCarette