Re: Questions about Inline::C



Mirco Wahab <peace.is.our.profession@xxxxxx> wrote:
One question in advance: Why use Inline::C if
your C-Program is what counts. Why don't you

Not really. The C program does not do anything new (Needleman-Wunsch +
Smith-Waterman algorithms with one or two important modifications that you
will not find elsewhere). The Perl part is, apart from the parsing and
output formatting, Real Science (TM) :-) It does not take as much time to
calculate, but its tricky.

simply link the 'perl' to your program and
call it with the stuff you need. This is,

You mean, call Perl from C and not C from Perl? Hmm, that could be a
solution as well. However, I have much more stuff (and also much more
stuff that matters) in Perl than I do in C -- for my project, I have now
only two small functions in C that do a simple job quickly. For everything
else, I have my Perl.

I am wondering, however, how complicated it is to link an existing C
library to Perl. I am sure there are dozens of examples for that, if you
know of a good one, I would love to see how it works...

in large projects (imho) *much* simpler than
vice versa.

Because I am lazy :-) and because it is not a large project.

Perl will be much slower if used trivially so (I can tell
you this). Just use your matrix in C as usual and make
some Into-Perl-Calls if necessary, eg. by pack(...)-ing
your variables into Perl-scalars and unpacking
them again in the perl.

Thanks,

January

--
.