On Sun, Aug 02, 2026 at 11:46:54AM +0800, Qian Yun wrote:
> I'd like to updated the year and percentage in FAQ:
>
> """
> As of April 2013, in the src/algebra subdirectory,
> which hosts mathematical functionality about 25% of code was added
> after the fork.
> """
>
> So we started with 153k (lines of code) in src/algebra,
> then removed 11k literate boilerplate,
There are several files that are removed, so baseline is slightly
lower.
> changed 40k during
> "whitespace Normalize", now at 224k.
In the statement above I deliberately exluded changed lines.
In fact, in the process I may have undercounded added lines,
but that figure were intended to be approximate anyway.
> Git blames shows 72k
> lines are never touched.
>
> So if we take 153-11=142k as baseline, then
> 72~112k might not be changed,
> at least 82k are newly added,
> 30~70k are modified.
>
> So the new number shall be 82/142 (37%) or 82/224 (58%)?
I counted lines in new files (they are essentially 100% new code). Then
added increase in size in few heavily modified files like efstruct
or combfunc. The figure you get in this way is lower, but corresponds
better to notion of 'new code'. Some modification are deep enough
to count as new code, some are improvement but are clearly
modification as opposed to new thing, some modifications are
trivial. It would be hard work to distinguished them, so I counted
none of this as new code. Some files are joined to have less files.
IIUC 'git blame' counts moved code as new one.
BTW: LOC may mean "non whitespace not comment lines". That gives
lower counts and probably gives lower percentage of new code
(as new code have some longish "literate" sections absent in
old code), but the difference in precentage should not be big.
I have the followin Perl script to keep only code lines:
$skipping = 0;
while(<>) {
if (/^\)if (false|LiterateDoc)/) {
$skipping = 1;
}
if (/\)endif/) {
$skipping = 0;
next;
}
if ($skipping == 1) { next; }
if (/^ *(--|\+\+)/) { next; }
if (/^$/) { next; }
print;
}
Using it I get 90728 LOC in NAG version, 134910 LOC in current trunk.
This script can not handle literate boilerplate, so can not handle
Axiom at time of the fork. But compared to NAG version there were
tiny changes, so 32% is practially a lower bound on new code.
--
Waldek Hebisch