tag:blogger.com,1999:blog-16940011.post1632821078774105223..comments2023-05-18T07:00:11.972-07:00Comments on Yariv's Blog: Questioning Questioning Functional ProgrammingYarivhttp://www.blogger.com/profile/01787159103926738266noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-16940011.post-55920737831139985132007-10-16T21:40:24.000-07:002007-10-16T21:40:24.000-07:00Hi Yariv.Here is Mr. Joe Armstrong to me:-----Erla...Hi Yariv.<br>Here is Mr. Joe Armstrong to me:<br>-----<br>Erlang/OCaml/Haskell belong to the same language family - if you learn<br> any one<br>of them then learning the next one in the family will be a lot easier<br>than starting from scratch.<br><br>These language differ - but have the same core concepts - the idea of<br> immutable<br>state - programming with immutable state is the thing that you need to<br> learn.<br>The details of how you do this vary from language to language (you can<br>use processes<br>with tail recursion to model state in Erlang, or monads in haskell,<br> etc.).<br><br>I'd start with the language that most suits your problem domain - a<br>rough guess might<br>be to think of these languages as follows:<br><br>OCaml - use as a replacement for C - good for implementing virtual<br>machine emulators<br>tightly coded non-distributed applications.<br><br>Erlang - use as a replacement for Java - good for programming<br>distributed fault-tolerant<br>applications - good support for multicores/concurrency. Good as a glue<br>language to<br>glue together components co-ordinate activities on different machines<br> etc.<br><br>Haskell - use for implementing domain specific languages, symbolic<br>computations etc.<br><br>Asking which is best is like asking which is best out of C++/java/C#<br>or perl/python/ruby<br><br>Languages come in 3-packs - learn any one then learning the others is<br>easy - similar ideas<br>different packaging.<br><br>/Joe Armstrong<br>------<br>Very insightful.<br>Actually, I decided to go with Erlang.<br>BTW, thanks for ErlyWeb ;)Hussein Baghdadihttp://hubaghdadi.wordpress.com/noreply@blogger.comtag:blogger.com,1999:blog-16940011.post-35130557038330880112007-10-16T22:52:07.000-07:002007-10-16T22:52:07.000-07:00It’s an increasingly common misconception that fun...It’s an increasingly common misconception that functional languages are innately better at concurrency (ala Erlang).<br><br>While Erlang is very good as what it does, this in no way implies functional programming is inherently better for distributed-concurrency. (Of course it doesn’t imply its worse either.)<br><br>Smalltalk and others were using messages to handle concurrency for years before anyone had even heard of Erlang. That its designers chose a functional core for Erlang has nothing to do with this.<br><br>Frankly I’m getting annoyed that obviously uninformed people keep repeating this rubric.<br><br>I don’t mean to offend, just getting tired of hearing and correcting it.Marknoreply@blogger.comtag:blogger.com,1999:blog-16940011.post-47643398222464365942007-10-16T22:57:06.000-07:002007-10-16T22:57:06.000-07:00I read the Torkington article differently. His poi...I read the Torkington article differently. His point was that many functional programmers abandon their favorite language too easily. He didn't question functional programming. Rather he observerd that many programmers question functional programming when they shouldn't. He wrote that we need someone like DHH to give the masses the confidence to choose a functional programming language.<br><br>The above is just my interpretation of the original article, not my opinion. This however is me:<br><br>I don't think you can draw any conclusions from a programming contest named after a functional programming conference. Both the preferred language and the skill distribution of the contestants are heavily skewed.Antti Tarvainenhttp://tarvainen.wordpress.comnoreply@blogger.comtag:blogger.com,1999:blog-16940011.post-64427647118098971262007-10-16T23:04:59.000-07:002007-10-16T23:04:59.000-07:00* Sorry, I meant my last comment to go into the &q...* Sorry, I meant my last comment to go into the "Questioning Functional Programming" post. Not this one.<br><br>I assume you missed this. I found it rather interesting/revealing. <br><br><br>"... considering it's a competition organized by the International Conference on Functional Programming, perhaps the fact that most participants are using C++ is notable... " - Daniel Larsson, a comment on 'Questioning Functional Programming'<br><br><br>That only 122 out of 421 teams participating in a competition hosted by the International Conference on Functional Programming, is bizarre. Its been noted.<br><br>Given that the conclusion might not be too far off, though I don't agree with it completely.Marknoreply@blogger.comtag:blogger.com,1999:blog-16940011.post-48195023088823256072007-10-17T01:22:06.000-07:002007-10-17T01:22:06.000-07:00I wonder if there is some reverse psychology going...I wonder if there is some reverse psychology going on. For example if it were called the "International Perl Sucks Conference" then I'm sure that 99% of the entries would be written in Perl by people aiming to prove that Perl doesn't suck.Neil Bartletthttp://neilbartlett.name/blognoreply@blogger.comtag:blogger.com,1999:blog-16940011.post-59714681016545324802007-10-17T02:44:28.000-07:002007-10-17T02:44:28.000-07:00I really wasn't sure how to take the linked ar...I really wasn't sure how to take the linked article, honestly. Read one way, it looks like he's just knocking Erlang & funtional programming. Read another way, it looks like he's saying the only thing holding Erlang & FP back is a strong leader.<br><br>And, of course, seeing both of these in parallel makes me wonder if he's just trying to throw some FUD around to get blog hits. ;)<br><br>I see you noticed the EC2 announcement as well. How long, do you think, before we see a demo Erlyweb app load-balanced across some EC2 nodes? You know that extra-large configuration looks like an Mnesia-user's dream!Bryanhttp://beerriot.com/noreply@blogger.comtag:blogger.com,1999:blog-16940011.post-17612929433908565592007-10-17T04:08:54.000-07:002007-10-17T04:08:54.000-07:00I think one of the things that's missing from ...I think one of the things that's missing from both the original article and your article is a treatment of the actually workings of the contest and the appropriateness of specific programming languages. I participated in last year's (9th) ICFP contest but not this year's (and I haven't even looked to see what the problem was).<br><br>Speaking for last year's, the first step in the problem required implementing a virtual machine that was intentionally designed to be inefficient and thrash memory. My team started out in our favorite functional language but soon discovered that the lack of support for direct bit manipulation in our language of choice was causing our implementations (because we tried to fake bit manipulation in several different ways) to be so slow as to be completely useless. We then rewrote the vm in C and quickly moved on to the rest of the contest.<br><br>It turned out that implementing that vm was only a very small portion of the entire contest and netted you only a few points. However, actually completed that single task meant you were in the top 250 entries because so many people were unable to get it to work.<br><br>If I recall correctly, the contest creators eventually admitted that they wanted people to realize that sometimes functional languages are not always the best tool for the job. If we had realized that sooner we would have completed more of the contest but instead we were stubborn and were only able to complete 2-3 more tasks. After (and a little during) the real contest there was a informal competition of virtual machine speed on a benchmark created by the contest creators. I believe the fastest implementations ranked by language were C/C++, OCaml, Haskell although perl may have also been in the running as well.<br><br>Does anyone know what this year's ICFP contest was about? Most functional languages tend to be fairly high level, often at the expense of allowing experienced programmers to choose when they actually need really tight control on things like memory allocation. Perhaps this year's contest did not play to the strengths of most functional programming languages. There really isn't just one single tool for every job (even if you lump a whole class of languages together as "one" tool).Rob Van Damnoreply@blogger.comtag:blogger.com,1999:blog-16940011.post-36326916048463341182007-10-17T16:17:52.000-07:002007-10-17T16:17:52.000-07:00@Mark I wasn't aware that Smalltalk is as good...@Mark I wasn't aware that Smalltalk is as good at concurrency as Erlang. I haven't used Smalltalk, but from what I know of it it's a minimalistic, dynamically typed pure OO language with late-binding semantics. Most people I've met who have used Smalltalk, love it. However, I've never heard anyone tout its concurrent programming capabilities. I would be happy to learn more about it.<br><br>@Antii I guess we read the article's meaning differently. I agree we can't draw any meaningful conclusions about the merits of FP from this contest.<br><br>@Mark I think that the title of the competition doesn't mean much if it's open to any programming language. Plus, C++ is functional -- have you looked at Boost Lamba? :)<br><br>@Bryan I think his saying "functional languages lack a reason to use them" is a bit stronger than saying "they are great but they need a DHH." Whatever he meant, though, the EC2 announcement came at a fortuitous timing, because it gave everyone a great reason to use functional languages: 4-8 core instances at $0.40 - $0.80/hour :) I'm kind of busy these days, but I think it would be great if someone created an EC2 image with Yaws + ErlyWeb + MySQL preinstalled, and with Tsung to give them a serious stress test.<br><br>@Rob I agree that functional languages aren't always the best tools -- especially if you're doing low level coding or if you need to use libraries that aren't available for them. And it's true that functional (and non-functional) languages excel in different areas. Haskell and O'Caml are good for computational/algorithmic tasks, whereas Erlang is strong at concurrency, scalability, etc.Yarivnoreply@blogger.comtag:blogger.com,1999:blog-16940011.post-5093243698861364192007-12-29T17:56:18.000-08:002007-12-29T17:56:18.000-08:00So 29% of the programmers used functional language...So 29% of the programmers used functional languages and 53% of the successful programmers used functional languages. What can this mean?Jon Harrophttp://www.ffconsultancy.comnoreply@blogger.com