February 7, 2007

Hrmmm

  • What is a useful application of the Y Combinator? I found a JavaScript example, which I understand syntactically, but I don’t see the point. Is it just the “flavor of the month” in geek one-uppedness?
  • Finding an implementation of Haskell that runs on MacOS would appear to be an exercise in pain and IRC. Both of which I try to avoid.
  • I love the way that everyone and their brother is telling us what the “characteristics of a great programmer” are. Two observations:
    1. The lists are always different in significant ways
    2. The writer always seems to feel that they themselves have most, if not all, of the characteristics of a great programmer.

So really these posts should all be read as “Here’s why I’m a great programmer.
Update: Reg Braithwaite says “Learn the Y Combinator because it makes you a better programmer.” He then proceeds to write a blog post showing how he does exactly that. Which, while I respect Reg a lot, is yet another example of “Here’s why I’m a great programmer.” Reg’s approach, of course, is completely different from all the other posts on the same subject.

For the sake of argument, assume that every single of them is telling the truth, and that they are all, in fact, great programmers. What can you infer from that?

Update 2: In the comments, Reg insists he is not, in fact, a great programmer.  I’m not sure I can agree with him on that :)   He also insists that his approach will make one a better programmer, not a great programmer.

11 Comments »

  1. JB:

    You’ve put words into my mouth! What I said, and still say, is that learning the Y combinator makes you a better programmer, just as you quote.

    I stand by this.

    Will that make all and sundry great programmers? No, for the same reason that it doesn’t make me a great programmer.

    I leave you with a quote from one of my favourite movies that sums up what I actually think:

    Joe Gideon: Listen. I can’t make you a great dancer. I don’t even know if I can make you a good dancer. But, if you keep trying and don’t quit, I know I can make you a better dancer. I’d like very much to do that. Stay?
    Victoria: Are you going to keep yelling at me?
    Joe Gideon: Probably.

    That’s all.

    Comment by Reg Braithwaite — February 8, 2007 @ 3:45 am

  2. I suppose it’s not so much that the Y combinator is directly useful, it’s more that the mental tools you need to understand it are useful.

    I’m not entirely sure that that means it’s worth blogging about, but then I recently wrote an article about using continuations to implement non deterministic search on the way to solving Sudoku and Kakuro puzzles, so what do I know?

    Comment by Piers Cawley — February 8, 2007 @ 6:41 am

  3. The answer is very simple: we’re all full of crap.

    Comment by Jeff Atwood — February 8, 2007 @ 9:08 am

  4. Thanks for the very generous update!

    No, I’m not a great programmer. But let’s turn to something very insightful in your post:

    There are all these people, and they all have different paths to greatness, different ways of recognizing “great” (whatever that is).

    They could be all wrong, all full of crap.

    But what if they’re right? Isn’t that very interesting, the possibility that there is such a thing as greatness, but we don’t understand very well how to develop it, or a shortcut for recognizing it?

    Comment by Reg Braithwaite — February 8, 2007 @ 5:21 pm

  5. Yeah, Reg, that’s where I was going as well. I believe that there are many paths to greatness, and for each person, the path is probably different.

    I read an interesting article recently, which talks about the concept of “innate talent”. These scientists did some digging, and they discovered that “innate talent” is essentially shorthand for “10 years of focused practice and effort”

    Comment by jb — February 8, 2007 @ 5:27 pm

  6. Just to clarify, do you mean an old school Mac OS 9 and not a Mac OS X implementation of Haskell?

    Comment by Shane — February 8, 2007 @ 10:34 pm

  7. No, I’m usng MacOs X. I tried to download Hugs, and the DarwinLoader (or whatever it is called) blew up on me.

    Comment by jb — February 8, 2007 @ 10:44 pm

  8. The purpose of the Y combinator is to help you concretely see that the operation of taking a fixed point is something you can package up as an abstraction. The reason this is important is that it is sometimes the case that it’s very useful to have a custom fixed-point operation in an API.

    Here’s a concrete example. If you have a parser combinator library, like Haskell’s parsec, you’ll see that they implement recursion in grammars using the native recursion in the programming language. This works, but has the defect that using left-recursion will make your program go into an infinite loop. However, if you have a custom recursion combinator, you can instrument it to detect that you’re looping and break out of it. This means that left-recursive grammars will work just fine. This is an API that I couldn’t have built without knowing that the Y combinator existed.

    Comment by Neel Krishnaswami — February 9, 2007 @ 12:17 am

  9. My path to getting Haskell running on OSX was, if I recall correctly:

    1. Get Darwin ports.
    2. sudo port install ghc
    3. Profit.

    usage:
    ghc -o binary_file source.hs

    Comment by Peter Burns — February 9, 2007 @ 4:45 pm

  10. Hi Peter,
    Yeah, I tried that before. It blew up on me. I apparently don’t have the appropriate cc compiler set up.

    I found a workaround -> run WinHugs under parallels.

    Comment by jb — February 9, 2007 @ 8:04 pm

  11. I run OS X, and built ghc and hugs from the source, it worked just fine. The various ports collections are almost always more trouble than just downloading the source and running it yourself.

    Good luck.

    Comment by Bob Evans — April 15, 2007 @ 10:11 pm

RSS feed for comments on this post. | TrackBack URI
You can also bookmark this on del.icio.us or check the cosmos

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .