Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: C tutorial for Perl programmers?

by syphilis (Chancellor)
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.


Replies are listed 'Best First'.
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).

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1052060]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2018-03-18 20:38 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (230 votes). Check out past polls.