3 ms·
A lot of it is actually vendored code under third_party/ e.g. Python 2.6, libcxx, compiler_rt, zlib, etc. I don't like to write anything myself if I don't have
by jart 3y ago
A lot of it is actually vendored code under third_party/ e.g. Python 2.6, libcxx, compiler_rt, zlib, etc. I don't like to write anything myself if I don't have to. Here's a synopsis of how many lines of code are contained in the subset of packages that me and my team (mostly) wrote ourselves.
$ for x in ape examples libc/* tool/* net/* test/*/*; do echo $x $(wc -l $x/*.{c,cc,S,h,sh,mk,inc} $x/*/*.{c,cc,S,h,sh,inc} $x/*/*/*.{c,S,h,sh} $x/*.S | tail -n1 | awk1); done 2>/dev/null | sort -nrk2 | head -n25
libc/calls 38690
libc/tinymath 33400 (mostly copied from fdlibm/arm/musl/freebsd/openbsd actually)
libc/intrin 28243 (a good chunk of this is from arm and llvm)
libc/nt 26738 (it's just win32 interface boilerplate)
libc/stdio 21829
examples 19740 (a big chunk of that is actually dash)
libc/sysv 18305
tool/build 17811
test/libc/xed 17581 (mostly generated actually)
libc/nexgen32e 16695
tool/net 15058
libc/str 12150
tool/viz 11511
libc/runtime 10823
test/libc/calls 9460
ape 7507
libc/sock 7436
tool/plinko 7075
libc/proc 6956
net/http 6901
libc/thread 6757
libc/vga 5518
test/libc/stdio 5057
libc/log 4759
libc/time 4749
test/libc/tinymath 4555
libc/testlib 4217
That comes out to 429,866 lines. Every file has a copyright header saying where it came from. So a lot of those lines are just copyright notices repeated over and over again. It also means if anyone is bored, there's an opportunity to do some deeper analysis.