iMeme for Mac Nerds

If you’re on a mac right now, make a list of all the applications in your /Applications folder which begin with a gratuitous letter ‘i’.

Here’s a magical ruby one-liner to cut and paste into a Terminal to list them:
ruby -e 'Dir[%q{/Applications/i*}].each { | app | puts /\/(i.*).app/.match(app)[1] }'

My list:

  1. iAlarm
  2. iAlertU
  3. iCal
  4. iChat
  5. iExtractMP3
  6. iJournal
  7. iMovie HD
  8. iPhoto
  9. iRecord
  10. iSquint
  11. iStumbler
  12. iSync
  13. iTag
  14. iTunes
  15. iWeb

Fifteen. How bout you?

Jack OS X works with Leopard

Jack OS X – a Jack implementation for Mac OS X: — just updated to work with Leopard. Or rather, the updates which make it work with Leopard are just now out of beta and on the front page. I took it for a spin this morning and routed a streaming story from NPR’s Flash player into Audacity, so I could make an MP3 of it. Spiffo! You gotta read the documentation though, it’s not super intuitive.
Jack is awesome. Jack is Free Software, originally developed for Linux. Yet when I actually use Linux, I never even try to use Jack, because Linux sound is so fragile in the first place that adding another possible point of failure to the mix seems downright foolhardy.

Haskell is kind of cool.

Back in about 2000-2001, I was doing first tech support and then configuration management work for a big company in Chicago, and, basically because I was lazy and curious I would spend more time than I should have reading, on the web, about programming, especially programming languages, especially unusual ones.

That was when I first started getting interested in Ruby, and read the online Pickaxe Book; that’s when I read beating the averages and wanted to be an Eager Young Lisp Cadet (much like the inimitable Bruce!), I downloaded Squeak and learned a little Smalltalk; and I got geeked about pure functional programming by reading John Hughes’ paper, Why Functional Programming Matters. Hey, anything but do the work I was being paid to do!

The Hughes paper led me to Haskell, and I read the Gentle Introduction to Haskell , at least up to the IO chapter, which linked forward to the Monads chapter, which was too much for my poor little brain.

The thing was, at the time, I wasn’t programming professionally or really much at all. I’d read about programming, done tiny little fun programs, done a lot of system scripting in Perl, and learned about the languages, but I’d never been a “real” programmer. This kept my mind open to wacky languages but it kept my understanding shallow.

A couple jobs later, I was doing actual programming for a living, but in Perl (the first language I’d actually used on the job, and so the one I was best at). While I wasn’t paying attention to it, Ruby suddenly became really popular thanks to this “web application framework” called Rails, maybe you’ve heard of it.

Now it seems like Haskell is starting to accumulate buzz. There’s almost as much jibberjabber on Reddit about Haskell (especially Monads) as there is about Ron “we can safely assume 95% of black males are criminals” Paul.

I’ve recently gone back to it, got a copy of the compiler working on my , and followed some of the good tutorials, and I finally realized that Haskell’s “monads” weren’t really as hard to understand or weird as I had thought.

I even wrote a little program that rolled dice. It compiled. It used the IO Monad. It used the Random Monad (indirectly — you can just pull random numbers into an IO Monad). It was maybe a dozen lines long, and verbose at that. I rewrote every part of it several times, so I wasn’t just cut and pasting code, butunderstood exactly how it was doing its thing, and I played around with the monad operators and “do-notation” and all that.

In the end it all turns out not to be a big deal.

OK, now what?

I’d love to go learn more about Haskell. But you know what? I don’t actually program in my spare time much. Just stupid little utility scripts from time to time. Convert videos from flv to mpg using mencoder. Generate clever passwords (I have a command line script that does what this does). Automate an rsync backup. I guess I could try writing those in Haskell instead of shell or Ruby, which is what I usually use. Maybe eventually it will lead to something interesting.

We’ll see. Haskell isn’t the only language that fascinates me but it’s the one I’ve had a long fascination with and done very with, mostly because of the silly “oh no I can’t grok monads” hurdle. I was prompted to write this up because I just started following the fascinating notes on haskell blog, whose author, Adam Turoff (a pointy-headed comp sci sounding name if there ever was one), wrote up a spiffy three-part intro to Haskell for, beginning here.

A Glimmer of Haskell

I think I’m starting to actually grasp Haskell’s monads. I’ve been reading the Haskell wikibook and this article on Monads as Containers…

And I’ve been dinking around just a little and little things like this are making sense to me:

Prelude> return("won't you take me to") >>= (\line -> putStrLn (line ++ " funKAYTOWN"))
won't you take me to funKAYTOWN
Prelude> ["won't you take me to"] >>= (\str -> [str ++ " funKAYTOWN"])
["won't you take me to funKAYTOWN"]

Cool. I’ve wanted to learn me some Haskell for a long time (I think I first checked it out in 2001?), but somehow the abstraction in monads was a little more than I could focus on. Now it’s starting, starting to make sense.
The fact that it’s been this hard to get me this far doesn’t suggest that I’m going to be a master Haskellist any time soon, but at least there’s some hope.