in reply to XS Modules - why and when?

I forgot another example of why someone may use C/XS that I've had experience with. One of my clients a few years ago had a Perl system that they deployed at client sites. The software was proprietary (ie. non-Open Source), but as we all know, there's no real way to obfuscate it so it's easily prone to theft and copying.

My client wanted a way to prevent this easy theft, so I suggested that we write some of the critical core components in C, compile it, then present it to Perl. That way, it's beyond trivial for the software to be stolen. Sure, the client could see all of the Perl code, but we didn't include the C library source, just the compiled shared library. Not perfect by any stretch, but pretty effective.