Strict<->Lazy?

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Thu, 01 Jul 1999 09:10:36 +0200


Dear reader,

I am new in the field of functional programming. I would like to learn
Clean. But I do not know if I should enter the door in that field.

Yesterday I wrote a little program for calculating the fibonacci
numbers. I do know from Maple that, e.g. evaluating the fibonacci number
40 is done in "real time" (and also e.g. the fibonacci number 100 is
done in real time; be aware that this is not a built in function). And
also Omikron Basic 6.3 (Basic for the Macintosh) makes the job in "real
time". And then I was shocked, because Clean requires 30sec! (and
curiously calculating the fibonacci number with real number is not
faster; the opposite is the case; maybe this is due to the fact that my
Macintosh 603e processor is good for integers).

After that I printed out the "Clean Language Report". I found in it that
it is possible to make a "strict" evaluation. But calculating the
fibonacci numbers in a strict fashion is n o t faster!

And now for myself I am thrown wheter I should make the next step and
learn Clean or I should go back to Fortran and Basic (and IDL).

I often read benchmarks that Clean is not much slower than C. And I am
not a friend of benchmarking  into the last detail. But what the people
do in their benchmarks? It is right that write down the code for
calculating the fibonacci number is much more easier than in Basic or
Fortran. But if someone needs really fibonacci numbers in a program how
can he wait 30sec! And in that context how can someone trust in writing
"real life applications".

I would be pleased to get answers (because I would like  printing out
tutorials and so on, for learning Clean).


Greetings,
Siegfried Gonzi