<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi, Henrique.<br>I couldn't resist adding a few comments. Clean is much better than Haskell, in the following senses:<br><br>(i) It generates faster code, smaller exec files, and uses less memory. The compiler is also much smaller than GHC. Clean has even more features than Haskell, but occupies less space in your hard disk.<br> (a) Distribution: GHC 6.10.4 --- 52M versus Clean 2.2 --- 14 M. <br> (b) Fibonacci compiled code (below): GHC --- 1M versus Clean 2.2 --- 57 K<br> (c) Fibonacci time (fib 40): GHC --- 7.422 s versus Clean 2.2 --- 1.7s<br> (d) Schmidtt's Neural net: GHC --- 12.8 s versus Clean 2.2 --- 0.37 s<br><br>(ii) Clean has efficient array processing, as you can see from the example of Neural Network. Clean takes less than 0.1s to train and run the neural network in my
machine. I won't tell you how long Haskell takes, because you will not believe me. A hint: Haskell takes much, much longer.<br><br>(ii) Clean is safer, since it does not allow things like trying to write into a closed file.<br><br>Well, Henrique, I would be very happy if I had an option in functional programming. Competition is good. However, it seems that Clean is alone in the arena. I wrote many letters to the Haskell community, requesting smaller exec files, and better array processing. This is necessary to make Haskell a realy good tool.<br><br>By the way, the Neural Network example comes from a paper by Peter Schmidtt et al. <br><br>//Fibonacci in Clean<br>module fibo<br>import StdEnv, ArgEnv<br><br>fib n | n < 2 = 1<br> | otherwise = fib (n-1) + fib (n-2)<br><br>Start= fib (toInt argv.[1])<br>where<br> argv= getCommandLine<br><br>-- Fibonacci in Haskell<br>module
Main( main ) where<br> import System( getArgs )<br><br><br> fib n | n < 2 = 1<br> | otherwise = fib (n-1) + fib (n-2)<br><br> -- Function f_print prints the n'th Fibonacci number<br> f_print n = print(show n ++ "th Fibonacci number is " ++ show (fib n))<br><br> -- Function main is the entry point of the program<br> main = do<br> args <- getArgs<br> if (length args /= 1)<br> then putStr "Usage: f1a <n>"<br> else (f_print (read (head args)))<br> putStr "\n"<br><br><br>// Neural network in Clean<br>module arrays<br>import StdEnv<br><br>sig x = 1.0 / (1.0 + (exp (~ x)))<br><br>error vt = loop vt 0 0.0<br>where<br> loop vt i acc | i>= size vt = (acc, vt)<br> loop vt i
acc<br> # (e, ww) = vt![i] <br> = loop ww (i+1) (acc+e)<br><br>na vt=:{[4]=x, [5]=y, [6]=z} [i1, i2]=<br> (sig (x+y*i1+z*i2), vt)<br><br>ns vt [i1, i2, i3]<br> # (v0, vt)= vt![0]<br> # (v1, vt)= vt![1]<br> # (v2, vt)= vt![2]<br> # (v3, vt)= vt![3]<br> = (sig(v0+i1*v1+i2*v2+i3*v3), vt)<br> <br>gate vt [i1, i2]<br> # (n1, vt)= na vt [i1, i2]<br> # (n2, vt)= ns vt [i1, n1, i2]<br> = (n2, vt)<br> <br>errSum v2 [] acc= (acc, v2)<br>errSum v2 [ex:s] acc<br> # v= hd ex<br> # (vc, v3)= gate v2 (tl ex)<br> = errSum v3 s (acc+(vc-v)*(vc-v))<br> <br>updweight vt nvt err0 ns exs = loop 0 vt nvt <br>where<br> dx = 0.01<br> mu = 0.5<br> loop i vt vs | i > ns = (vs, vt)<br> loop i vt vs<br> # (v,
v1) = vt![i]<br> # v2 = {v1 & [i]= v+dx}<br> # (nerr, v3)= errSum v2 exs 0.0<br> # nv= v + mu*(err0 - nerr)/dx<br> = loop (i+1) {v3& [i]=v} {vs & [i]=nv}<br><br>train exs = loop v1 v2<br>where<br> v1 :: .{#Real}<br> v1 = {0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0}<br> v2 :: .{#Real}<br> v2 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}<br> loop vt nvt<br> # (nerr, vt) = errSum vt exs 0.0<br> | nerr < 0.01 =vt<br> # (vt, nvt)= updweight vt nvt nerr 6 exs<br> = loop vt nvt<br> <br>Start = xor 0.0 0.0 // (xor 0.0 0.0, xor 0.0 1.0, xor 1.0 0.0, xor 1.0 1.0)<br>where<br> vt :: .{#Real}<br> vt = train exs<br> exs = [eg e\\
e <- [0,1,2,3,3,2,1,0]]<br> xor i1 i2= fst(gate vt [i1,i2])<br> <br>eg 0 = [0.0, 1.0, 1.0]<br>eg 1 = [1.0, 1.0, 0.0]<br>eg 2 = [1.0, 0.0, 1.0]<br>eg 3 = [0.0, 0.0, 0.0]<br><br><br>--- On <b>Mon, 10/12/09, rinus plasmeijer <i><rinus@cs.ru.nl></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: rinus plasmeijer <rinus@cs.ru.nl><br>Subject: [clean-list] Re: Clean<br>To: "Henrique" <henrique_gusmao_@hotmail.com><br>Cc: clean-list@science.ru.nl<br>Received: Monday, October 12, 2009, 1:22 AM<br><br><div id="yiv1931202843">
<style></style>
<div><font size="2" face="Arial">
<div dir="ltr">Hi Henrique<br></div>
<div dir="ltr"> </div>
<div dir="ltr">> Is this e-mail still working? <font size="2" face="Arial"><a rel="nofollow" target="_blank" href="http://clean.cs.ru.nl/">http://clean.cs.ru.nl/</a></font></div>
<div dir="ltr"> </div>
<div dir="ltr"> </div>
<div dir="ltr">Yes.</div></font></div>
<div><font size="2" face="Arial">
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">>I want to know more about Clean: news?
updates?</font></div>
<div><font size="2" face="Arial">> What is the future of Clean?</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">See: <a rel="nofollow" target="_blank" href="http://wiki.clean.cs.ru.nl/Latest_developments">http://wiki.clean.cs.ru.nl/Latest_developments</a></font></div>
<div><font size="2" face="Arial">We are working on a new version which allows you to
mix Clean and Haskell 98 code.</font></div>
<div>It is a lot of work, it will still take some time. </div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">> Is Haskell killing Clean? </font></div>
<div><font size="2" face="Arial">Haskell is certainly much more used, which is also
the raison for adding a Haskell front end.<br></font><br>> I would like to
learn and test Clean, and maybe then use it commercially. <br>> Where do I
can download it? I send e-mail to <a rel="nofollow">clean@cs.ru.nl</a> , asked for
Clean at the site above, but I got no answer.<br><br>We did not got your
email.</div>
<div>To download browse to: <a rel="nofollow" target="_blank" href="http://clean.cs.ru.nl/Download/main/main.htm">http://clean.cs.ru.nl/Download/main/main.htm</a></div>
<div> </div>
<div>> Obs: I am using windows platform. </div>
<div>Thats fine, it should work on any windows platform.</div>
<div> </div>
<div><br>Greetings,</div>
<div> </div>
<div>Rinus</div>
<div> </div></font></div></div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>clean-list mailing list<br><a ymailto="mailto:clean-list@science.ru.nl" href="/mc/compose?to=clean-list@science.ru.nl">clean-list@science.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/clean-list" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/clean-list</a><br></div></blockquote></td></tr></table><br>
<hr size=1><a href="http://ca.promos.yahoo.com/newmail/overview2/"><b>All new Yahoo! Mail - </b></a>Get a sneak peak at messages with a handy reading pane.