From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: From: James Chapman To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-Reply-To: <3e1162e60909061105p2b911917h820aca0e08b10b30@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-1--923040270 Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 6 Sep 2009 21:34:26 +0300 References: <542783.92348.qm@web83904.mail.sp1.yahoo.com> <55D72913-15FB-415F-BE43-7D173E0AC449@storytotell.org> <7AAFE4127E1DB57785BB273A@192.168.1.2> <9C0E59DDCCDD197FBD4EC404@192.168.1.2> <3e1162e60909061105p2b911917h820aca0e08b10b30@mail.gmail.com> Subject: Re: [9fans] nice quote Topicbox-Message-UUID: 66c2cc18-ead5-11e9-9d60-3106f5b1d025 --Apple-Mail-1--923040270 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Sep 6, 2009, at 9:05 PM, David Leimbach wrote: > On Sun, Sep 6, 2009 at 10:08 AM, Eris Discordia > wrote: > In this respect rating the "expressive power of C versus LISP" depends > very much on the problem domain under discussion. > > Of course. I pointed out in my first post on the thread that "[...] > for a person of my (low) caliber, LISP is neither suited to the > family of problems I encounter nor suited to the machines I solve > them on." I cannot exclude other machines and other problems but can > talk from what little I have personally experienced. > > I would like to see Haskell fill C's niche [...] > > Is it as readily comprehensible to newcomers as C? Are there texts > out there that can welcome a real beginner in programming and help > him become productive, on a personal level at least, as rapidly as > good C textbooks--you know the classic example--do? Is there a > coherent mental model of small computers--not necessarily what you > or I deem to be a small computer--that Haskell fits well and can be > taught to learners? I imagine those will be indispensable for any > language to replace existing languages, much more so in case of C. > > According to the designer of F# (another functional programming > language that takes it's syntax from O'Caml as well as Haskell and > even Python), one of the best experiences he'd had was working with > a high school student who was able to modify a solar system > simulation written in F# with no prior programming experience. > (from http://www.computerworld.com.au/article/271034/) > > There's books on F# out there, and F# for Scientists. > > http://www.ffconsultancy.com/products/fsharp_for_scientists/index.html > > There's books on multimedia programming in Haskell out there that > also attempt to show programming to newcomers, but I'm not sure any > of them really assume no prior programming experience. > > I think people learning C get one view of the computer that folks > learning assembly really learn to appreciate :-). Folks learning > Haskell learn another mental model of programming as well. > > My personal belief is that learning new languages makes one think > about the languages they are used to in a new light, and can make > them better programmers overall. > As you mentioned beginners books for Haskell I couldn't resist plugging Graham Huttons excellent beginners book "Programming in Haskell": http://www.cs.nott.ac.uk/~gmh/book.html It is based on 10 years of teaching a first year undergraduate course and is certainly accessible I believe. I've taught an undergraduate course myself using it. There is also the this book which complements Graham's quite well: http://www.realworldhaskell.org/blog/ I agree with David in that it is asking the wrong question as to whether there is a model of a computer that fits with Haskell. Haskell is based on a different model of computation. Conceptually, Haskell programs are executed by rewriting expressions not by manipulating memory in a machine. A trivial example: Here's a function to append a list onto a list: append :: [a] -> [a] -> [a] append [] ys = ys append (x:xs) ys = x:append xs ys and here we run it (on paper, no machine required :) ) on a some lists by applying the above rules where the match: Note: [1,2] is syntactic sugar for (1:(2:[])) append [1,2] [3,4] = { apply first pattern match equation } 1 : append [2] [3,4] = { apply first pattern match equation } 1 : 2 : append [] [3,4] = { apply second pattern match equation } 1 : 2 : [3,4] = { just syntactic sugar } [1,2,3,4] I wouldn't be as bold as to suggest that Haskell should replace C but certainly it is a nice language to use in my opinion. Does it explain how a computer works? No. Does it explain 'computation'? Yes. --Apple-Mail-1--923040270 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On Sep 6, 2009, = at 9:05 PM, David Leimbach wrote:
On Sun, Sep 6, 2009 at 10:08 AM, Eris Discordia = <eris.discordia@gmail.com><= /span> wrote:
In this respect rating the "expressive power of C versus LISP" = depends
very much on the problem domain under discussion.
=

Of course. I pointed out in my first post on the = thread that "[...] for a person of my (low) caliber, LISP is neither = suited to the family of problems I encounter nor suited to the machines = I solve them on." I cannot exclude other machines and other problems but = can talk from what little I have personally experienced.

=
I would like to see = Haskell fill C's niche [...]

Is it as readily = comprehensible to newcomers as C? Are there texts out there that can = welcome a real beginner in programming and help him become productive, = on a personal level at least, as rapidly as good C textbooks--you know = the classic example--do? Is there a coherent mental model of small = computers--not necessarily what you or I deem to be a small = computer--that Haskell fits well and can be taught to learners? I = imagine those will be indispensable for any language to replace existing = languages, much more so in case of C.
=

According to the designer of F# = (another functional programming language that takes it's syntax from = O'Caml as well as Haskell and even Python), one of the best experiences = he'd had was working with a high school student who was able to modify a = solar system simulation written in F# with no prior programming = experience.  (from http://www.comput= erworld.com.au/article/271034/)

There's = books on F# out there, and F# for = Scientists.


There's books on multimedia programming = in Haskell out there that also attempt to show programming to newcomers, = but I'm not sure any of them really assume no prior programming = experience. 

I think people learning C = get one view of the computer that folks learning assembly really learn = to appreciate :-).  Folks learning Haskell learn another mental = model of programming as well.  

My = personal belief is that learning new languages makes one think about the = languages they are used to in a new light, and can make them better = programmers = overall.


As you = mentioned beginners books for Haskell I couldn't resist plugging Graham = Huttons excellent beginners book "Programming in = Haskell":


It is based on 10 years of = teaching a first year undergraduate course and is certainly accessible I = believe. I've taught an undergraduate course myself using = it.

There is also the this book which = complements Graham's quite well:


I agree with David in that it is = asking the wrong question as to whether there is a model of a computer = that fits with Haskell. Haskell is based on a different model of = computation. Conceptually, Haskell programs are executed by rewriting = expressions not by manipulating memory in a = machine. 

A trivial = example:

Here's a function to append a list = onto a list:

append :: [a] -> [a] -> = [a]
append [] ys =3D ys
append (x:xs) ys =3D = x:append xs ys

and here we run it (on paper, no = machine required :) ) on a some lists by applying the above rules where = the match:

Note: [1,2] is syntactic sugar for = (1:(2:[]))

append [1,2] = [3,4] 
=3D { apply first pattern match equation = }
1 : append [2] [3,4]
=3D { apply first = pattern match equation }
1 : 2 : append [] = [3,4] 
=3D { apply second pattern match equation = }
1 : 2 : [3,4]
=3D { just syntactic sugar = }
[1,2,3,4]

I wouldn't be as bold as = to suggest that Haskell should replace C but certainly it is a nice = language to use in my opinion. Does it explain how a computer works? No. = Does it explain 'computation'? = Yes.





= --Apple-Mail-1--923040270--