[clean-list] IO-Library-> Joe

Philippos Apolinarius phi500ac@yahoo.ca
Sun, 4 Jul 2004 19:50:28 -0400 (EDT)


--0-44284844-1088985028=:81921
Content-Type: text/plain; charset=us-ascii

Dear Joe. 
Thanx for answering my questions. I played around with Maxima, and with Mathematica too. However, my teacher, Mr. Downs, thinks that  Haskell will be more helpful, because they cling closer to the concept of function. Since Clean is close to Haskell, I guess that I can stick with it. What is your opinion?  I am doing quite well with Clean, even with the Object IO library. It is quite annoying, but it presents no difficulty. Thus I do not understand why deprecate the other library, that can be of use for beginners, like myself.
In any case, if you help me with Haskell, I would love to try it too. I applied to a Haskell list, but I did not get any answer from the administrator; therefore, I am posing this question to the Clean list hopping that you Clean people take it lightly. I installed both GHC and Hugs in my machine. The first surprise is that I did not get a nice IDE, like Clean IDE, but  a bare bones interface, worse even than Maxima and Mathematica. I was not able to install a graphic library either, although I know there is one. I am writing programs to do last spring algebra assignments (I got a C+, which is very bad, but I hope to improve my knowledge of the subject before  next term :-). Below, there is a program to plot a parabola (slightly simplified to make it shorter).  The module StdIO imports StdEnv, and other libraries necessary for the program. How can I run this simple program in GHC? The compiler is installed in my machine, and I even tested it with simple text programs, and it works,
 although it generates code ten times larger than Clean. I suppose that this happens because I do not know how to use the optimization provided. Any suggestions?
 
module parabola
import StdIO 
Start w1= w2
where
  (ok, w2)= StartIO [WindowSystem [win]] 0  [] w1
    
win= FixedWindow 0 (10,10) "Example"
            ((0,0),(300,200)) paint  [GoAway bye]
bye st io= (st, QuitIO io) 
paint x pst= (pst, curve )
curve= [ MovePenTo(0,100), (fn 0 9)]
 
fn i n pic 
 | i > n= pic
 | True= fn (i+1) n (LinePenTo (i*10, 100-i*i) pic)



battelle <battelle@sonic.net> wrote:
Clean is not "easier" than Haskell.  It is different.  The uniqueness typing is certainly something that can be difficult to get your head around even for advanced programmers and though you can safely ignore it for toy examples, you cannot if you want to use the Object IO library..  "Details and red tape" are what separate the men from the boys so to speak in programming.  If you are looking for a functional language that is simple, then you might have an easier time with Scheme--there are plenty of books and good implementations for that language.
 
Having said the above, I think your approach is a little odd.  If you are having trouble understanding the concept of a function then you should get a Math program like MathCad or Mathematica (or an open source equiv.) and spend all summer putting in equations and composing functions and "looking" at the result.  Being able to visualize functions  is indispensible and has very little to do with functional programming.
 
As for why 0.8.2 is being deprecated, the reason is that "simpler" is not always better.  In programming as in life, "but no simpler" is as import as is "as simple as possible."
 
Joe
 

---------------------------------

From: clean-list-admin@cs.kun.nl [mailto:clean-list-admin@cs.kun.nl] On Behalf Of Philippos Apolinarius
Sent: Saturday, July 03, 2004 10:50 PM
To: clean-list@cs.kun.nl
Subject: [clean-list] IO-Library



As I stated before, I am starting High School next fall, and I am trying to grasp the concept of  function in my algebra course. I thought it would be a good idea to learn a functional programming language just to get the gist of it. I am playing around with Clean and Haskell. Since Clean is  easier than Haskell, my progress in Clean is much faster. However, I was having a lot of trouble with the Object IO library. It is full of details and requires a lot of red tape to do even the most simple operation.  I found another library in the distribution that is much simpler to use, more intuitive, and generates  smaller code. I am talking about the IO Interface 0.8.2. I did not find and documentation for this Standard Lib, and its settings on the IDE seems to be out of date. Therefore, I got the impression that IO Interface 0.8.2 is being deprecated. If this is true, why?
After all, it seems to be easier to use. Another question: Where can I find documentation for the IO Interface 0.8.2? Thanx.



---------------------------------
Post your free ad now! Yahoo! Canada Personals



---------------------------------
Post your free ad now! Yahoo! Canada Personals

--0-44284844-1088985028=:81921
Content-Type: text/html; charset=us-ascii

<DIV>Dear Joe. <BR>Thanx for answering my questions. I played around with Maxima, and with Mathematica too. However,&nbsp;my teacher, Mr. Downs,&nbsp;thinks that &nbsp;Haskell&nbsp;will be&nbsp;more helpful, because they cling closer to the concept of function. Since Clean is close to Haskell, I guess that I can stick with it. What is your opinion?&nbsp; I am doing quite well with Clean, even with the Object IO library. It is quite annoying, but it presents no difficulty. Thus I do not understand why deprecate the other library, that can be of use for beginners, like myself.</DIV>
<DIV>In any case,&nbsp;if you&nbsp;help me&nbsp;with Haskell, I would love to try it too. I applied to a Haskell list, but I did not get any answer from the administrator; therefore, I am posing this question to the Clean list hopping that you Clean people take it lightly. I installed both GHC and Hugs in my machine. The first surprise is that I did not get a nice IDE, like Clean IDE, but&nbsp; a bare bones interface, worse even than Maxima and Mathematica. I was not able to install a graphic library either, although I know there is one. I am writing programs to do last spring algebra assignments (I got a C+, which is very bad, but I hope to improve my knowledge of the subject before&nbsp; next term :-). Below, there is a program to plot a parabola (slightly simplified to make it shorter).&nbsp; The module StdIO imports StdEnv, and other libraries necessary for the program. How can I run this simple program in GHC? The compiler is installed in my machine, and I even tested it with
 simple text programs, and it works, although it generates code ten times larger than Clean. I suppose that this happens because I do not know how to use the optimization provided. Any suggestions?</DIV>
<DIV>&nbsp;</DIV>
<DIV>module parabola<BR>import StdIO </DIV>
<DIV>Start w1= w2<BR>where<BR>&nbsp; (ok, w2)= StartIO [WindowSystem [win]] 0&nbsp; [] w1<BR>&nbsp;&nbsp;&nbsp; <BR>win= FixedWindow 0 (10,10) "Example"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((0,0),(300,200)) paint&nbsp; [GoAway bye]</DIV>
<DIV>bye st io= (st, QuitIO io)&nbsp;</DIV>
<DIV>paint x pst= (pst, curve )</DIV>
<DIV>curve= [ MovePenTo(0,100), (fn 0 9)]</DIV>
<DIV>&nbsp;</DIV>
<DIV>fn i n pic <BR>&nbsp;| i &gt; n= pic<BR>&nbsp;| True= fn (i+1) n (LinePenTo (i*10, 100-i*i) pic)<BR></DIV>
<DIV><BR><BR><B><I>battelle &lt;battelle@sonic.net&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2>Clean is not "easier" than Haskell.&nbsp; It is different.&nbsp; The uniqueness typing is certainly something that can be difficult to get your head around even for advanced programmers and though you can safely ignore it for toy examples, you cannot if you want to use the Object IO library..&nbsp; "Details and red tape" are what separate the men from the boys so to speak in programming.&nbsp; If you are looking for a functional language that is simple, then you might have an easier time with Scheme--there are plenty of books and good implementations for that language.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2>Having said the above, I think your approach is a little odd.&nbsp; If you are having trouble understanding the concept of a function then you should get a Math program like MathCad or Mathematica (or an open source equiv.) and spend all summer putting in equations and composing functions and "looking" at the result.&nbsp; Being able to visualize functions&nbsp; is indispensible and has very little to do with functional programming.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2>As for why 0.8.2 is being deprecated, the reason is that "simpler" is not always better.&nbsp; In programming as in life, "but no simpler" is as import as is "as simple as possible."</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2>Joe</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390013518-04072004><FONT face=Arial color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr align=left><FONT face=Tahoma size=2><B>From:</B> clean-list-admin@cs.kun.nl [mailto:clean-list-admin@cs.kun.nl] <B>On Behalf Of </B>Philippos Apolinarius<BR><B>Sent:</B> Saturday, July 03, 2004 10:50 PM<BR><B>To:</B> clean-list@cs.kun.nl<BR><B>Subject:</B> [clean-list] IO-Library<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>As I stated before, I am starting High School next fall, and I am trying to&nbsp;grasp the concept of &nbsp;function in my algebra course. I thought&nbsp;it would&nbsp;be&nbsp;a good idea to learn a functional programming language just to get the gist of it. I am playing around&nbsp;with Clean and Haskell. Since Clean is&nbsp; easier than Haskell, my progress in Clean is much faster. However, I&nbsp;was having a lot of trouble with the Object IO library. It is full of details and requires a lot of red tape to do even the most simple operation.&nbsp; I found another library in the distribution that is much simpler to use, more intuitive, and generates&nbsp; smaller code. I am talking about the&nbsp;IO Interface 0.8.2. I did not find and documentation for this Standard Lib, and its settings on the IDE seems to be out of date. Therefore, I got the impression that IO Interface 0.8.2 is being deprecated. If this is true, why?</DIV>
<DIV>After all, it seems to be easier to use. Another question: Where can I find documentation for the IO Interface 0.8.2? Thanx.</DIV>
<P><BR>
<HR SIZE=1>
Post your free ad now! <A href="http://ca.personals.yahoo.com/"><B>Yahoo! Canada Personals</B></A><BR></BLOCKQUOTE><p><br><hr size=1>Post your free ad now! <a href="http://ca.personals.yahoo.com/"><b>Yahoo! Canada Personals</b></a><br>
--0-44284844-1088985028=:81921--