[clean-list] Communicating with other programs

Jerzy Karczmarczuk karczma@info.unicaen.fr
Thu, 15 Nov 2001 17:55:02 +0100


Siegfried Gonzi :

> Lets take the case I have written a Clean program which reads in from a
> file into a Clean array, performs some calculations and now I have only the
> option to save my calculations in another file and post-process this file 
> with a visualization tool. But wouldn't it be nice I can circumvent the 
> file saving process and pass my array directly for plotting to a tool like
> GNU-plot or Matlab (only to mention a few without any specific meaning)?

...

> Has anybody ever tried to glue Clean with a plotting tool? Yes I know, it 
> would be really a nice plan to start a plotting library in Clean (I/O) itself.
> But this takes menpower (I mean not Nijmengen-power; they should concentrate 
> on Clean). But in the meantime? I really would like to know how Python does 
> it? How is it possible that they include without any problems GNU-plot?

1. Since the beginning, GNUPlot was pipe-able, and there was a nice Tcl/Tk
   interface producing a plotted data + textual description of parameters
   which was subsequently interpreted by GNUPlot through a Unix pipe. 
   No need to save files.

2. I used Clean in such a way, and some pictures in my Recife talk
   http://users.info.unicaen.fr/~karczma/arpap/fu3ncdH.pdf
   were produced in this manner. Some others got the data generated by Clean
   and were rendered by Matlab. It worked. Nothing else to say...

3. I did some silly experiences with SVG. Clean produced some recursive vector
   graphics, and Adobe plugin (or Batik) rendered it. Quite trivial.

4. Even more silly, really dumb 1-dim plotting functions, coded just for
   testing are included in Clastic, my texturing library in Clean. I had
   never any motivation to work on that seriously.

I have mixed feelings. Functional languages *should* offer a complete set of
interfacing procedures, including plotting, drawing, painting, etc. But...

1. It should be multi-platform. Personally I won't start anything before being
   able to to use the same primitives under Windows and Unix.

2. This is a technical work almost without any scientific interest, so it
   is not easy to convince people at the Academia to work hard on it. (Clastic
   was born as a pedagogical project).

3. It may have some sense in a context, where Clean or other language is
   exploited as it should, with its polymorphism, higher-order functions,
   closures, etc. Using a functional language in a niche occupied by Basic
   etc. seems redundant.

Jerzy Karczmarczuk
Caen, France