Here is a breakdown of how many lines of code (roughly) are in different languages in the Math::GSL codebase:
- 280889 lines - XS ( C-like Perl internals autogenerated by SWIG)
- 60181 lines - Total Perl (generated by SWIG)
- 22941 lines- Hand-written Perl
- 8617 lines - Tests
- 13731 lines - POD (this actually includes some Perl implementation, probably <5%). Much of this was autogenerated from the GSL C documentation and reformatted, but it stills needs work, especially in making the POD render to HTML in a more pleasant way.
- 1112 lines - SWIG
The reason why Math::GSL requires something like SWIG becomes very apparent. The SWIG interface files are roughly 1/280th the length of the raw XS source code. No reasonable person would be hacking on Perl internals, but not even a reasonable Perl hacker wants to write all that error checking boilerplate cruft. Thanks SWIG!
This was made possible by ripping all Perl code out of the SWIG interface files and putting them in the pod/ directory. It is not strictly POD but a simple naming scheme was key and the majority of the files do happen to be POD, so whatev. And now vim correctly syntax highlights the files! I think there is something to be said for sticking to one language per file.