InquiryLabs

Politics, Programming and Possibilities

Archive for the ‘Uncategorized’ Category

I very much enjoyed reading about the benefits of functional programming over at Defmacro.org. The author, Slava Akhmechet, goes into some detail about several important advantages that I’ve been trying to enumerate for myself:

  1. Unit Testing: Since there are no reference to global variables or external state in FP, unit tests can focus precisely on the function that needs testing, without the difficulty of setting up a particular state before calling the function.
  2. Debugging: Again, without references to global variables or external state, debugging is simply a matter of drilling down to the problem.
  3. Concurrency: As a mathematical abstraction, functional programs have the potential to be reasoned about by the compilers and interpreters that run them. As a consequence, concurrency becomes a compiler option rather than a difficult-to-implement coding pattern.
  4. Hot Code Deployment: I would love to do this on a web server some time! No more software down time.
  5. Higher Order Functions: As an alternative to object-oriented programming, this feature caught my eye. I’ve been thinking in terms of closures for quite some time (thanks to Ruby) but I’m still getting used to the idea that OOP isn’t necessarily the best way to do things in every circumstance.
  6. Currying: This lets you build up functions from other functions. The typical example is in defining the “inc” function: it is simply the “add” function with the number “1″ bound to it for every subsequent call. No need to write a function to do that, just define “inc” in terms of “add”.
  7. Continuations: This aspect of FP (and other languages, such as Ruby) is fascinating. It’s very nearly an assembly language instruction, longjmp, but with the added benefit of an environment where variable state is stored. I like how Slava compares this with putting a computer to “sleep”—when the computer wakes up, it’s like nothing happened, even though time elapsed.
  8. Pattern Matching: Nice, but in agreement with the article, pattern matching doesn’t seem all that revolutionary. I could be wrong.
  9. Closures: Slava points out that this is a bridge between the OOP world and the FP world. In a special way, closures allow the formal lambda calculus to have a little exception to its strict recursive environments: closures can also access their parent environment in addition to their own.

I highly recommend this article for anyone who’s been thinking of functional programming and wants a “big picture” view. Excellent examples of real-world usage and some fun history to boot :)

The Color of Paradise

Kelty and I just watched The Color of Paradise (1999) by Iranian film director Majid Majidi. It is a beautiful story of an 8-year-old boy born blind, and his father, whose misfortunes in life have left him with little reason to believe in a merciful or kind God. The story ends unexpectedly, but gave us a sense of hope that there might be healing to come soon in their lives.

One of the most visually impressive aspects of this film is the countryside itself. I had no idea Iran’s mountainous regions were so beautiful. As our friend Victoria put it, “I thought Iran was a desert!” Majidi seems to use his films to show his optimism and the beauty he’s seen in life—much like an earlier age in America when theater was more innocent. Of the films I’ve seen from him, all are clean and uplifting.

  • 1 Comment
  • Filed under: Uncategorized
  • Mountain West Ruby Conference

    It’s here again! The Mountain West Ruby Conference will be held this March 28th and 29th (Friday / Saturday), this year in Salt Lake City. I went last time it was held in SLC and loved the location—the library there is remarkable, and seemed a nice location for a conference.

    I’m looking forward to meeting Ezra Z., the author of Merb, and as yet an “internet-only” friend of mine. There will be many other friends and brilliant minds there too. Come on out if you’re looking to learn more and meet new people in the business.





    Google Maps

    Ok, so it’s on digg, but still, if you haven’t seen it, you gotta…

  • 0 Comments
  • Filed under: Uncategorized
  • SaveBuckets: Nextag for the UK

    For my UK friends, SaveBuckets.co.uk is a price comparison website similar to our American “Nextag” site. You can find everything from audio books and mp3 players to clothes and shoes. I like the abbreviated results at the end: you get a very quick view of who’s selling something and for how much.

    Another thing that popped out to me as a web developer: there is a small animated spinner that is activated when you start a search. Unlike other spinners I’ve seen, this one spins very quickly. Subjectively, it felt like the search happened in a flash, even though it was quite likely a normal HTTP response time. Just a little trick in the toolbag to keep in mind :)

  • 0 Comments
  • Filed under: Uncategorized
  • Smorty: Advertorials for Blogs

    Some time ago, my friend and business partner, Greg Narain, and I set out to build a system for connecting bloggers and advertisers. Advertisers would get to create “campaigns” with intended marketing outcomes, and bloggers would get paid for writing content or reviewing products. We called it “xposted”, (like “cross-posted”), but in the end it never flew.

    Now, there’s a service called Smorty (blog advertising) that aims to do much what we’d tried. It looks like they’re on their way to building the necessary infrastructure and people capital to push them past the tipping point. I’ve joined up to see what it’s like. We’ll see what happens.

  • 0 Comments
  • Filed under: Uncategorized
  • Tomorrow is the Tea Party!

    Tomorrow is Sunday, December 16th, the anniversary of the Boston Tea Party in 1773. The revolution that began with a protest against the intolerable British tax is continuing in full force, this time with the campaign of Congressman Ron Paul who promises to stop using our tax dollars to fund foreign wars of aggression, and even to repeal the income tax with the help of congress.

    Join the 32,000 other individuals who have pledged to donate $100 tomorrow and let’s make another historical splash!

    One drop at a time, the dam will burst!

    Was Kucinich Set Up to be Discredited?

    It was a weird coincidence… but then, I’m a little more informed about politics now, so I wouldn’t be surprised to find out it was intentional.

    Democratic presidential candidate Dennis Kucinich recently spoke publicly about his skepticism over President George W. Bush’s sanity—literally. Said Congressman Kucinich:

    I seriously believe we have to start asking questions about his mental health… There’s something wrong. He does not seem to understand his words have real impact.

    Then, at the debate yesterday, Chris Matthews went to town after asking Kucinich to confirm that he (Kucinich) had once seen a UFO. It was as if “Hardball” Matthews couldn’t get enough laughs out of popping the UFO question on other candidates too—do you believe in UFOs? Is there a government conspiracy (haha)?

    First of all, it was one of those questions that really doesn’t help in a debate—sure, it might be interesting to know what a candidate thinks, but it was about as useful as Adam Curry asking if Ron Paul is a “folder” or a “scruncher”… irrelevant and irreverant.

    Second, it was clear from the context that Dennis was just being honest—he saw something in the sky, and couldn’t identify it, hence it is an Unidentified Flying Object (UFO). He marveled at the sight of it, and felt some kind of awe. This is a reaction I would expect from any open-minded individual at the sight of something mysterious.

    But the spin on the incident was out of this world—almost as if it was an intentional jab meant to cripple Kucinich’s earlier claim that President Bush may literally be insane. Who wants to believe our president is crazy on the word of some crazy guy, right?

    If it’s any consolation, Dennis, you’re not alone.

    UPDATE: Our favorite government news source, Fox News reports Dennis Kucinich’s UFO Comments Prove He’s Nuts.

    Ron Paul Needs Your Help

    The Ron Paul campaign is trying to boost funds for the end-of-quarter results (end of Sept.) and has kicked off a fun campaign where the results can be seen “live” as donors participate. I donated $5 bringing our family’s total donations to the campaign just over the $200 mark.

    On another note, I saw this anti-war protester via reddit.com. You’ll only get it if you speak HTML :)

    Kelty Dancers

    This was a song that my mother in law, Ginger, heard when she was younger. She later named her last child and my wife, Kelty, after the reference in it:

    oh the days of the kelty dancers
    oh the ring of the piper’s tune
    all for one of those hours of gladness
    gone, alas, like my youth too soon

    when the boys begin to gather in the glen of a summer’s night
    and the kelty dancers will be filled with joy and utter delight

    oh to dream of it
    oh to think of it

    oh to dream of it
    fills my heart with tears

    It was a beautiful thing to hear Ginger sing this the other night. I seem to be able to find the things I post here, so I’ve posted it since I never want to lose it :)