GHC code size

chessai chessai1996 at gmail.com
Fri Jun 10 16:29:59 UTC 2022


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 at 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: image.png]
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220610/f84bf729/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 336143 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220610/f84bf729/attachment-0001.png>


More information about the ghc-devs mailing list