At 01:10 PM 8/17/00 +0000, Simon Cozens wrote:
>In comp.lang.perl.announce, Brian Ingerson wrote:
> >Inline.pm allows a programmer to write C code directly inside a Perl
> >script and just run it. No XS, no SWIG, no make. Using Inline to write
> >extension modules for the CPAN is fully supported and just as easy. C++,
> >Fortran, Pascal, and Python are also being considered for future
> >releases.
> >
> >        BEGIN {$c_code = &c_code_generator()}
> >        use Inline C => $c_code;  # will die if code doesn't compile
> >        myfunc1();
> >
> >        greet('Ingy');
> >        greet(42);
> >
> >        use Inline C => <<'END_OF_C_CODE';
> >
> >        void greet(char* name) {
> >          printf("Hello %s!\n", name);
> >        }
> >
> >        END_OF_C_CODE
>
>Wow. I'm sold. Can this be how we should be doing XS in Perl 6?

I have this sneaking suspicion it's not nearly that easy, nor as portable 
as we might like, though I suppose we can fix that. :)

I'm not sure it's the best way to go for XS, though if it works (and we 
don't invoke a C compiler every time we execute the program...) it could be 
a useful addition to the tool set.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to