[clean-list] Interfacing to Foreign Code

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Sun, 18 Nov 2001 11:04:07 +0100


David McClain barabh@qwest.net wrote,

>I have only briefly looked at interfacing to foreign code from Clean about
>1-2 years ago. That was one of the things that attracted my attention to
>Clean, because I believe it had a pretty good and easy to use C interface.

I think the accompanying Readme will give you a quick overlook whether it is possible or not to have a ready
to use interface. I mean, you have the experience and will quickly recognise what you can expect from
HtoClean.

>I find myself spending about 50% of my programming time interfacing to
>foreign code, whether the main program is in Lisp, OCaml, NML, or whatever.
>The ability to interface easily to foreign code is, in my opinion, one of
>the most important features of a language.

If you need help I will assist you, but I think for the first time you will be faster alone.

Parallel to you project maybe I will start a simple 2d-plotting library in Clean alone. Because this code then
can serve well on the Macintosh (though maybe my next private machine will be an Intel-Laptop) and Windows
alike (and maybe also on Linux if some guys will come together and will implement the I/O stuff for Unix and
Linux).

[This is not a critique but I mention it here, that your project will include only the Windows platform].

A year ago I wanted to make (for the Macintosh) another project in Clean. Calculating the Array-discs (what
you see inside and outside of  focus at a star behind your telescope). One can then include the Zernike
polynomials and make the 2dFFT (with a proper aperture-function) and get the MTF (Modulation transfer function
and the image; with errors the Fresnel-integral can not be solved but numerically). 10 years ago R. Suiter
wrote a book about the stuff (principally the theory behind is the base-line for all the high resolution
solar-granulation images you often see with the exception that they make the step further and want to
de-convolve the image; a colleague, next to my seat, is involved in that bussines).

A Windows version exists ("Aberrator"). It has  appeared at the same time as I had completed my prototype in
Yorick (1000 lines of code). The Yorick program does all what I want (exept it has no GUI). I have to document
it first (okay, I have been saying this since 1 year now).

But now I feel more inclined to implement a plotting library in Clean. The first 70 pages of the I/O tutorial
should be enough. Because the first version should only be a static one: One output window and the
possibillity to save the plot as postscript or Pict/PMP to a file.


S. Gonzi