I'm forwarding a series of messages that I had with Nat Torkington which explain
Inline's relationship to XS. I hope they are helpful.
Cheers, Brian
PS I have annotated/censored slightly.
----- Forwarded message from Nathan Torkington <[EMAIL PROTECTED]> -----
------- start of forwarded message -------
From: Brian Ingerson <[EMAIL PROTECTED]>
To: Nathan Torkington <[EMAIL PROTECTED]>
Subject: Re: rimmage
Date: Tue, 19 Jun 2001 12:45:29 -0700
On Tue, Jun 19, 2001 at 01:27:32PM -0600, Nathan Torkington wrote:
> Brian Ingerson writes:
> > Most importantly is acceptance. I don't know how how many of you
> > have noticed, but there is nearly no cross-posting between the
> > Inline and XS mailing lists.
>
> Until we talked at YAPC, I had three misconceptions:
> * Inline was for trivial extensions
> * Inline mandated you put your C code in a heredoc in a Perl module
> * Inline had one model of compilation: your extension is compiled the
> first time it's used, and then cached.
I wondered why you were still talking about XS so much<at YAPC>. I had always thought
that you were already drinking the kool-aid. I guess there's still a few more
important people to get through to. (At least Simon's on board. He's one of the
toughest I've found)
>
> At YAPC I learned:
> * Inline exposes almost all the Perl API, so you can do pretty much
> any XS thing with Inline, only it's easier :-)
Yes. Much easier. And on many levels. It's very win/win
> * Most Inline modules are written with the C code in separate files
> where it belongs. The heredoc stuff I'd seen was an aberration.
Putting code in a separate file is a possibility, but not the norm. Here is the
canonical form:
use Inline C => DATA =>
[key => value, ...];
# perl code here
__DATA__
__C__
/* C code here */
> * Inline also has an h2xs-like mode, where you make and make install,
> and it's compiled and installed in much the same way as a regular
> XS module.
>
> I can't speak for others, but that's why I'd always figured Inline was
> no match for XS. Now I'm a convert.
I'm really glad you are. Now if we can just get Nick to start writing perl-xs examples
using Inline... :)
Cheers, Brian
BTW, your message has still not made it to the lists. wonder what's up?
------- end of forwarded message -------
----- End forwarded message -----