F# as a Second .NET Language

(Harry is @ DevTeach in Vancounver with his family this week. He was hoping to still do Morning Coffee posts, but that’s turned out to be infeasible. So instead, you get a series of pre-written posts about F#.)

I’ve been spending some real quality time with F# of late. I’ve been getting into parsing again, and it turns out that functional pattern matching languages like F# are really good at text processing. After claiming I’d learn F# this year, then abandoning the effort to learn Powershell, I went back to F#. Nothing against PowerShell – I’ve moved over to using it as my primary command line shell and have tricked out my startup script and everything. But I haven’t found much need to code in it lately.

If you’re a .NET ninja guru, you owe it to yourself to take a long look at F#, if for no other reason to expand your mind. It takes a while to get used to. Don Syme (aka father of F#) can attest I’ve been peppering him with questions (Thanks, Don!). I’ve also been writing code in C# and F#, and looking at the result in Reflector so I can understand what’s happening. I certainly am not an F# expert by any stretch, but I do think I’m getting the hang of it.

Since I’ve reached this first plateau of getting it, I thought I’d write out some of the things I like and don’t like about the language. This is by no means an introduction to F#. I’d recommend Robert Pickering’sFoundations of F# book as well as Don’s Expert F# book (when it comes out). You should also be reading Luke Hoban‘s and Jomo Fisher‘s blogs – they both just joined the F# team. C# MVP Tomas Petricek has written several blog posts introducing F#, which he’s brought together in a single post. For an general overview of functional programming (the primary programming paradigm of F#), check out Slava Akhmechet’s Functional Programming For The Rest of Us.

This turned into a fairly long post, so I split it out into a series that I’ll post thru the end of the week.

Update: added link to Tomas Petricek’s F# Introduction

Fans4Writers

Most of my readers get DevHawk via the RSS feed, so I wanted to explicitly call out a new addition to my flair. If you’re not aware, the Writers Guild of America is on strike. When you buy a $20 DVD, the writer makes a measly 4 cents. When you watch an episode of your favorite show online, the writer makes nothing. This video explains the situation pretty well.

Even though I’m about as liberal as you can get, I’m not a big union guy. Neither of my parents were in a union. Neither Julie nor I are in a union. My only exposure to unions growing up was negative, typically when the Washington Opera (where my mother works) was negotiating with the musicians or stagehands. I vividly remember one musician’s strike where one of their demands was to increase the minimum call size to be bigger than the size of the orchestra pit. Needless to say, that seemed like an unreasonable demand to me (though to be fair, I only heard the management side of the story).

In the recent hockey labor dispute, I was firmly on the side of the owners since day one. And while the teacher’s union is one of the strongest bastions of democratic party support, I think the modern education system is fundamentally broken. So while I am a liberal, I’ve never been a big union guy.

However, I’m firmly with the writers union on this one. I spent several hours tonight reading a bunch of strike-related blogs, like United Hollywood. Obviously, they’re coverage of the strike is pro-writer biased, but it’s hard to argue with the idea of a fair wage for Internet delivered content. I particularly like this video which is a series of clips of media CEOs bragging about how much money their companies can make online. Yet – again, according to pro-writer blogs – they refuse to even negotiate paying the writers a percentage of the money they make for using the writer’s content that way.

And to add a Media 2.0 spin to all this, there was a fascinating post wondering if Google could/would “scoop up the entire entertainment industry“. I don’t think substituting Google for AMPTP (which includes among others “big media” like Disney, Fox and Viacom) would be a good idea – new boss, same old problems. However, the idea of bypassing the studios with direct Internet distribution is a good one. One has to wonder how much this strike will accelerate that trend. This strike seems much more risky for the distribution companies & networks than for the writers – even direct distributed content needs to be written, right?

Afternoon Coffee 126

  • In a surprise to exactly nobody, the Caps let coach Glen Hanlon go yesterday. I gotta say I feel for the guy. I mean, he had to go, but still. The Caps promoted the coach of their minor league team Bruce Boudreau. Makes sense – the farm team is where you develop players, why not coaches too? The team responded by beating the Flyers in overtime, though they did blow a 3 goal lead along the way.
  • It won’t get them back in the national title hunt, but thrashing ASU may earn USC a ticket to a BCS bowl, or the Rose Bowl if the Ducks can’t win without Dennis Dixon.
  • I finally finished Dead Rising today. A sequel has been rumored and hinted at, but not confirmed even though the ending left the door wide open. I really enjoyed it, so here’s hoping. I’m going to hold off on starting anything new until I get back from Canada, but it’ll probably be R6:Vegas. Don’t really have time between now and Christmas to finish Blue Dragon and it’s 3 DVDs.
  • In more “Screw Turkey Day, we’re shipping anyway” news, p&p shipped a new version of the Web Service Software Factory. This one’s called the “Modeling Edition”. I saw some of this stuff back in August, and I like what those p&p folks are doing. It’s worth a look, just to see how they’ve integrated DSL and GAT.
  • My old team shipped a new version of their S+S demo app LitwareHR. There’s also some tools for testing multi-tenant databases.
  • Quick reminder: I’m @ DevTeach Vancouver next week, so blogging will be light. I’ve got a series of thoughts on F# ready to post, but we’ll see when I get network access to post them. Given that I took a month off from blogging a short while back, I didn’t bother asking Dale to cover for me.

Morning Coffee 125

  • So I wasn’t quite as close to the end of Dead Rising as I thought I was. Those who’ve played the game thru will understand.
  • After their promising start, the Capitals lost yet again. At the 20 game point, they’re now 6-13-1 for a league-worst 13 points. I think we’re at the point where they need to fire Glen Hanlon. Nothing personal Glen, but it’s not getting done. The only problem is who you would replace him with? Bob Hartley? Uh, no thanks. I think most Caps fans want Dale Hunter, but I think he’s too involved with the London Knights – he’s co-owner, president and head coach. But if we could get Dale, I’m guessing Glen would be gone in a heartbeat.
  • The XNA team blog announced that XNA Game Studio 2.0′s beta has released. The download is available from Creators Club Online. The big new feature in this release is network support, and they’ve shipped a new starter kit to get you started.
  • In addition to shipping VS08 & .NET FX 3.5, a new CTP of SQL 2008 shipped yesterday. I couldn’t find a good overview of what’s new, but the SQL Express team has a post on what’s new in just their corner of this release. (via Jesus Rodriguez)
  • In more “I know it’s Thanksgiving week, but we’re shipping anyway” news, the Ruby.NET folks have shipped v0.9 – the first release since transferring control to the community. Does it run Rails? Not yet, but apparently they’re “close to getting Ruby on Rails to run successfully”. One thing that caught my eye is that it includes VS integration. Nice.

Morning Coffee 124

  • While my blog was down last week, I finally finished Gears of War. I played thru on hardcore, but had to throttle back to casual to beat the last boss. I’d like to try and finish on hardcore, but I’ve moved on to Dead Rising – another game from last year I never had time to finish. I’m almost done the main play mode, though I understand there are other play modes that get unlocked when you finish it.
  • I’m forbidden from buying any new games before Christmas, so Mass Effect, Assassin’s Creed and The Orange Box will have to wait. My next game will either be Blue Dragon, which a friend let me borrow, or R6:Vegas, yet another (but the last) game from last year I never got time to play.
  • I’ll skip the “giving thanks” jokes and point out that Visual Studio 2008 and .NET FX 3.5 have shipped.  Soma has the announcement and both Scott Guthrie and Sam Gentile summarize what’s new. The Express editions are available from the new Express Developer Center. The VS SDK doesn’t appear to be released yet, but I’m sure it will be along in due course.
  • Speaking of VS SDK, CoDe Magazine did an entire issue on VS Extensibility which you can read online or download as PDF.
  • Nick Malik took a bunch of heat back in June for what some thought was a redefinition of Mort, one of the Developer Division personas. Now Paul Vick thinks it’s time to retire the Mort persona, primarily because of the negative connotation the name carries. His suggestion for a replacement is Ben (as in Franklin). And did you notice how similar Paul’s description of Mort is to what Nick described? I’d say some folks owe Nick an apology.
  • I said Friday I was going to take a closer look @ OpenID and OAuth. There’s an intro to OpenID on their wiki and Sam Ruby’s OpenID for non-SuperUsers seems to be the canonical source on implementing OpenID on your own blog. Frankly, reading the OpenID intro reminded me a lot of WS-Federation Passive Requestor Profile. Does OpenID have the equivalent of an “active” mode?
  • Likewise, the Beginner’s Guide to OAuth series of posts by Eran Hammer-Lahav is a good intro to OAuth. The phrase “Jane notices she is now at a Faji page by looking at the browser URL” from the protocol walkthru makes me worry that OAuth is vulnerable to phishing. Having one of the OAuth authors call phishing victims careless and wishing for Karl Rove to “scare people into being more careful and smarter about what they do online” makes me think my fears are well grounded. I’m thinking maybe OAuth and OpenID aren’t quite ready to nail down WS-*’s coffin.
  • In researching OpenID, I came across this presentation hosted on SlideShare. I had never seen SlideShare before – it’s kinda like YouTube for presentations. Sharing basic presentations is kinda lame – there doesn’t appear to be any animation support, so the slides are basically pictures. However, they also support “slidecasting” where you sync slides to an audio file hosted elsewhere. That I like. I have a bunch of old decks + audio, maybe I’ll stick them up there.