GHC code size

Bryan Richter bryan at haskell.foundation
Tue Jun 14 15:04:21 UTC 2022


A quick googling discovered 
https://githubnext.com/projects/repo-visualization, which has some of 
the desired features. :)

(CC'ing the author and team mentioned in the article, too.)

Has:

* very visual
* subdirectory breakdown
* filetype breakdown

Doesn't have:

* Separating code from comments
* History is listed under "future work"
* Drop-in support for gitlab (it's presented as a GitHub Action)

The article has an interactive widget you can point at a repo. I pointed 
it at ghc/ghc, and although my browser is still churning ten minutes 
later, here's a preview. It's pretty cool!


On 14/06/2022 16:20, Hécate wrote:
>
> I'm taking the liberty of forwarding this to Bryan, as he's in a 
> unique position to help on this front. :)
>
> Le 14/06/2022 à 16:18, Simon Peyton Jones a écrit :
>> Thanks Hecate. I used your figures in my talk.  Really helpful.
>>
>>  A note to all ghc-devs: it's be lovely to have a regularly-updated 
>> summary visualisation of GHC's source code:
>>
>>   * Separating code from comments
>>   * Broken up by sub-directory
>>   * As visual as possible
>>   * Ideally with some kind of historical time-line ability
>>
>> This can't be new.  Zillions of GitHub repositories could be 
>> visualised like this.  There must be prior art; probably a lot of 
>> it.  Can we just press a button and get it?
>>
>> Simon
>>
>> On Fri, 10 Jun 2022 at 17:45, Hécate <hecate at glitchbra.in> wrote:
>>
>>     If you don't have a nix shell handy, here is what I'm getting:
>>
>>     ❯ cloc compiler rts driver
>>         1148 text files.
>>         1137 unique files.
>>          108 files ignored.
>>
>>     github.com/AlDanial/cloc <http://github.com/AlDanial/cloc> v
>>     1.88  T=1.31 s (794.3 files/s, 431269.4 lines/s)
>>     ---------------------------------------------------------------------------------------
>>     Language                             files blank       
>>     comment           code
>>     ---------------------------------------------------------------------------------------
>>     Haskell                                635 68541        
>>     140216         231567
>>     C                                      158 10529         
>>     16953          51162
>>     C/C++ Header                           209 4329          
>>     8984          14536
>>     yacc                                     2 971            
>>     10           5024
>>     Logos                                    3 530             
>>     0           3642
>>     Pascal                                   1 661           
>>     936           2312
>>     make                                    14 252           
>>     409            850
>>     Windows Module Definition                7 27             
>>     0            489
>>     Assembly                                 5 76           
>>     269            478
>>     Puppet                                   1 106             
>>     0            445
>>     Python                                   1 32            
>>     19            162
>>     D                                        1 16            
>>     42             60
>>     YAML 1              6             10             18
>>     Lisp 1              2              4              7
>>     Windows Resource File 1              0              0              1
>>     ---------------------------------------------------------------------------------------
>>     SUM:                                  1040 86078        
>>     167852         310753
>>     ---------------------------------------------------------------------------------------
>>
>>     Le 10/06/2022 à 18:29, chessai a écrit :
>>>     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.png
>>>
>>>         _______________________________________________
>>>         ghc-devs mailing list
>>>         ghc-devs at haskell.org
>>>         http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>>
>>>
>>>     _______________________________________________
>>>     ghc-devs mailing list
>>>     ghc-devs at haskell.org
>>>     http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
>>     --
>>     Hécate ✨
>>     🐦: @TechnoEmpress
>>     IRC: Hecate
>>     WWW:https://glitchbra.in
>>     RUN: BSD
>>
>>     _______________________________________________
>>     ghc-devs mailing list
>>     ghc-devs at haskell.org
>>     http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
> --
> Hécate ✨
> 🐦: @TechnoEmpress
> IRC: Hecate
> WWW:https://glitchbra.in
> RUN: BSD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220614/b4bad31f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: s0NTyQh7STmE0t2T.png
Type: image/png
Size: 439175 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20220614/b4bad31f/attachment-0002.png>
-------------- 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/20220614/b4bad31f/attachment-0003.png>


More information about the ghc-devs mailing list