[racket-dev] relative lines of C in gracket vs. gracket2
At Thu, 28 Oct 2010 10:48:43 -0700, John Clements wrote:
> I took a look at the size of our C code base (all files ending in .c, .h,
> .cpp, and .cxx, not including those with 'xsrc' in the path) to see how much
> smaller gracket2 is, and (assuming I didn't miss something major) the
> difference is truly impressive. The below is ... | wc | sort -n | tail, so
> it's just the 9 biggest and the total from each.
>
> So, if I'm reading this correctly, we've gone from ~590K lines of C to about
> ~340K lines of C. That's amazing.
In one way, you undercounted: ".cc" was used for about 55k lines of C++
code.
At the same time, it's overcounting to include the libpng, libjpeg,
etc. sources that we have in our repo for convenience. GRacket2 still
depends on those libraries, but it either uses the versions that you
have installed or uses binaries that are downloaded during a build.
I would break it down like this:
C & C++ that we C & C++ included Total
maintain [*] for convenience [**]
GRacket1 455k 190k 645k
GRacket2 252k 85k 337k
* Racket run-time: 227k (including 15k for GCs)
GUI (gr1 only): 197k
MysX, MzCom, SrP: 25k
** Image parsers (gr1 only): 105k
Boehm GC and libffi: 85k
Overall, GRacket2 replaces about 200k lines of C and C++ (on top of Xt,
Win32, and Carbon) with about 30k lines of Racket code (on top of Gtk,
Win32, and Cocoa) plus Cairo and Pango.