Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: C tutorial for Perl programmers?

by syphilis (Canon)
on Sep 03, 2013 at 10:02 UTC ( #1052060=note: print w/ replies, xml ) Need Help??


in reply to C tutorial for Perl programmers?

I need to give them enough know-how to main XS code

I guess the first thing they need to know is the basics of C - and the fact that they already know some perl is pretty much irrelevant, IMO.
That is, I think they need to be taught the C basics the same way that someone who has never programmed at all is taught the basics of C. Since these people have already programmed in perl, they may well learn more quickly than those who have not done any programming at all, but I think both groups should be given the same course (whatever that may be).

Once they have some proficiency in C, they then need to be taught how to implement C code in perl. For this, two things come to mind:
1) the perlxstut, perlxs and perlguts documentation;
2) the demos in Inline::C's C-Cookbook.pod

In the final analysis, there's not much difference between XS and Inline::C - and I think the latter's capacity to help programmers learn the former should not be underestimated.

For someone who knows perl but not C, it's a fairly steep learning curve - a curve that I would not expect to be negotiated quickly.

Cheers,
Rob


Comment on Re: C tutorial for Perl programmers?
Re^2: C tutorial for Perl programmers?
by QuarterToWhen (Novice) on Sep 03, 2013 at 10:55 UTC

    I had been hoping I could relate things to what they already know in Perl. e.g. they've all seen things like ARRAY(0x84902a0), the deference arrow works in a similar way in Perl and C, and a lot of the syntax is deliberately similar.

    I don't have a lot of hope for getting people up to XS, but I'd like to give them a good start.

      I don't have a lot of hope for getting people up to XS, but I'd like to give them a good start

      The nice thing about Inline::C is that it's XS under the hood but, to use it, you don't really need to know any XS at all - you just need to know some C (and, for starters, to read the perlapi documentation).

      Cheers,
      Rob
Re^2: C tutorial for Perl programmers?
by Anonymous Monk on Sep 10, 2013 at 00:32 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1052060]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-08-22 07:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (148 votes), past polls