Morning Coffee 173

I’m on my way out the door for New Zealand and Australia, but I wanted to push out a few things.

  • F# August September CTP is out! Don Syme has the announcement, Jomo Fisher has the link roundup and details are on the brand-spanking-new MSDN F# Dev Center. Major congrats to the F# team. I’ve been running a pre-release version of these bits, and they are a huge step forward if you’re an F# developer.
  • I’ve got an article on IronPython in the latest issue of CoDe magazine. Also check out Brad Wilson’s IronRuby article, Ted Neward’s F# article and Neil Ford’s Polygot Programming article.
  • Via Michael Foord I discovered that IronPython tester Dave Fugate is back on the blog. He starts with a couple of posts about measuring IronPython performance.
  • Speaking of blogging teammates, I think the dynamic languages team has the highest percentage of bloggers in any group at MSFT. All four Program Managers (Dave (lead), John, Jimmy and me), four of five developers (Shri (lead), Dino, Curt and Oleg) and all three Testers (Jim, Dave and Srivatsn). The only non blogger right now is Tomas – who at least has a home page – and  the lead tester which is an open position right now. 11 bloggers out of 12 team members equals 91.67% team blogger coverage.
  • I was really impressed with Newspeak when I saw it at Lang.NET so I’m very excited to see they have a new website. No public bits yet, but I like the part where they point out Newspeak “can be implemented independently of Squeak, Smalltalk or any particular VM or IDE”. How about implementing a version on DLR guys?
  • Maurice de Beijer shows off embedding IronPython inside a WF application. Kinda cool, but he’s primarily showing off implementing a CLR interface in IPy. How about a WF activity that execute arbitrary IPy code. That would be cool. (via IronPython URLs)
  • Ironclad has reached their 0.5 milestone, being able to import numpy from IronPython. BTW, guys – I’m not sure commenting out one line that appears to be unreferenced qualifies as a “monstrous caveat”. Congrats guys! (via IronPython URLs)

Morning Coffee 172

  • I took the kids to see Fly Me To The Moon recently. We had to trek to Monroe (about 30 minutes away) because it’s a special 3D movie, and it was only playing there and in downtown Seattle. The movie’s story is insipid – three flies stow away on Apollo 11 – but all the space shots were actually kinda cool. It sure felt like they wanted to be scientifically and historically accurate about the the actual mission (well, other than the part about the flies). Patrick really liked it (he wants to build a rocket in the back yard) and Riley sat thru the whole thing with a minimum of fussing.
  • I’m a big fan of Joe Biden, so I’m really happy Obama picked him to be his running mate.
  • I know it’s old news but what the frak was John Edwards thinking? I like his policies, but the arrogance it takes to run for president when you know you’ve got that skeleton in your closet is mind-boggling.
  • On the other hand, watching the Sean Hannity and guest’s hypocrisy on Edwards’ affair, only to watch them scramble like cockroaches when Colmes points out McCain had admitted to having an affair was frakking hilarious.

OK, onto geek stuff:

  • My new boss Dave Remy has moved to a new blog. If you’re curious what he was up to for the 10 months he was away from Microsoft, he’s happy to share.
  • IPy and IRuby developer Curt Hagenlocher (aka Iron Curt) is blogging. Cue the Ozzy…I AM IRON CURT. Or don’t. Anyway, he dives in the deep end of the pool – no “hello world” lollyblogging for Iron Curt – digging into the stack implications of rethrowing exceptions and debugging emitted IL.
  • Srivatsn writes about static compilation of IPy scripts. Note, we’re not talking about static typing – it’s still the same good-old dynamically typed IronPython, just packaged up as an assembly, rather than as a bunch of .py files. Note, if you’re interested in compiling IronPython, you should check out the PYC sample we published as part of Beta 4.
  • Speaking of IPy Beta 4, Shri Borde posts about the COM dispatch support which is enabled by default as of Beta 4. If you’re driving COM automation clients (like Office) from IPy, this is a huge improvement over the old mechanism.
  • Jeff Hardy has released a new version of NWSGI, a managed version of Python’s Web Service Server Gateway Interface. My understanding is that this would allow any Python web stack written against WSGI to run in IIS with IronPython (subject to IronPython’s compatibility with CPython). Jeff’s been documenting his efforts getting Django running with NWSGI on his blog. Awesome work Jeff! (Thanks for the correction Seo!)
  • I never really bought into the “Attention Economy”, but Chris Anderson’s economic analysis of his DIY Drones site traffic was fascinating.
  • Lutz announces “it is time to move on” from Reflector and there was a collective horrified scream in the .NET community. He’s handing it over to Red Gate, who promised they “will continue to offer the tool for free to the community”.
  • I missed this when he posted it in June, but I really liked Nikhil Kothari use of the DLR in Silverlight to cut down on the XAML verbosity in his ViewModel action binding.
  • Brian McNamara previews the new Add Reference and file ordering support in the upcoming F# CTP. I’m really looking forward to the project-to-project reference support. I can’t tell you how many times I’ve gotten burned because my main project recompiled but my test project didn’t. You just get used to hitting Rebuild All instead of Build. As for file ordering, it’s a bit of a bummer that F# requires it, but the new experience is hella better than editing the project file by hand. I’m really looking forward to the new CTP.

Missing Missing Persons

I’m having a hard time focusing on work today. I just found out that a good friend and ex-teammate Robert Satterwhite passed away last week.

I spent a year on the .NET Adoption Team with Robert back in 2002 & 2003 – basically my last year in the Microsoft field organization. NAT – as were were known – was a national team of developer and architecture evangelists, so while we were all teammates, we didn’t see much of each other in person. However, Rob and I both lived in the Puget Sound area and called on many of the same customers – I was an architect evangelist and Robert was a developer evangelist – so we ended up working together often. We drove together to Olympia many times- he drove and I hacked code in a kind of strange pair programming effort.

Robert grew up in the Pacific NW and had spent almost his entire career as an enterprise technology sales engineer here, so he had friends everywhere. I often used the lame line from the Dragnet movie with Dan Aykroyd: “They ought to put you in Missing Persons. You know everybody.” because it seemed like everywhere we went we’d run into someone he grew up with, had worked with or had sold to. If we hung around before or after a sales call – coffee shop in Olympia before a meeting, debriefing with the sales rep on the steps outside of Costco HQ in Issaquah, etc – chances are someone would recognize him.

When I was leaving the NAT, Robert and I went to Phoenix so I could hand off my customers there to him. I joked that at least I could be sure we wouldn’t run into anyone he knew in Arizona. Yet, it turned out he used to work with the woman who was sitting in front of him on the flight home. She and her husband owned car dealerships in Phoenix and Tacoma. I was astonished – what are the frakking odds? – but Rob just shrugged his shoulders. It happened to him all the time so I guess he was used to it.

I only saw him off and on since I left the team, though as fate would have it I did see him last week on the day he died. I was heading into building 18 for a meeting as he was pulling into the parking lot – I hadn’t realized he was working on campus. We exchanged the usual pleasantries and promised that we’d get together soon. He was blocking traffic, so it was a short conversation. 24 hours later, he was dead.

Rob wasn’t your prototypical blue monster, but he sure touched a lot of people and he made the world a better place by just being himself. You will be missed, Rob.

Monadic Philosophy Part 5 – Reader Comments

Barry Kelly thinks that “programmers would understand monads better if they were described as a design pattern”. I agree 100% and would love to see a monad design pattern written out using p&p’s pattern form. The one thing I would note on this is that certain language constructs can make working with certain design patterns easier. For example, C# obviously has great language level support for the Iterator design pattern. Once you’ve got language level support, it doesn’t really feel like a design pattern anymore, it feels like a language feature. I mean, given that you can write OO code in a language like C, does that mean technically OO is a “design pattern”. I don’t think so.

A commenter named atp warned me not to “fall into the newbie trap of thinking that monads are about sequencing operations. They aren’t. A large number of monads (for example, Reader) are commutative and do not enforce any sort of statement ordering.” Fair enough. For example, you switch the order of some LINQ operators and still end up with the same result. If you switch Where and Select, you should end up with the same output (assuming the where clause isn’t invalidated by the select projection). But from a C#/F# perspective, I don’t really care about monads for enforcing order anyway – the language has that natively. I care much more about the context flow aspect of monads, which it sounds like atp thinks we should be focused on anyway. Works for me.

Finally, Yuri K. pointed out that we aren’t really stuck with the nested lambda expression syntax in C#. In Luke Hoban’s Monadic Parser Combinators using C# 3.0 post, he implements a Where, Select and SelectMany extension method for his Parser delegate type, which allows him to plug into C#’s query comprehension syntax. He’s 100% correct and I considered including this fact in my post. However, the mapping between query comprehension and the Bind and Result functions is a little murky, so I skipped it.

For C# query comprehensions, basically SelectMany does double duty, not only binding the parser and the parser generating function (which Luke called ‘selector’), but also taking the two parse values and calling to a projector function and returning the projection return value in a Result. By implementing SelectMany, you can rewrite the TwoValues parser like this:

static Parser<string> QueryTwoItems()  
{  
    return from v1 in Item()
           from v2 in Item()
           select string.Format("{0}{1}", v1, v2);  
}

which looks pretty much identical to the F# monadic syntax version. Luke also implements Where, which I have in my F# parser library as Satisfy. Where takes a parser and only returns the parser result if the provided boolean predicate returns true. Select is a projection, similar to SelectMany but only used with a single parser. I have a couple of specific projectors in my F# library (Ignore which tosses the parse result and Listify which turns a single result into a single item list) but I haven’t had any need for a generic projector like Select. I’m assuming Luke only implemented Select to make the query comprehension work when you don’t have multiple from statements.

Nobody Cares That I Called McCain a Dick?

In Febuary, when I said “Romney’s a real douche bag”, several upset commenters vowed never to read my blog again. I was even called a bigot (though Dale jumped in and explained how wrong a charge that is). Frankly, anytime I run a political post, especially ones where I call prominent Republicans names, that’s the reaction I expect.

So it kinda surprised me that the response to calling McCain a dick and his campaign an embarrassment was so tepid. No outrage. No promises to unsubscribe nor predictions that others would do likewise. Dale sounds like he agrees that McCain’s campaign is an embarrassment, even though he clearly supports McCain. RandyG doesn’t have anything to say about McCain one way or the other, but he thinks Obama is a “pompous dick”. Only BigJ provides any defense of McCain at all, but it’s an extremely weak defense. He described McCain as “not afraid to tick off a powerful, influential, big money contributor”, which I would expect is hard to say out loud with a straight face. Given that McCain has raked in millions in contributions from the oil industry after flip-flopping on offshore drilling, describing the Hilton’s $4,600 contribution as “powerful, influential, big money” is laughable. Hell, McCain is returning ten times that amount in “unusual” (read: possibly illegal) contributions because they “just didn’t sound right”.

I figure there are two main possible reasons for the lack of outrage:

  • All my readers who are willing to unsubscribe because I don’t agree with their political view have already left, leaving only those who agree with or simply ignore my political posts.
  • The number of people willing to stand up and defend McCain, even anonymously in my small corner of the Internet, is very small.

Personally, I probably a little of both, but I’m guessing it’s more the latter than the former.