Re: C/C++ conversion to IDL [message #44203 is a reply to message #44201] |
Tue, 31 May 2005 08:57   |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
Craig Markwardt wrote:
> nasalmon@onetel.net.uk writes:
>
>> Would anybody know if there is there software available to convert
>> programs in C into IDL (i know you can link in C programs to running
>> under IDL)? However, i am more interested in getting shorter, more
>> transparent code which is easier to work with. I obviously want the
>> minimum of hassel in converting the C code into IDL, so i dont want to
>> trawl through this myself converting it.
>
>
> I've always done it painstakingly, by hand. Usually I do a as direct
> a translation as possible, word for word, line for line. FORTRAN is
> the best for this since FORTRAN and IDL are more similar (than say, C
> and IDL). After that, I look for optimization opportunities.
I don't think there are any translation tools available. Even some of
the simplest C code can do crazy things with memory access, pointers,
shared libraries, etc. It'd be really hard to write a program that
could handle things beyond the basics and make a decent translation from
C to IDL. It'd be hard enough to write a decent C compiler. In this
case the compiler output would be IDL code rather than a binary, but I
digress. The best approach is to painstakingly and thoroughly translate
the code line by line as has already been said. With this you should
have an IDL program that works. Then go back and take care of
optimizations.
-Mike
|
|
|