swig: November 2008 Archives

Inside Look of Math::GSL

| | Comments (0) | TrackBacks (0)
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. 

About this Archive

This page is a archive of entries in the swig category from November 2008.

swig: June 2008 is the previous archive.

Find recent content on the main index or look in the archives to find all content.

Screw you, spammers! Clicky Web Analytics