Language::XS    adcO     create c/xs code on the fly, witgout a Makefile        
MLEHMANN

This module allows one to create c functions "on the fly", compile them
and use them from perl. This is useful for programs that want to create C
code (e.g. for speed) that needs to be tailored at runtime of a program (PDL
requires this).

While it's not a XS or C Interpreter, it is some kind of "xs language
interface", so I guess the name makes sense.

For added discussion benefit, here is a usage exmaple:

 # create a Language::XS-object
 my $xs = new Language::XS cachedir => undef;
 # add plain C to the header
 $xs->hdr("#include <stdio.h>");
 # add a c function (not directly xs syntax)
 $xs->cfun('printf ("I was called with %d arguments\n", items');

 # now compile and find the code-reference
 my $coderef = $xs->find;
 # Now call it
 $coderef->(1, "Zwei", 1/3);


-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [EMAIL PROTECTED] |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |

Reply via email to