HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
AlDanial
cloc
Perl2016–2026
AlDanial / cloc

cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

34Distinct people
39Mentions
0Explicit recommenders
23.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 4:00:59 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year39 dated mentions

Observed mentions: 2016-04-18 20:21:59 UTC to 2026-01-07 21:52:30 UTC.

02462016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 6 mentions; 1 submissions, 5 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 1 submissions, 6 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC413
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC303
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC202
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC404
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC615
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC716
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC716
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
cloc Count Lines of Code cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v2.10 (July 4, 2026) cloc moved to GitHub in September 2015 after being hosted at http://cloc.sourceforge.net/ since August 2006. Quick Start Step 1: Install cloc (see Install from Github Releases and Install via package manager) or run cloc's docker image. The Windows executable has no requirements. The source version of cloc requires a Perl interpreter, and the Docker version of cloc requires a Docker installation. Step 2: Open a terminal (cmd.exe on Windows). Step 3: Invoke cloc to count your source files, directories, archives, or git commits. The executable name differs depending on whether you use the development source version (cloc), source for a released version (cloc-2.10.pl) or a Windows executable (cloc-2.10.exe). On this page, cloc is the generic term used to refer to any of these. Include Security has a YouTube video showing the steps in action. a file prompt> cloc hello.c 1 text file. 1 unique file. 0 files ignored. https://github.com/AlDanial/cloc v 1.65 T=0.04 s (28.3 files/s, 340.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 1 0 7 5 ------------------------------------------------------------------------------- a directory prompt> cloc gcc-5.2.0/gcc/c 16 text files. 15 unique files. 3 files ignored. https://github.com/AlDanial/cloc v 1.65 T=0.23 s (57.1 files/s, 188914.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 10 4680 6621 30812 C/C++ Header 3 99 286 496 ------------------------------------------------------------------------------- SUM: 13 4779 6907 31308 ------------------------------------------------------------------------------- an archive We'll pull cloc's source zip file from GitHub, then count the contents: prompt> wget https://github.com/AlDanial/cloc/archive/master.zip prompt> cloc master.zip https://github.com/AlDanial/cloc v 1.65 T=0.07 s (26.8 files/s, 141370.3 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Perl 2 725 1103 8713 ------------------------------------------------------------------------------- SUM: 2 725 1103 8713 ------------------------------------------------------------------------------- a git repository, using a specific commit This example uses code from PuDB, a fantastic Python debugger. prompt> git clone https://github.com/inducer/pudb.git prompt> cd pudb prompt> cloc 6be804e07a5db 48 text files. 41 unique files. 8 files ignored. github.com/AlDanial/cloc v 1.99 T=0.04 s (1054.9 files/s, 189646.8 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Python 28 1519 728 4659 reStructuredText 6 102 20 203 YAML 2 9 2 75 Bourne Shell 3 6 0 17 Text 1 0 0 11 make 1 4 6 10 ------------------------------------------------------------------------------- SUM: 41 1640 756 4975 ------------------------------------------------------------------------------- each subdirectory of a particular directory Say you have a directory with three different git-managed projects, Project0, Project1, and Project2. You can use your shell's looping capability to count the code in each. This example uses bash (scroll down for cmd.exe example): prompt> for d in ./*/ ; do (cd "$d" && echo "$d" && cloc --vcs git); done ./Project0/ 7 text files. 7 unique files. 1 file ignored. github.com/AlDanial/cloc v 1.71 T=0.02 s (390.2 files/s, 25687.6 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- D 4 61 32 251 Markdown 1 9 0 38 make 1 0 0 4 ------------------------------------------------------------------------------- SUM: 6 70 32 293 ------------------------------------------------------------------------------- ./Project1/ 7 text files. 7 unique files. 0 files ignored. github.com/AlDanial/cloc v 1.71 T=0.02 s (293.0 files/s, 52107.1 lines/s) ----------------------------
Read the full README on GitHub

What Hacker News says

4 sources
Sorry, but that's really not fair. You are running that on all the folders inside the src/ directory (and the README?), including blargg's libraries that I'm using. I'm not counting that. Go ahead and include those if you want. It's code I didn't write, and bigger than the rest of the emulator! I don't think that's representative. CPU and PPU implementations tend to be in the order of the thousands of lines -- they are around 200 and 300 lines respectively in LaiNES. In fact, most of the code is in the GUI that I could easily strip away if this was a competition. And this wasn't written to be small - it was written to be simple. It also came out small, but that's incidental. Here's how I counted the lines and how I decided on the description for the repository, which by the way has been catapulted from totally unknown to worldwide attenti
Read the rest
on overnight, and it's now object of unexpected, ruthless scrutiny that I couldn't foresee. [andrea@manhattan src]$ rm -rf boost nes_apu Sound_Queue.* [andrea@manhattan src]$ cloc . 24 text files. 24 unique files. 1 file ignored. github.com/AlDanial/cloc v 1.70 T=0.03 s (780.3 files/s, 63170.2 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C++ 11 210 110 1163 C/C++ Header 12 87 7 285 ------------------------------------------------------------------------------- SUM: 23 297 117 1448 -------------------------------------------------------------------------------
In LaiNES – Cycle-accurate NES emulator in around 1000 lines of code
I ran `cloc` on the minoca/os repository, here are the results: github.com/AlDanial/cloc v 1.70 T=22.43 s (84.3 files/s, 63498.9 lines/s) ----------------------------------------------------------------------------------- Language files blank comment code ----------------------------------------------------------------------------------- C 1023 296251 262652 530443 C/C++ Header 438 93833 117592 69529 Assembly 95 9588 7773 13383 make 270 2236 6402 4784 Bourne Shell 38 799 1198 2787 JSON
Read the rest
4 4 0 1367 Pascal 4 232 28 718 Python 4 194 257 589 yacc 2 99 4 481 awk 3 25 11 263 Markdown 3 27 0 172 Windows Resource File 3 18 0 86 lex 2 44 142 84 Perl 1 7 10 35 ----------------------------------------------------------------------------------- SUM: 1890 403357 396069 624721 -----------------------------------------------------------------------------------
In Minoca OS: A new open source operating system
Bogdanp·Jul 16, 2016Submission

Show HN: A remote team visualization tool

I just launched http://teamzones.io, a project I had been working on during weekends that attempts to solve a problem I've run into as a member of a remote team: keeping track of _when_ people are working in relation to yourself is a pain. Since this is hacker news and some of you might find this interesting, the stack is: * Go on AppEngine on the backend * Elm on the frontend And here's a breakdown of the source code: ~/s/g/s/teamzones (master)> cloc --exclude-dir=node_modules,vendor,static,elm-stuff,elm.js,index.html . 158 text files. 156 unique files. 48 files ignored. github.com/AlDanial/cloc v 1.70 T=0.86 s (132.1 files/s, 17040.9 lines/s) ------------------------------------------------------------------------------- Language
Read the rest
files blank comment code ------------------------------------------------------------------------------- Elm 40 1069 5 4426 Go 37 856 270 4162 JSON 8 0 0 1450 SASS 13 423 0 1425 JavaScript 4 40 7 174 YAML 10 28 8 156 make 1 21 0 58 ------------------------------------------------------------------------------- SUM: 113 2437 290 11851 ------------------------------------------------------------------------------- I hope at least some of you find it useful!
6 points · Open discussion
sloccount says: Totals grouped by language (dominant language first): ansic: 233396 (95.05%) cpp: 7250 (2.95%) yacc: 2846 (1.16%) perl: 1161 (0.47%) lex: 579 (0.24%) sh: 210 (0.09%) awk: 90 (0.04%) sed: 11 (0.00%) EDIT: That's the recent version 3.6.0 EDIT#2: Here's the cloc output: https://github.com/AlDanial/cloc v 1.66 T=1.76 s (266.7 files/s, 181757.6 lines/s) --------------------------------------------------------------------------------------- Language files blank comment code --------------------------------------------------------------------------------------- C 271 24996 32675
Read the rest
220107 C/C++ Header 159 2950 4398 18318 C++ 5 1033 1097 6070 yacc 2 320 146 2846 Perl 11 280 501 1171 Windows Resource File 5 164 175 909 lex 2 37 58 484 DOS Batch 3 43 14 327 R 1 8 6 287 Bourne Shell 4 34 118 214 Windows Module Definition 2 7 0 141 Pascal 3 2 0 137 awk 1 6 58 90 sed 1 0 12 11 --------------------------------------------------------------------------------------- SUM: 470 29880 39258 251112 ---------------------------------------------------------------------------------------
In The story behind NetHack's first update since 2003

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.