----- Forwarded message from Nathan Torkington <[EMAIL PROTECTED]> -----
------- start of forwarded message -------
From: Brian Ingerson <[EMAIL PROTECTED]>
To: Nathan Torkington <[EMAIL PROTECTED]>
Cc: Brian Ingerson <[EMAIL PROTECTED]>
Subject: Re: rimmage
Date: Tue, 19 Jun 2001 15:14:30 -0700

On Tue, Jun 19, 2001 at 02:54:15PM -0600, Nathan Torkington wrote:
> My first reaction is: ick.  Won't that confuse the crap out of 
> your editor?

That's a good question. Actually, its not too bad. Let's look at the specific cases:

1) emacs - Works out pretty good. C looks a lot like Perl so emacs does the right 
thing most of the time.

2) vi - This editor considers everything after __END__ to just be data (AutoLoader; 
heLLO!) so nothing gets effected (all one color), which works out fine for Inline.

3) Komodo et al - dunno - don't do visual :) But I have had talks with the Komodo team 
about having multimode. It would be very easy to hack up. Hell, an emacs multimode 
would be a piece of cake. <* ingy scribbles note on back of hand *>

Another thing to realize is that if you have a huge Perl/C project, you don't Inline 
the whole thing. I stress this in my tutorials. Just put the interface code inline. 

> Are there any tangible benefits to rewriting XS code to use Inline,
> e.g. speed, or are the benefits mostly in maintainability?

Speed is the same. Inline is just XS at that level.

Usability increases based on the way Inline writes XS. Each function can be called 
from *both* Perl and C. 

Readability scores big. No glue code to look at. Just C. And the functions just DWIM.

Ease of use goes way up. Tweak run. Just like Perl. Who really *wants* to compile 
these days.

Maintainability is tangible isn't it? Consider this:

  Say you have an installed module (from CPAN; written by someone else (in your case a 
necessary precondition ;-) ) and you want to start tweaking it. Normally you just copy 
it out of your site install tree and start hacking. But what if the module has C 
components? Awww darn. You need to go download the distribution. 

  With Inline the experience is like that of pure Perl. Just copy it, and start 
hacking.

  That will be huge for getting new people to start playing with C and internals by 
copying the gurus. I'm talking Gisle into rewriting at least one module this way. I'm 
hoping Inline will spawn a whole new realm of Perl hacking. That would just be good 
for OSS as well as for Perl.

In conclusion, I've slowly eliminated any advantage XS might have. I think I'm past 
80/20. And I'm all ears for ideas. I really hope I never get too entrenched in a 
certain way of thinking. I try to design all this stuff so that everyone can play and 
even take over if they have a better idea. You might notice that there's not one 
change in the core that was needed to make Inline work. That's what's so great about 
Perl. You can just work around what others have done, without needing them to change 
anything for you. It's just that rich.


Cheers, Brian

------- end of forwarded message -------

----- End forwarded message -----

Reply via email to