The source code in XS is being compiled into the machine code. See perlxs for details, but it's rather advanced, so maybe start with Wikipedia that has a nice basic introduction.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [Watch: Dir/Any] [d/l] |
You could roughly define XS as a macro language - it is only a little bit more than pure C with a bunch of predefined macros. It is preprocessed by xsubpp into C, then compiled with the appropriate C compiler into an object file (i.e. machine code).
It needs the same version of perl mainly because it deals with a bunch of perl's internal data structures - when compiled, that bakes in knowledge of the size of those structures, and the offset of various elements within them. It also bakes in knowledge of the signature of the various perl internal functions it may call, along with compiler-specific calling conventions.
| [reply] [Watch: Dir/Any] [d/l] |