Home > Archive > PERL Miscellaneous > March 2004 > RE: Converting From C to Perl
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
RE: Converting From C to Perl
|
|
| SketchySteve 2004-03-30, 11:42 am |
| Hi there,
I'm currently working on neural network project. The program i'm using
(SNNS) will automaticly create a network as a c function which can be
called.
I know there are tools for converting Perl into C but I was wondering if
there were any which worked the other way round.
Thanks for your help
Steve
| |
| Anno Siegel 2004-03-30, 12:39 pm |
| SketchySteve <nospamplease@no.com> wrote in comp.lang.perl.misc:
> Hi there,
>
> I'm currently working on neural network project. The program i'm using
> (SNNS) will automaticly create a network as a c function which can be
> called.
>
> I know there are tools for converting Perl into C but I was wondering if
> there were any which worked the other way round.
Don't you rather want to *call* the C function from Perl? Automatically
generating C code and translating that into Perl sounds like too strange
a concept. What would a conversion buy you, except a slowdown by 5 or 10?
Inline::C is good at making C programs callable from Perl. If the function
is in a library and you have a header file for it, with a little luck
it does it all by itself, but even if it doesn't, it's usually easy.
Anno
| |
| SketchySteve 2004-03-30, 12:39 pm |
| Thanks for the advice, I have looked into the inline module and it seems to
do what I want. The only drawback is that i will need to install Visual
Studio for it to work.
It looks like there is the option of using other utilities but they require
Perl being re-installed.
Ah well, trying to track down visual studio now.
Cheers
Steve
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:c4c7fv$ssc$2@mamenchi.zrz.TU-Berlin.DE...
> SketchySteve <nospamplease@no.com> wrote in comp.lang.perl.misc:
>
> Don't you rather want to *call* the C function from Perl? Automatically
> generating C code and translating that into Perl sounds like too strange
> a concept. What would a conversion buy you, except a slowdown by 5 or 10?
>
> Inline::C is good at making C programs callable from Perl. If the
function
> is in a library and you have a header file for it, with a little luck
> it does it all by itself, but even if it doesn't, it's usually easy.
>
> Anno
| |
| Paul Lalli 2004-03-30, 5:39 pm |
| On Tue, 30 Mar 2004, SketchySteve wrote:
> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
> news:c4c7fv$ssc$2@mamenchi.zrz.TU-Berlin.DE...
> function
>
>
> Thanks for the advice, I have looked into the inline module and it seems to
> do what I want. The only drawback is that i will need to install Visual
> Studio for it to work.
>
Uhm. Why? Inline::C just needs a C compiler. It certainly doesn't need
the bloat that is MS Visual Studio. Grab yourself a copy of the GNU C
compiler and install that. You don't need an entire IDE to use Inline::C.
Paul Lalli
|
|
|
|
|