If you do code directly to the Perl C API, you will find that it is difficult, error-prone, tedious, and repetitive. Epiphany Eventually, you begin to see the advantage of wrapping these little bits of code in macros, so that you can write them once and then stop worrying about them. The first thing you need in order to write an XS module is a program that you absolutely cannot write in straight Perl. Writing C and XS when you could be writing Perl would be an egregious failure to be Lazy. It's so classical, so linear, so old-tech.
Sequence alignment is an important problem in the bleeding-edge field of genomics .
Here is some motivation for the sequence alignment problem, cast in the language of computer engineering a brief description of dynamic programming, as applied to a simpler problem a description of the NW algorithm a straight Perl implementation of the NW algorithm Sequence alignment is a combinatorial problem, and naive algorithms run in exponential time. As a benchmark, I aligned 2 sequences of 200 characters each. This is a rather modest problem by the standards of genomics. The Perl implementation aligns them in something like 200 or 400 seconds. I wrote a C program that fills in the score matrix.