It is possible to compile C and Fortran routines to extend the S system. Full documentation is provided in the StatSci Programmers Manual and an annotated example plus local documentation can be found in /usr/biostatistics/doc/Splus/C-interface.