You might be able to do something with cloc and a shell script for a rough estimate.

```
$ cd ghc
$ nix-shell -p clock --run "cloc ."
```

will output a detailed report of the loc and language breakdown of the top level ghc directory (it is comment-aware and aware of many languages). there might be a way to get cloc or a similar tool to output something more inspect able (eg json), and then use a shell script to gather everything from the appropriate directories/files. 

I suspect something could be hacked up in less than a day, but it would require a bit of research. Hopefully this is helpful and gets you going - I'd be happy to hear of better solutions.

Thanks

On Fri, Jun 10, 2022, 11:20 Simon Peyton Jones <simon.peytonjones@gmail.com> wrote:
Dear GHC devs

Is it possible to get a "lines-of-code" summary of GHC these days?   Like the one below, from 2011. 

It needs more than `wc` because it's helpful to split lines of code from lines of comments and notes.

We used to have `count_lines` but I'm not sure whether it is still extant.

I'm giving a talk at Zurihac on Sunday morning, about the internals of GHC.  Any data before then, preferably in a form comparable to that below, would be terrific.

But you have a lot else to do.  This isn't do-or-die, just nice to have.

Thanks

Simon

image.png

_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs