Imperative Notation

Ana Maria Abrao ana@ufu.br
Wed, 10 Feb 1999 02:11:48 -0200


Nick Kallen wrote:
> 
I have read your long mail about how bad is Clean IO.
You say, among other things, that it is much easier to
program IO in Java than in Clean. Well, I understand
why you made such a statement. However, it is not true.

Let's assume a very flexible imperative language (called Iter,
from the Latin word for path), 
where change of state would be achieved by just one statement:
Goto. However, that language  has means to combine
Gotos in order to build things like if-then-else, while-do,
repeat-until, etc. Defining these constructs was left to the
programmer. It is a pity that the designers of Iter 
have not produced any documentation, 
explaining how to combine GOTO's to create things 
like iterators. In that
case, someone could think that change of state in Iter
 is much harder than, say, in Java,
but he would be mistaken.

I work with multimedia. What I do for living is designing
input/output. I hardly do anything else but input/output. 
I don't know Haskell, but I do have a lot of (bad) experience
with Java and ML. I can assure you: Input/output is much
easier in Clean. Since our friends from the Clean team
(and Dr. Zuurbier) are all Dutch, consider the book on
Computer Graphics in Java by another Dutch, Leen
Ammeraal (Computer Graphics for Java Programmers,
Leen Ammeraal, Wiley). This author have written very competent
Java programs for well known algorithms. However, his
results in terms of tersiness and clearness are pitiful,
when compared to the same algorithms written in Clean 
by some people I know. I am planning to post some of
these programs in my page, if I get permision from the
authors to do it.

My conclusion: What Clean lacks is not better IO.
It is good documentation both for the libraries
and for Software Engineering techniques to use
them. For lack of time, or for some other reason, 
Clean team doesn't talk very much about how to use the libraries.
Anyway, I will try to convince you that IO is
easy in Clean. I will prepare a few small programs,
and send them to you. Give me one month. OK ?

By the way, if you want to use monads in Clean,
it is as easy as in Haskell (I guess). I will
try to find a few examples of that too, but
you need to promise me one thing: Let's prepare
a documento to help other people in using Clean IO.
You know, my English is less than perfect. If you
people don't help me, I just cannot write 
decent English (or French, or Japanese, or Latin,
or Portuguese :)