comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Compiling IDL code with a C compiler
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Compiling IDL code with a C compiler [message #40147 is a reply to message #40145] Mon, 19 July 2004 04:59 Go to previous messageGo to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Cedric,
You re not the first one with this idea. Unfortunately, we never hear a
success story from the people here in this news group. I would strongly
suggest to drop this thought and enjoy the summer instead. :-)

Cheers
Haje



"Cedric" <cedricl@videotron.ca> wrote in message
news:f09ca592.0407171110.53f3b776@posting.google.com...
> Hi everyone,
>
> I'm interested in writing an IDL-to-C compiler, for optimization
> purposes. To be clear about what I'm talking about, here's what some
> sample IDL code would look like:
>
> ;#COMPILE gcc -O1
> function EvaluateEnergy, field, area
> ; Type Declarations
> ;#field = fltarr(101, 101)
> ;#area = fltarr(101, 101)
> ;#sum = float(0.)
>
> sum = 0
> for x=0, 100 do begin
> for y=0, 100 do begin
> sum = sum + field[x,y] ^ 2 * area[x, y]
> endfor
> endfor
> return, sum
> end
>
> My IDL-to-C (pre)compiler would parse the IDL pro files, looking for
> functions preceded by a ;#COMPILE (aka ~preprocessor directive) and
> would translate the subsequent IDL code into the equivalent C code,
> compiling it with the options specified before. It would then replace
> the body of EvaluateEnergy with the proper external function call, and
> compile it with IDL's normal .compile compiler.
>
> So before I embark on such an endeavor, I decided to write here to get
> some input. Is there anything like that already out there? Is there a
> fundamental flaw in my thinking? Any suggestions, advice?
>
> Thank you,
>
> C�dric
>
> (Note: I'm fully aware that the function of my example should be a
> one-liner; it's for demonstration purposes, and because I intend to do
> a "litteral" IDL-to-C translation at first, and not support IDL's
> numerous notational shortcuts)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: call_external on windows - compaq
Next Topic: Subsetting an array with user defined values

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Nov 28 21:54:51 PST 2025

Total time taken to generate the page: 1.35727 seconds